3 ms·
Oh, cool. This is the first time I've encountered anyone else mentioning hand decompilation of x86-64 instructions. I spent some time doing that with small bina
by xelxebar 3y ago
Oh, cool. This is the first time I've encountered anyone else mentioning hand decompilation of x86-64 instructions. I spent some time doing that with small binaries a while back. The original motivation was SmithForth[0].
For those interested in this kind of thing, here are some useful resources I've stumbled upon:
- x86 Instruction and Opcode Reference: http://ref.x86asm.net/ http://ref.x86asm.net/
Probably the best reference for navigating opcodes. It's extreme detail gives a good sense of x86 ISA nuances.
- Intel XED: https://intelxed.github.io/ https://intelxed.github.io/
An library and CLI tool for encoding and decoding instructions between hex and their mnemonics. This tool gave me a fun side quest, sending upstream a patch to make the build reproducible.
- Intel Software Developer Manuals
It takes a little bit of time to get into the groove with these, but the first chapters of each volume contain excellent high-level explanations of the different moving pieces in modern x86 chips.
- Agner Fog's optimization resources: https://www.agner.org/optimize/ https://www.agner.org/optimize/
Excellent resource for going beyond the ISA and understanding microarchitectural details.
Anyway, I'm still quite green, but if anyone's interested in chatting about this kind of thing, feel free to ping me. Email should be in my profile description.
[0]:https://dacvs.neocities.org/SF/ https://dacvs.neocities.org/SF/
- kenanb 3y agoAuthor here. Thanks a lot for the links! I was actually collecting the relevant resources in another post I published yesterday: https://blog.kenanb.com/code/low-level/2024/01/07/x86-insn-encoding-resources.html https://blog.kenanb.com/code/low-level/2024/01/07/x86-insn-e... Intel XED was missing, so I just added that one as an update at the end, quoting your description. I had a look at Intel XED earlier. I found it interesting but had difficulty navigating the sources. I will give it another try. Thanks! Re SmithForth: I was just watching through the "Handmade Linux x86 Executables"[0] videos from the same person. Definitely super interesting series of work. [0]: https://www.youtube.com/playlist?list=PLZCIHSjpQ12woLj0sjsnqDH8yVuXwTy3p https://www.youtube.com/playlist?list=PLZCIHSjpQ12woLj0sjsnq...