How Zasm's core components work together
masterZasm is designed as a high-level assembler and decoder for x86-64 code, using Zydis as a backend. It operates through four primary abstractions:
- Program: The central container. It acts as a doubly linked list of nodes (instructions, labels, data, sections, etc.), allowing you to easily insert, remove, or re-order code elements.
- Assembler: The interface used to populate a
Program. It provides member functions to emit instructions and data at a specific cursor position within the program. - Serializer: Converts the
Programnodes into actual binary. Once serialized, you can query the resulting binary for label addresses, relocation information, and section data. - Decoder: Converts existing binary data into
Instructionobjects, which can then be used directly or inserted into aProgramfor manipulation.