Loaders may make use of existing processor modules, ormay
require the creation of entirely new processor modules if the CPU type was previously
unsupported. An excellent example of a loader module is one designed to parse ROM
images from gaming systems. Several example loaders are supplied with the SDK in the ldr
subdirectory, while several example processor modules are supplied in the module subdirectory.
Loaders and processor modules tend to be required far less frequently than plugin
modules, and as a result, far less documentation and far fewer examples exist to assist in
their creation. At their heart, both have architectures similar to plug-ins.
Chapter 13: Advanced Static Analysis with IDA Pro
333
PART IV
Loader modules require the declaration of a global loader_t (from loader.hpp) variable
named LDSC. This structure must be set up with pointers to two functions, one to
determine the acceptability of a file for a particular loader, and the other to perform the
actual loading of the file into the IDA database. IDA??™s interaction with loaders is as
follows:
1. When a user chooses a file to open, IDA invokes the accept_file function for
every loader in the IDA loaders subdirectory. The job of the accept_file function
is to read enough of the input file to determine if the file conforms to the
format recognized by the loader.
Pages:
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598