Flag: Tornado! Hurricane!

OpenRCE IDA SDK >> load_binary_file

load_binary_file
Category: IDB

idaman bool ida_export
load_binary_file(const char *filename, linput_t *li,
ushort _neflags, long fileoff, ea_t basepara, ea_t binoff, ulong nbytes);
Load a binary file *li, named *filename starting at offset, fileoff. _nflags is any of the NEF_ flags defined in loader.hpp. nbytes specifies the number of bytes to load from the file, or 0 for the whole file. basepara is the paragraph where this new binary will be loaded, and binoff is the offset within that segment. You can safely set basepara to the adress you want the file loaded at, and set binoff to 0. Returns false if the load failed.

This is not the function you would use for loading a DLL or executable file (a PE file for instance) into the IDB. For that, you would use use load_loader_module() above.

Examples:
#include <kernwin.hpp> // For askfile_cv()
#include <diskio.hpp>  // For open_linput()
#include <loader.hpp>

// Ask the user for a filename
char *file = askfile_cv(0, "", "DLL file..", NULL);

// Create a linput_t instance for that file
linput_t *li = open_linput(file, false);

// Load the file at the end of the currently loaded file (inf.maxEA).
bool status = load_binary_file(file, li, NEF_SEGS, 0, inf.maxEA, 0, 0);

if (status)
    msg("Successfully loaded %s at %a\n", file, inf.maxEA);
else
    msg("Failed to load file.\n");


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


Recently Created Topics
Your Skin Very Soft...
Apr/17
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...

Michealhance
Apr/17
Remove Wrinkles For Longer

edithgarza
Apr/16
Improve Your Look With More...

gloriabuirk
Apr/16
TropiCleanse Review - Total...

gareebnavas
Jan/21
Android Malware Analysis

More ...


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

cin100dy on:
Dec/16
Devil May Cry Cosplay Costu...

NeOXQuiCk on:
Nov/26
DONGLE

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

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

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit