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


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
hi!
Jul/01
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

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

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit