SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 588 | Next

Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness

"Gray Hat Hacking, Second Edition"

This structure must be initialized to point to a number of arrays and
functions that will be used to generate the disassembly listing. Required arrays define
the mapping of opcode names to opcode values, the names of all registers, and a variety
of other administrative data. Required functions include an instruction analyzer whose
job is simply to determine the length of each instruction and to split the instruction??™s
bytes into opcode and operand fields. This function is typically named ana and generates
no output. An emulation function typically named emu is responsible for tracking
the flow of the code and adding additional target instructions to the disassembly queue.
Output of disassembly lines is handled by the out and out_op functions, which are
responsible for generating disassembly lines for display in the IDA disassembly window.
There are a number of ways to generate disassembly lines via the IDA API, and the best
way to learn them is by reviewing the sample processor modules supplied with the IDA
SDK. The API provides a number of buffer manipulation primitives to build disassembly
lines a piece at a time. Output generation is performed by writing disassembly line
parts into a buffer then, once the entire line has been assembled, writing the line to the
IDA display.


Pages:
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600