#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");
}