View Single Post
  #3  
Old 06-29-2014, 08:52
Computer_Angel's Avatar
Computer_Angel Computer_Angel is offline
Lo*eXeTools*rd
 
Join Date: Aug 2003
Posts: 151
Rept. Given: 68
Rept. Rcvd 37 Times in 18 Posts
Thanks Given: 10
Thanks Rcvd at 1 Time in 1 Post
Computer_Angel Reputation: 37
Hi eXoDia,
Your find pattern have a wrong situation. Example, we have pattern to find "C1 F8 02 33 C9 BA", and in file we have these byte "C1 C1 F8 02 33 C9 BA", then your code will not return the offset.

Quote:
if(patternmatchbyte(data[i], &searchpattern.at(pos))) //check if our pattern matches the current byte
{
pos++;
if(pos==searchpatternsize) //everything matched
return i-searchpatternsize+1;
}
else
pos=0; //reset current pattern position
We should reset pattern pos and decrease i
__________________
Welcome to my place http://www.reaonline.net
Reply With Quote
The Following User Gave Reputation+1 to Computer_Angel For This Useful Post:
mr.exodia (07-23-2014)