Function at 0x401780
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
sub esp, 0x440
mov edx, dword [esp + 0x444]
push ebx
push ebp
movsx ebp, byte [edx + 0x4342a0]
push esi
mov esi, ecx
xor ebx, ebx
push edi
cmp dword [esi + 4], ebx
jne 0x401809
push ebx
call dword [sym.imp.USER32.dll_GetDC]
mov edi, eax
push 0xc8
push 0xc8
push edi
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
push edi
push ebx
mov dword [esi + 4], eax
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [esi + 4]
mov ecx, dword [esi]
push eax
push ecx
call dword [sym.imp.GDI32.dll_SelectObject]
push 0x27100
push 0x40
mov dword [esi + 8], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esi + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
cmp eax, ebx
mov dword [esi + 0x10], eax
je 0x401802
mov ecx, 0x1387f
mov word [eax], cx
add eax, 2
dec ecx
jne 0x4017f9
mov edx, dword [esp + 0x454]
mov ecx, 0x10a
xor eax, eax
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x458]
mov dword [esp + 0x28], 0x28
neg eax
sbb eax, eax
mov dword [esp + 0x2c], 0xc8
and eax, 0x190
mov word [esp + 0x36], bp
add eax, 0xffffff38
cmp edx, 3
mov dword [esp + 0x30], eax
mov eax, 1
mov word [esp + 0x34], ax
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], ebx
jg 0x40189f
mov ecx, ebp
shl eax, cl
cmp eax, ebx
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
lea edx, [eax - 1]
je 0x4018cc
lea ecx, [esp + 0x52]
mov eax, edx
mov byte [ecx + 1], 0
and al, 1
neg al
sbb al, al
add ecx, 4
and al, 1
dec al
mov byte [ecx - 6], al
mov byte [ecx - 5], al
mov byte [ecx - 4], al
mov eax, edx
dec edx
test eax, eax
jne 0x40187a
jmp 0x4018cc
cmp edx, 5
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
jne 0x4018cc
mov dword [esp + 0x38], 3
mov dword [esp + 0x50], 0xf800
mov dword [esp + 0x54], 0x7e0
mov dword [esp + 0x58], 0x1f
mov edi, dword [sym.imp.GDI32.dll_GdiFlush]
call edi
mov ebp, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
lea ecx, [esp + 0x20]
push ecx
call ebp
test eax, eax
je 0x401950
mov eax, dword [esi + 0x10]
lea edx, [esp + 0x28]
push ebx
push edx
mov ecx, dword [esi]
push eax
push 0xc8
push ebx
push ebx
push ebx
push 0xc8
push 0xc8
push ebx
push ebx
push ecx
call dword [sym.imp.GDI32.dll_SetDIBitsToDevice]
test eax, eax
je 0x401943
call edi
lea edx, [esp + 0x18]
push edx
call ebp
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
sub edi, eax
jns 0x401927
neg edi
cmp edi, dword [esi + 0x1c]
jge 0x401943
mov ecx, dword [esp + 0x454]
mov edx, dword [esp + 0x458]
mov dword [esi + 0x14], ecx
mov dword [esi + 0x18], edx
mov dword [esi + 0x1c], edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x440
ret 8
lea eax, [esp + 0x10]
push 8
push eax
call dword [sym.imp.WINMM.dll_timeGetDevCaps]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.WINMM.dll_timeBeginPeriod]
mov edi, dword [sym.imp.WINMM.dll_timeGetTime]
call edi
mov ebp, eax
mov eax, dword [esi + 0x10]
push 0xcc0020
lea edx, [esp + 0x2c]
push ebx
push edx
mov ecx, dword [esi]
push eax
push 0xc8
push 0xc8
push ebx
push ebx
push 0xc8
push 0xc8
push ebx
push ebx
push ecx
call dword [sym.imp.GDI32.dll_StretchDIBits]
mov ebx, eax
call dword [sym.imp.GDI32.dll_GdiFlush]
call edi
mov edx, dword [esp + 0x10]
mov edi, eax
sub edi, ebp
mov ebp, dword [sym.imp.WINMM.dll_timeEndPeriod]
push edx
call ebp
test ebx, ebx
jg 0x401927
mov eax, dword [esp + 0x10]
push eax
call ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x440
ret 8