IDA C++ SDK 9.2
Loading...
Searching...
No Matches
loader_t Struct Reference

Loader description block - must be exported from the loader module. More...

#include <loader.hpp>

Public Member Functions

 int (idaapi *accept_file)(qstring *fileformatname
 Check input file format.
 void (idaapi *load_file)(linput_t *li
 Load file into the database.
 int (idaapi *save_file)(FILE *fp
 Create output file from the database.
 int (idaapi *move_segm)(ea_t from
 Take care of a moved segment (fix up relocations, for example).
 int (idaapi *process_archive)(qstring *temp_file
 Display list of archive members and let the user select one.

Public Attributes

uint32 version
 api version, should be #IDP_INTERFACE_VERSION
uint32 flags
 Loader flags
qstringprocessor
qstring linput_t * li
qstring linput_t const char * filename
ushort neflags
ushort const char * fileformatname
const char * fileformatname
ea_t to
ea_t asize_t size
ea_t asize_t const char * fileformatname
linput_t * li
linput_t qstringmodule_name
linput_t qstring ushortneflags
linput_t qstring ushort const char * fileformatname
linput_t qstring ushort const char const char * defmember
linput_t qstring ushort const char const char qstringerrbuf

Detailed Description

Loader description block - must be exported from the loader module.

Member Function Documentation

◆ int() [1/4]

loader_t::int ( idaapi * accept_file)

Check input file format.

This function will be called one or more times depending on the result value.

Parameters
[out]fileformatname of file format
[out]processordesired processor (optional)
liinput file
filenamename of the input file, if it is an archive member name then the actual file doesn't exist
Returns
1 if file format is recognized, and fills 'fileformatname', otherwise returns 0. This function may return a unique file format number instead of 1. To get this unique number, please contact the author. If the return value is ORed with #ACCEPT_ARCHIVE, then it is an archive loader. Its process_archive() will be called instead of load_file(). If the return value is ORed with #ACCEPT_CONTINUE, then this function will be called another time. If the return value is ORed with #ACCEPT_FIRST, then this format should be placed first in the "load file" dialog box. In the sorting order of file formats the archive formats have priority.

◆ void()

loader_t::void ( idaapi * load_file)

Load file into the database.

Parameters
liinput file
neflagsLoad file flags
fileformatnamename of type of the file (it was returned by #accept_file)

If this function fails, loader_failure() should be called

◆ int() [2/4]

loader_t::int ( idaapi * save_file)

Create output file from the database.

This function may be absent. If fp == nullptr, then this function returns:

  • 0: can't create file of this type
  • 1: ok, can create file of this type

If fp != nullptr, then this function should create the output file

◆ int() [3/4]

loader_t::int ( idaapi * move_segm)

Take care of a moved segment (fix up relocations, for example).

This function may be absent. A special calling method

move_segm(BADADDR, delta, 0, formatname);
idaman move_segm_code_t ida_export move_segm(segment_t *s, ea_t to, int flags=0)
This function moves all information to the new address.

means that the whole program has been moved in the memory (rebased) by delta bytes

Parameters
fromprevious linear address of the segment
tocurrent linear address of the segment
sizesize of the moved segment
fileformatnamethe file format
Return values
1ok
0failure

◆ int() [4/4]

loader_t::int ( idaapi * process_archive)

Display list of archive members and let the user select one.

Extract the selected archive member into a temporary file.

Parameters
[out]temp_filename of the file with the extracted archive member.
liinput file
[in,out]module_namein: name of archive out: name of the extracted archive member
[in,out]neflagsLoad file flags
fileformatnamename of type of the file (it was returned by #accept_file)
defmemberextract the specified member, for example "subdir/member.exe", may be nullptr
errbuferror message if 0 is returned, may be nullptr
Returns
-1-cancelled by the user, 1-ok, 0-error, see errbuf for details

Member Data Documentation

◆ version

uint32 loader_t::version

api version, should be #IDP_INTERFACE_VERSION

◆ flags

uint32 loader_t::flags

◆ processor

qstring* loader_t::processor

◆ li [1/2]

qstring linput_t* loader_t::li

◆ filename

qstring linput_t const char* loader_t::filename

◆ neflags [1/2]

ushort loader_t::neflags

◆ fileformatname [1/4]

ushort const char* loader_t::fileformatname

◆ fileformatname [2/4]

const char* loader_t::fileformatname

◆ to

ea_t loader_t::to

◆ size

ea_t asize_t loader_t::size

◆ fileformatname [3/4]

ea_t asize_t const char* loader_t::fileformatname

◆ li [2/2]

linput_t* loader_t::li

◆ module_name

linput_t qstring* loader_t::module_name

◆ neflags [2/2]

linput_t qstring ushort* loader_t::neflags

◆ fileformatname [4/4]

linput_t qstring ushort const char* loader_t::fileformatname

◆ defmember

linput_t qstring ushort const char const char* loader_t::defmember

◆ errbuf

linput_t qstring ushort const char const char qstring* loader_t::errbuf

The documentation for this struct was generated from the following file: