INNER CODE UNIT · C
ImageSize
Idov31/Cronos · src/Cronos.c:49
ImageSize = ((PIMAGE_NT_HEADERS)((DWORD_PTR)ImageBase + ((PIMAGE_DOS_HEADER)ImageBase)->e_lfanew))->OptionalHeader.SizeOfImage;
// Initializing the image and key for SystemFunction032.
Key.Buffer = keyBuffer;
Key.Length = Key.MaximumLength = 16;
Image.Buffer = ImageBase;
Image.Length = Image.MaximumLength = ImageSize;
// Creating the waitable timers.
hProtectionRWTimer = CreateWaitableTimerW(NULL, TRUE, L"ProtectionRWTimer");
hProtectionRWXTimer = CreateWaitableTimerW(NULL, TRUE, L"ProtectionRWXTimer");
hEncryptionTimer = CreateWaitableTimerW(NULL, TRUE, L"EncryptionTimer");
hDecryptionTimer = CreateWaitableTimerW(NULL, TRUE, L"DecryptionTimer");
hDummyThreadTimer = CreateWaitableTimerW(NULL, TRUE, L"DummyTimer");
if (hProtectionRWTimer == 0 || hProtectionRWXTimer == 0 ||
hEncryptionTimer == 0 || hDecryptionTimer == 0 || hDummyThreadTimer == 0) {