wav
08-21-2010, 06:06 AM
memcpy ( pMem, ( void* )g_dwVACEncryptedCodeStart[iIterator], g_dwVACScanCodeLength[iIterator] );
IceKey Ice(1);
Ice.set ( szFixedCipherText );
iBytesLeft = g_dwVACScanCodeLength[iIterator];
iBytesLeft = ( ( ( iBytesLeft - 1 ) >> 3 ) + 1 );
while ( iBytesLeft )
{
Ice.decrypt ( pMem, pOut );
pMem += 0x8;
pOut += 0x8;
iBytesLeft--;
}
Ice.~IceKey();
pOut = pOutStart; // realign pOut for CRC
pOut += 0x30;
CRC32_Init( &crc );
CRC32_ProcessBuffer( &crc, pOut, g_dwOffsetToEncryptedCode[iIterator] );
CRC32_Final( &crc );
if ( crc == g_dwVACScanFunctionCrcs[iIterator] )
{
printf ( "Match found for 0x%X with length of 0x%X.\n", g_dwVACEncryptedCodeStart[iIterator], g_dwVACScanCodeLength[iIterator] );
printf( "0x%llX\n", liIterator.QuadPart );
}
else
{
pMem = pMemStart;
memset ( pOut, 0, 0x2000 );
}
Same principle is applied to bruteforcing. That is all.
Credits: Patrick
ps Anti copy paste is added, smart people will notice it right away
IceKey Ice(1);
Ice.set ( szFixedCipherText );
iBytesLeft = g_dwVACScanCodeLength[iIterator];
iBytesLeft = ( ( ( iBytesLeft - 1 ) >> 3 ) + 1 );
while ( iBytesLeft )
{
Ice.decrypt ( pMem, pOut );
pMem += 0x8;
pOut += 0x8;
iBytesLeft--;
}
Ice.~IceKey();
pOut = pOutStart; // realign pOut for CRC
pOut += 0x30;
CRC32_Init( &crc );
CRC32_ProcessBuffer( &crc, pOut, g_dwOffsetToEncryptedCode[iIterator] );
CRC32_Final( &crc );
if ( crc == g_dwVACScanFunctionCrcs[iIterator] )
{
printf ( "Match found for 0x%X with length of 0x%X.\n", g_dwVACEncryptedCodeStart[iIterator], g_dwVACScanCodeLength[iIterator] );
printf( "0x%llX\n", liIterator.QuadPart );
}
else
{
pMem = pMemStart;
memset ( pOut, 0, 0x2000 );
}
Same principle is applied to bruteforcing. That is all.
Credits: Patrick
ps Anti copy paste is added, smart people will notice it right away