BOOL LastDetection(HANDLE hFile)
{
DWORD lpNumberOfBytesRead;
PVOID tmp;
char ReadBuffer1[0x20];
char ReadBuffer2[0x100];
char CheckBuffer1[0x20] = { '\x60','\x78','\x03','\x79','\x01','\xEB','\xE8','\x74','\x11','\x00','\x00','\x8B','\x74','\x24','\x20','\xE8','\x11','\x00','\x00','\x00','\x61','\x78','\x03','\x79','\x01','\xEB','\x68'};
char CheckBuffer2[0x100] = {'\xC8', '\x00', '\x00', '\x00', '\x60', '\x81', '\xEC', '\x00', '\x10', '\x00', '\x00', '\x8B', '\xFC', '\x68', '\x00', '\x10', '\x00', '\x00', '\x57', '\xFF', '\x75', '\x08', '\xFF', '\x56', '\x34', '\x0F', '\xB7', '\x47', '\x3C', '\x03', '\xF8', '\x3B', '\xFD', '\x0F', '\x87', '\xE4', '\x00', '\x00', '\x00', '\x66', '\x81', '\x3F', '\x50', '\x45', '\x0F', '\x85', '\xD9', '\x00', '\x00', '\x00', '\x81', '\xBF', '\x9B', '\x01', '\x00', '\x00', '\x79', '\x6C', '\x50', '\x7A', '\x0F', '\x84', '\xC9', '\x00', '\x00', '\x00', '\x8D', '\x9F', '\xF8', '\x00', '\x00', '\x00', '\x0F', '\xB7', '\x4F', '\x06', '\x49', '\x83', '\xC3', '\x28', '\xE2', '\xFB', '\x3B', '\xDD', '\x0F', '\x87', '\xB1', '\x00', '\x00', '\x00', '\x8B', '\x47', '\x28', '\x2B', '\x43', '\x0C', '\x72', '\x23', '\x03', '\x43', '\x14', '\x6A', '\x00', '\x50', '\xFF', '\x75', '\x08', '\xFF', '\x56', '\x3C', '\x50', '\x8B', '\xC4', '\x6A', '\x04', '\x50', '\xFF', '\x75', '\x08', '\xFF', '\x56', '\x34', '\x58', '\x66', '\x3D', '\x60', '\xE8', '\x0F', '\x84', '\x86', '\x00', '\x00', '\x00', '\x81', '\x4B', '\x24', '\x00', '\x00', '\x00', '\xE0', '\x6A', '\x02', '\x6A', '\x00', '\xFF', '\x75', '\x08', '\xFF', '\x56', '\x3C', '\x83', '\xF8', '\xFF', '\x74', '\x70', '\x50', '\x05', '\x8F', '\x11', '\x00', '\x00', '\x2B', '\x43', '\x14', '\x89', '\x43', '\x10', '\x8B', '\x53', '\x08', '\x3B', '\xC2', '\x72', '\x16', '\x89', '\x43', '\x08', '\x8B', '\x4F', '\x38', '\x49', '\x03', '\xC1', '\x03', '\xD1', '\xF7', '\xD1', '\x23', '\xC1', '\x23', '\xD1', '\x2B', '\xC2', '\x01', '\x47', '\x50', '\x59', '\x2B', '\x4B', '\x14', '\x03', '\x4B', '\x0C', '\x87', '\x4F', '\x28', '\x03', '\x4F', '\x34', '\xE8', '\x00', '\x00', '\x00', '\x00', '\x5F', '\x81', '\xEF', '\x13', '\x0E', '\x00', '\x00', '\x89', '\x0F', '\x83', '\xEF', '\x1B', '\x68', '\x8F', '\x11', '\x00', '\x00', '\x57', '\xFF', '\x75', '\x08', '\xFF', '\x56', '\x38', '\x83', '\xF8', '\xFF', '\x74', '\x18', '\x6A', '\x00', '\x6A', '\x00', '\xFF', '\x75', '\x08', '\xFF', '\x56', '\x3C', '\x8B', '\xC4', '\x68'};
SetFilePointer(hFile, EPOffset, 0, 0);
ReadFile(hFile, ReadBuffer1, 0x20, &lpNumberOfBytesRead, 0);
OrigEP = (BYTE)ReadBuffer1[0x1b];
OrigEP += (BYTE)ReadBuffer1[0x1c]*0x100;
OrigEP += (BYTE)ReadBuffer1[0x1d]*0x10000;
OrigEP += (BYTE)ReadBuffer1[0x1e]*0x1000000;
OrigEP -= pOption->ImageBase;
SetFilePointer(hFile, EPOffset + 0xd58, 0, 0);
ReadFile(hFile, ReadBuffer2, 0x100, &lpNumberOfBytesRead, 0);
for (int i = 0; i < 0x1b; i++)
{
if (ReadBuffer1[i] != CheckBuffer1[i])
{
/* Check a aml data size at mal's data[0xdf6]&[e3c] */
return FALSE;
}
}
for(int i=0; i< 0x100; i++)
{
if(ReadBuffer2[i] != CheckBuffer2[i])
{
return FALSE;
}
}
return TRUE;
}