Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //http://waleedassar.blogspot.com
- //http://www.twitter.com/waleedassar
- //N.B the following is total crap!!!!!!!!
- //p is a pointer to PE header and fileSize is PE file size.
- int i=0;
- bool found=false;
- while(i+3 < fileSize)
- {
- if(p[i]=='P' && p[i+1]=='E' && p[i+2]==0 && p[i+3]==0)
- { found=true; break; }
- i++;
- }
- if(found)
- {
- //The real NT_FILE_HEADER is assumed to have been found here.
- //continue processing PE file
- }
- else
- {
- //file is rejected
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement