View Single Post
  #1  
Old 05-18-2014, 22:07
mr.exodia mr.exodia is offline
Retired Moderator
 
Join Date: Nov 2011
Posts: 783
Rept. Given: 490
Rept. Rcvd 1,123 Times in 305 Posts
Thanks Given: 89
Thanks Rcvd at 716 Times in 333 Posts
mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299
[C++] PatternFind

Hello everyone,

For x64_dbg I created a pattern finder that supports nibble wildcards (FF D? for example). Here is a standalone version of this pattern finder, feel free to use it wherever you like, credit (link to http://x64dbg.com) is appreciated, but not required.

Example of usage:
Code:
#include "patternfind.h"
#include 
size_t patternfind(
unsigned char* data //pointer to the data to search in
size_t size //data size
const char* pattern //text pattern, will be filtered to only contain hex characters and wildcards (?)
);

int main(int argc, char* argv[])
{
    size_t found = patternfind((unsigned char*)main, 0x100, "68 ?? ?1 0? 00");
    printf("found: main+%p\n", found);
    return 0;
}
PatternFind source code is attached.

Greetings,

Mr. eXoDia

Last edited by mr.exodia; 10-28-2015 at 09:13.
Reply With Quote
The Following 4 Users Gave Reputation+1 to mr.exodia For This Useful Post:
besoeso (05-19-2014), chessgod101 (05-19-2014), ontryit (05-19-2014), zeuscane (05-19-2014)