Posted May 18, 201411 yr Hello everyone,For x64_dbg I had to create a pattern finder and mudlord asked me to extend it with a pattern search & replace ability.Example of usage:#include "patternfind.h"int main(int argc, char* argv[]){ unsigned char data[0x100]; memcpy(data, main, sizeof(data)); //find pattern offset size_t found = patternfind(data, sizeof(data), "68 ?? ?1 0? 00"); printf("found: main+%p\n", found); if(found==-1) //not found return 0; //print current data for(int i=0; i<5; i++) printf("%.2X ", data[found+i]); puts(""); //search & replace if(!patternsnr(data, sizeof(data), "68 ?? ?1 0? 00", "?? ?1 1? 21 23")) return 0; //search & replace failed //print replaced data for(int i=0; i<5; i++) printf("%.2X ", data[found+i]); puts(""); return 0;}Output:found: main+0000002668 00 01 00 0068 01 11 21 23Feel free to use it wherever you like, credit (link to http://x64dbg.com) is appreciated, but not required. Attached the full source (only ~150 lines)Greetings,Mr. eXoDiaPatternFindUpdate.rar
June 18, 201411 yr Mr. eXoDiaHow to compile this source code, sory newbie. Edited June 18, 201411 yr by newbie_newbe
June 19, 201411 yr Author @newbie_newbe: just add the .cpp and .h file to your coding project and include the .h file. This is not useful if you want some GUI or anything, just for coding projects that require a pattern searcher. Greetings
August 16, 201411 yr Author Latest version will always be here: https://bitbucket.org/mrexodia/patternfind
October 15, 201410 yr thanks, it's nicer than the code i use. i wrote a little tool that uses BeaEngine to hook anywhere in code, and i use a few different pattern matching algorithms to find my hook targets. Edited October 15, 201410 yr by electroglyph
Create an account or sign in to comment