Flag: Tornado! Hurricane!

OpenRCE IDA SDK >> find_binary

find_binary
Category: Searching

idaman ea_t ida_export
find_binary(ea_t startea, ea_t endea, const char *ubinstr, int radix, int sflag)
Searches between startea and endea for the string in *ubinstr. radix is the numeric base (if you're searching for numbers), which can be 8 (octal), 10 (decimal) or 16 (hex). sflag can be any of the previously mentioned flags. Note that this function doesn't search the disassembled text that you see in IDA, but the binary itself.

The content of *ubinstr will differ depending on the type of search you are conducting. For strings, the string itself must be wrapped in quotes ("), for single characters, they must be wrapped in single quotes ('). A question-mark (?) can be used to indicate a single wildcard byte.

Examples:
#include <kernwin.hpp> // for askstr() and jumpto()
#include <search.hpp>

// Ask the user for a search string
char *name = askstr(HIST_SRCH, "", "Please enter a string");
char searchstring[MAXSTR];

// Encapsulate the search string in quotes
qsnprintf(searchstring, sizeof(searchstring)-1, ""%s"", name);

ea_t res = find_binary(inf.minEA,     // Top of the file
                       inf.maxEA,     // Bottom of the file
                       searchstring,
                       0,             // radix not applicable
                       SEARCH_DOWN);
if (res != NULL)
{
    msg("Match found at %a\n", res);
    
    // Move the cursor to the address
    jumpto(res);
}
else
{
    msg("No match found.\n");
}


Related: find_binary, find_text

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

There are 28,658 total registered users.


Recently Created Topics
Reverse Engineer sof...
May/24
plugin_bochs_user
May/23
Cracking Mbot With a...
May/22
I have started a new...
May/22
windbg - olly/immunity
May/14
Reverse a WinRAR pac...
May/13
Add comments to resu...
May/10
can we code script ...
May/09
Type Casting Structu...
May/07
How to Reverse Engin...
May/03


Recent Forum Posts
windbg - olly/immunity
blowcheck
Help me guys
Olivier
Reverse a WinRAR pac...
NirIzr
windbg - olly/immunity
anonymouse
Reverse a WinRAR pac...
DriEm
Add comments to resu...
phn1x
IDA Resource Viewer ...
DriEm
Add comments to resu...
qiuhan
IDA Resource Viewer ...
waleeda...
IDA Resource Viewer ...
DriEm


Recent Blog Entries
bopwt568
May/27


waleedassar
Apr/20
OllyDbg NumberOfSections Crash

icegood
Apr/13
Advanced labels plugin for ...

waleedassar
Mar/31
GetModuleFileNameEx And Inf...

waleedassar
Mar/31
OllyDbg v1.10 And Wow64

More ...


Recent Blog Comments
michaelkorshandbags on:
May/24
OllyDbg v1.10 And Hardware ...

michaelkorshandbags on:
May/24
Ariadne framework and deobf...

michaelkorshandbags on:
May/24
Portable Executable Format ...

michaelkorshandbags on:
May/24
BIOS Disassembly Ninjutsu (...

michaelkorshandbags on:
May/24
Very comfortable to enjoy g...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit