Function at 0x401f60
Capabilities:
Capture screenshot

Disassembly:
sub esp, 0x18
mov eax, dword [esp + 0x1c]
push ebx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GlobalLock]
push esi
mov ebx, dword [eax + 4]
push edi
mov edi, ecx
mov dword [esp + 0x18], edi
mov ecx, dword [edi + 0x18]
push ecx
call ebp
mov esi, eax
cmp dword [esi + 0x20], 0x10
jbe 0x401fe1
mov eax, dword [edi + 0x1c]
test eax, eax
jne 0x401f9a
push esi
mov ecx, edi
call fcn.00401980
mov dword [edi + 0x1c], eax
mov eax, dword [edi + 0x1c]
test eax, eax
je 0x401fe1
push 0
push eax
push ebx
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebx
mov dword [esp + 0x24], eax
call dword [sym.imp.GDI32.dll_RealizePalette]
mov eax, dword [edi + 0x20]
test eax, eax
jne 0x401fc8
push esi
mov ecx, edi
call fcn.00401910
mov dword [edi + 0x20], eax
mov edi, dword [edi + 0x20]
test edi, edi
je 0x401fe1
push edi
call ebp
test eax, eax
mov dword [esp + 0x1c], eax
je 0x401fe1
mov edi, 1
jmp 0x401fe7
mov dword [esp + 0x1c], esi
xor edi, edi
push ebx
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov dword [esp + 0x2c], eax
xor edx, edx
mov dx, word [esi + 8]
xor eax, eax
mov ax, word [esi + 4]
push edx
push eax
push ebx
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov ecx, dword [esp + 0x1c]
mov ebp, eax
mov eax, dword [esp + 0x18]
and edi, 0xffff
xor edx, edx
push edi
mov dx, word [eax + 0x24]
push ecx
xor ecx, ecx
add edx, esi
mov cx, word [esi + 8]
push edx
push ecx
push 0
push ebp
push ebx
call dword [sym.imp.GDI32.dll_SetDIBits]
mov edx, dword [esp + 0x2c]
push ebp
push edx
call dword [sym.imp.GDI32.dll_SelectObject]
mov ecx, dword [esp + 0x30]
mov edi, dword [esi + 4]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x38]
sub eax, ecx
cmp edi, eax
jl 0x402056
mov edi, eax
mov ebp, dword [esi + 8]
mov edx, dword [esp + 0x3c]
sub edx, dword [esp + 0x34]
cmp ebp, edx
mov dword [esp + 0x1c], edx
jl 0x40206b
mov ebp, edx
lea esi, [eax + 1]
mov dword [esp + 0x14], 0
cmp edi, esi
mov dword [esp + 0x10], 0
jle 0x40209d
mov edx, dword [esp + 0x38]
mov eax, ecx
sub eax, edx
lea eax, [eax + edi - 1]
mov edi, esi
cdq
sub eax, edx
mov edx, dword [esp + 0x1c]
sar eax, 1
mov dword [esp + 0x14], eax
mov esi, dword [esp + 0x34]
lea eax, [edx + 1]
cmp ebp, eax
mov dword [esp + 0x1c], eax
jle 0x4020c5
mov eax, dword [esp + 0x3c]
mov edx, esi
sub edx, eax
lea eax, [edx + ebp - 1]
mov ebp, dword [esp + 0x1c]
cdq
sub eax, edx
sar eax, 1
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 0x28]
cmp eax, 0xb
jne 0x4020fc
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
push 0xcc0020
push ebp
push edi
push edx
mov edx, dword [esp + 0x3c]
push eax
mov eax, dword [esp + 0x50]
push edx
mov edx, dword [esp + 0x50]
push eax
push edx
push esi
push ecx
push ebx
call dword [sym.imp.GDI32.dll_StretchBlt]
jmp 0x40217b
cmp eax, 9
jne 0x40215c
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x1c], 0
test eax, eax
jle 0x40217b
mov eax, dword [esp + 0x38]
xor esi, esi
test eax, eax
jle 0x402148
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x2c]
push 0xcc0020
push eax
mov eax, dword [esp + 0x24]
push ecx
push edx
push ebp
push edi
push eax
push esi
push ebx
call dword [sym.imp.GDI32.dll_BitBlt]
mov eax, dword [esp + 0x38]
add esi, edi
cmp esi, eax
jl 0x40211b
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x3c]
add eax, ebp
cmp eax, ecx
mov dword [esp + 0x1c], eax
jl 0x402111
jmp 0x40217b
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
push 0xcc0020
push edx
mov edx, dword [esp + 0x34]
push eax
push edx
push ebp
push edi
push esi
push ecx
push ebx
call dword [sym.imp.GDI32.dll_BitBlt]
mov eax, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [eax + 0x20]
test eax, eax
je 0x40219d
push eax
call esi
mov ecx, dword [esp + 0x20]
push 0
push ecx
push ebx
call dword [sym.imp.GDI32.dll_SelectPalette]
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 0x18]
push eax
call esi
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x2c]
push ecx
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x14