Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Reverse Engineering Java (XMI)

Options
  • 14-08-2006 10:12pm
    #1
    Closed Accounts Posts: 199 ✭✭


    Hi

    I'm currently doing a little research on reverse engineering java and round trip engineering.

    I'm just wondering what tools do you use to generate UML and does that tool produce an XMI output?

    Also do you use these tools to do reverse engineering?

    Whats your favourite tool and why?

    Thanks for your input

    B2


Comments

  • Closed Accounts Posts: 503 ✭✭✭OMcGovern


    I don't use it, but the Eclipse IDE has various UML plugins.

    I doubt any of them output XMI.
    I wrote my own java disassembler a while back, and output the results to a custom XML format ( my own DTD )
    I never got around to continuing after that, but the XML output had all the details on classes, superclasses, interfaces, methods, which methods the methods called etc.... Writing your own disassembler is a non-trivial task.
    I integrated it into an Ant Task, so that it could run through a full build system and produce metadata about the results. (usually a 35Mb XML file !)

    At some stage I should probably release it as an open source project, cos I've stalled with it due to lack of enthusiasm.

    regards,
    Owen


  • Closed Accounts Posts: 453 ✭✭nuttz


    Beta2 wrote:
    I'm just wondering what tools do you use to generate UML and does that tool produce an XMI output?
    I think you'll find most if not all UML modeling tools export to XMI
    Beta2 wrote:
    Also do you use these tools to do reverse engineering?
    I'd be interested in other people's answer to this also.


  • Closed Accounts Posts: 199 ✭✭Beta2


    Thanks for your replys

    OMcGovern - That sounds really interesting, I'm doing this for my thesis and I'm not sure what angle I'm gonna attack it from yet.

    nuttz - So far I've mainly been looking at opensource tools and many of them don't. Going forward I'll concentrate more at comercial tools.


    B2


  • Closed Accounts Posts: 503 ✭✭✭OMcGovern


    Beta2 wrote:
    OMcGovern - That sounds really interesting, I'm doing this for my thesis and I'm not sure what angle I'm gonna attack it from yet.

    Rather than reinvent the wheel, there's libraries out there, like BCEL ( byte code engineering lab ) which allow you to disassemble and reassemble java byte code.

    As I said, a disassembler is a non-trivial project, and when I begun it, I had a degree, 8086 assembly language, 5 years of commerial C++ and 1 year of java behind me. There's 265 java classes in my disassembler, 206 of them are for each individual java byte code instruction.

    I just worked from one reference source, the VM spec here.

    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html

    But there's a few gotchas in there to trip you up, eg. Long and Double types take up 2 places in the constant pool, so the constant pool count in the class file is usually wrong and depending on the number of Longs & Doubles used.

    If you get stuck, post questions in the Virtual Machine section of the Java forums...

    http://forum.java.sun.com/forum.jspa?forumID=37

    regards,
    Owen


  • Registered Users Posts: 1,504 ✭✭✭viking


    Haven't programmed in Java in a few years but I came across 'Decafe' before which would decompile classes back to functioning source code.


  • Advertisement
  • Registered Users Posts: 33 TabulaRasa


    If it's a decompiler you're after, then try JAD I have used it for years and I have yet to see it fail me.


Advertisement