Can I get assembly code of an exe file using java?

142 views Asked by At

Hi I need to view code of an .exe file which has to be loaded dynamically. So, is there any method of obtaining source code of an exe file in Java or do I need another language to do that?

1

There are 1 answers

0
Marged On

Standard Java will presumably not be able to do this because what you want to do is platform specific.

I don't know any library that is able to do this.

What you could do is take the exe, extract its code segments and compare their content to a list of opcodes. You could then for example simply iterrate over the bytes and create a list how often hex 0x90 is found, which is an indication for a nop.

Perhaps it is a better solution to simply disassemble the file (into "sourcecode") and count the occurences based on their text representation.