Flag: Tornado! Hurricane!

OpenRCE IDA SDK >> gen_file

gen_file
Category: IDB

idaman int ida_export
gen_file(ofile_type_t otype, FILE *fp, ea_t ea1, ea_t ea2, int flags)
Generate an output file, *fp, based on the currently open IDB file. ea1 and ea2 are the start and end addresses respectively, however these are ignored for some output types. otype must be one of the following, taken from loader.hpp:

OFILE_MAP = 0, // MAP file
OFILE_EXE = 1, // Executable file
OFILE_IDC = 2, // IDC file
OFILE_LST = 3, // Disassembly listing
OFILE_ASM = 4, // Assembly
OFILE_DIF = 5; // Difference

flags can be any combination of the following, also taken from loader.hpp:

#define GENFLG_MAPSEG 0x0001 // map: generate map of segments
#define GENFLG_MAPNAME 0x0002 // map: include dummy names
#define GENFLG_MAPDMNG 0x0004 // map: demangle names
#define GENFLG_MAPLOC 0x0008 // map: include local names
#define GENFLG_IDCTYPE 0x0008 // idc: gen only information about types
#define GENFLG_ASMTYPE 0x0010 // asm&lst: gen information about types too
#define GENFLG_GENHTML 0x0020 // asm&lst: generate html (ui_genfile_callback will be used)
#define GENFLG_ASMINC 0x0040 // asm&lst: gen information only about types

The function will return -1 if there was an error, or the number of lines generated if it was a success. For OFILE_EXE files, it returns 0 for failure, 1 for success.

Examples:
#include <loader.hpp>

// Open the output file
FILE *fp = qfopen("C:\\output.idc", "w");

// Generate an IDC output file
gen_file(OFILE_IDC, fp, inf.minEA, inf.maxEA, 0);

// Close the output file
qfclose(fp);


Related: close_linput, gen_file, load_binary_file, load_loader_module, open_linput, save_database

Note: You must be logged in to add notes to the IDA SDK reference manual.

There are 30,636 total registered users.


Recently Created Topics
Reversing opcode
Apr/24
Question about debbu...
Apr/16
IDA PRO Struct Point...
Apr/15
problems with pseudo...
Apr/04
Problem with ollydbg
Mar/22
Should binaries be n...
Mar/22
Ida pro on infineon ...
Mar/10
need help about an D...
Feb/25
Stop a VB6 Applicati...
Feb/13
Add one new segment,...
Jan/23


Recent Forum Posts
Should binaries be n...
Kolisar
Problem with ollydbg
nullx42
!findtrampoline Immu...
skycrack
looking for a softwa...
raxen
Documenting reversed...
raxen
.orpc section what's...
mbin
Pydbg load() issue
phreak
Pydbg load() issue
netw0rm
How would you interp...
mbin
Pydbg load() issue
phreak


Recent Blog Entries
oleavr
Apr/17
frida.re 1.2.0 is out, with...

gareebnavas
Jan/21
Android Malware Analysis

oleavr
Dec/21
frida.github.io: scriptable...

chr1x
Nov/05
!apilookup - Win32 API Func...

hasherezade
Aug/24
Andromeda (W32/Kryptik.AX!t...

More ...


Recent Blog Comments
pedram on:
Dec/21
frida.github.io: scriptable...

NeOXQuiCk on:
Nov/26
DONGLE

maharlee on:
Nov/21
Cheap Nike Shoes NZ,Nike Sh...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

newlulu on:
Jun/10
Branch tracing and LBR acce...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit