Hex Decoding into Assembly Language: Disassembly and Instruction Encoding cover

Programming · Ebook

Hex Decoding into Assembly Language: Disassembly and Instruction Encoding

by Shriira Press

4.5(3,244)112 pagesPublished 2026

A comprehensive, self-contained guide to the reverse of assembly — taking raw hexadecimal machine code and decoding it back into human-readable assembly instructions. This is disassembly, and it rests on understanding instruction encoding: how a CPU's instructions are represented as bytes, how the bytes split into opcode and operand fields, and how a decoder walks a byte stream turning 48 01 D8 into add rax, rbx. This book teaches that skill across architectures — the byte-level formats of x86/x86-64, ARM, RISC-V, MIPS, and more — blending intuition (what decoding is and why it's hard), concepts (encoding formats and the decode algorithm), and runnable practice (decoding by hand and writing a disassembler). It includes a multi-architecture encoding catalog (Appendices C–H) and the actual ISA manuals (in manuals/) that are the ground truth for every encoding.

Contents

  1. 1Preface
  2. 2Chapter 1 — What Is Hex Decoding?
  3. 3Chapter 2 — From Hex to Instructions: The Decoding Problem
  4. 4Chapter 3 — Instruction Encoding Fundamentals
  5. 5Chapter 4 — The x86 Instruction Format
  6. 6Chapter 5 — Decoding x86-64 by Hand
  7. 7Chapter 6 — x86 Addressing: ModR/M and SIB Decoding
  8. 8Chapter 7 — Decoding ARM (AArch64)
  9. 9Chapter 8 — Decoding RISC-V
  10. 10Chapter 9 — Decoding MIPS and Fixed-Width ISAs
  11. 11Chapter 10 — Building a Disassembler
  12. 12Chapter 11 — Tools of the Trade
  13. 13Chapter 12 — Challenges: Variable Length, Code vs. Data, and Obfuscation
  14. 14Chapter 13 — Hex Decoding in Practice and the Profession
  15. 15Appendix A — Glossary and Quick Reference
  16. 16Appendix B — Further Reading and the ISA Manuals
  17. 17Appendix C — x86 / x86-64 Encoding Catalog
  18. 18Appendix D — ARM Encoding Catalog (AArch64 & AArch32)
  19. 19Appendix E — RISC-V Encoding Catalog
  20. 20Appendix F — MIPS Encoding Catalog
  21. 21Appendix G — 6502 Encoding Catalog
  22. 22Appendix H — Other Architectures: Z80, AVR, PowerPC, SPARC