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,779 total registered users.


Recently Created Topics
Intel pin in loaded ...
Jun/27
Going to do today wi...
Jun/27
how to create delphi...
Jun/27
enabling menu in a s...
Jun/18
How to get the Image...
Jun/17
OllyDBG Process Term...
Apr/28
Reversing opcode
Apr/24
Question about debbu...
Apr/16
IDA PRO Struct Point...
Apr/15
Problem with ollydbg
Mar/22


Recent Forum Posts
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n
OOP_RE tool available?
van7hu
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


Recent Blog Entries
oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

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

gareebnavas
Jan/21
Android Malware Analysis

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

More ...


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

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

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

newlulu on:
Jun/10
Advanced debugging techniques

newlulu on:
Jun/10
2 anti-trace mechanisms spe...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit