Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void HashSignature ( const char* sig, const char* smask, DWORD_PTR& hash, DWORD_PTR& mask )
- {
- unsigned int uLength = strlen ( smask );
- for ( auto i = 0; i < uLength; i++ )
- {
- if ( smask[i] == 'x' )
- {
- mask |= (1 << i);
- }
- else if ( smask[i] == '?' )
- {
- mask |= 0;
- }
- }
- char hashed[32];
- for ( int i = 0; i < 32; i++ )
- {
- if ( i < uLength )
- {
- if ( sig[i] )
- {
- hashed[i] = sig[i];
- }
- else
- {
- hashed[i] = 0;
- }
- }
- else
- {
- hashed[i] = 0;
- }
- }
- hash = CRC32 ( (byte*)hashed, 32 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement