IDA SDK

- Main Page
- Header Files
- Classes
- Modules

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Attributes | List of all members
loader_t Struct Reference

## Detailed Description

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

## Public Attributes
uint32 | version
| api version, should be IDP_INTERFACE_VERSION
uint32 | flags
| Loader flags
int(idaapi * | accept_file )(linput_t *li, char fileformatname[MAX_FILE_FORMAT_NAME], int n)
| Check input file format. More...
void(idaapi * | load_file )(linput_t *li, ushort neflags, const char *fileformatname)
| Load file into the database. More...
int(idaapi * | save_file )(FILE *fp, const char *fileformatname)
| Create output file from the database. More...
int(idaapi * | move_segm )(ea_t from, ea_t to, asize_t size, const char *fileformatname)
| Take care of a moved segment (fix up relocations, for example). More...
void * | _UNUSED1_was_init_loader_options

## Member Data Documentation

int(idaapi * loader_t::accept_file) (linput_t *li, char fileformatname[MAX_FILE_FORMAT_NAME], int n)

Check input file format.

This function will be called many times till it returns !=0.

Parameters

  | li | input file
  [out] | fileformat | name of file format
  | n | initially == 0 for each loader, incremented after each call

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_FIRST, then this format should be placed first in the "load file" dialog box

void(idaapi * loader_t::load_file) (linput_t *li, ushort neflags, const char *fileformatname)

Load file into the database.

Parameters

  fp | pointer to file positioned at the start of the file
  fileformatname | name of type of the file (it was returned by accept_file)
  neflags | Load file flags

If this function fails, loader_failure() should be called

int(idaapi * loader_t::save_file) (FILE *fp, const char *fileformatname)

Create output file from the database.

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

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

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

int(idaapi * loader_t::move_segm) (ea_t from, ea_t to, asize_t size, const char *fileformatname)

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);

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

Parameters

  from | previous linear address of the segment
  to | current linear address of the segment
  size | size of the moved segment
  fileformatname | the file format

Return values

  1 | ok
  0 | failure

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

- loader.hpp