How I learned to translate some of is was to do this:
1) Install NASM.
2) Write some working assembly code, and compile it.
3) hexdump -C outputfile
This will show you the bytes! As well in Ollydbg you can just hit a certain line of instructions and right click go "Follow in Dump -> Selection", then in the bottom right hand pane you'll see the instruction, then right-click and hit "Hex -> 16 Bytes" and you will see what the instructions translate to. Hope this helps.
> lausybob: ASM is quite understandable, though it should just be possible to read bytecode too shouldn\'t it?
>
> Anyone got a bytecode dictionary i can use as a reference?
Hello lausybob,
Personally, I don't think understanding and reading byte-code would be the most effective way to do reverse engineering on compiled class/ archived jar files, however if you insist to go with this approach here are some links for the class files format and the java-opcode that would be more than enough:
http://en.wikipedia.org/wiki/Class_(file_format)
http://en.wikipedia.org/wiki/Java_bytecode
I suggest using JAD decompiler where you can decompile *.class files and modify the decompiled code:
http://www.kpdus.com/jad.html
Keeping in mind that JAD only supports the following class versions: 45.3, 46.0 and 47.0 and the best work around for the unsupported classes� versions is to use a tool called retroweaver were you can transform new classes to the old (supported) ones:
http://retroweaver.sourceforge.net/
> jms: How I learned to translate some of is was to do this:
>
> 1) Install NASM.
> 2) Write some working assembly code, and compile it.
> 3) hexdump -C outputfile
>
> This will show you the bytes! As well in Ollydbg you can just hit a certain line of instructions and right click go \"Follow in Dump -> Selection\", then in the bottom right hand pane you\'ll see the instruction, then right-click and hit \"Hex -> 16 Bytes\" and you will see what the instructions translate to. Hope this helps.
Hmm, quite alot of work there aye? Well, if there's no such thing as a dictionary this seems to be the best approach.
I wasn't looking into java, but thanks for the info on that topic too.
> Anyone got a bytecode dictionary i can use as a reference?
Do you mean "opcode" reference? Are you trying to read hex representations of x86 instruction statements? You're question is not specific enough.
If I'm guessing correctly, go to the source:
Intel� 64 and IA-32 Architectures Software Developer's Manual, Volume 2A: Instruction Set Reference, A-M
Intel� 64 and IA-32 Architectures Software Developer's Manual Volume 2B: Instruction Set Reference, N-Z
http://www.intel.com/products/processor/manuals/index.htm
Each mnemonic is listed with a concise technical description and its representative bytes (i.e. sysenter 0x0f34h).
You'll see that Appendix A.3 has an opcode table for one, two and three byte opcode maps. You'll need to read the "using opcode tables" section to decipher the tables. Good luck!
You could check out the asmsrv.c tables of Oleh Yuschuk's earlier Ollydbg source, or the opcode table section of Matt Connover's x64dis code in disasm_x86_tables.h, to see how they are used in disassemblers.
Also, turn on and pay attention to the opcode bytes provided in olly and ida listings, presented along with the disassembled code.