Function at 0x5000a0
Capabilities:
Capture screenshot

Disassembly:
sub esp, 0x44
push ebx
push edi
xor edi, edi
xor ebx, ebx
cmp dword [0x574400], 1
mov dword [esp + 0x18], edi
jne 0x500511
push ebp
mov ebp, dword [sym.imp.GDI32.dll_SelectObject]
push esi
push 0x5743e8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x57440c]
mov esi, eax
cmp eax, ebx
je 0x5004dc
lea esp, [esp]
cmp dword [esi + 0x10], 5
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
jge 0x5004a4
mov eax, dword [esi]
push eax
call dword [sym.imp.USER32.dll_GetDC]
cmp dword [esi + 0x14], 0
mov ebx, eax
mov dword [esp + 0x18], ebx
jge 0x500114
call fcn.004fe770
push ebx
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov ebx, eax
test ebx, ebx
je 0x5004b8
mov ecx, dword [esi + 0x20]
push ecx
push ebx
call ebp
mov dword [esp + 0x1c], eax
mov eax, dword [esi + 0x14]
test eax, eax
jl 0x50025e
mov edx, dword [esi + 0xc]
mov edx, dword [edx + 8]
lea ecx, [eax*8]
sub ecx, eax
mov eax, dword [edx + ecx*4 + 0x18]
lea edi, [edx + ecx*4]
cmp eax, 2
jne 0x5001be
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x50017d
mov ecx, dword [esp + 0x1c]
push ecx
push ebx
call ebp
push ebx
call dword [sym.imp.GDI32.dll_DeleteDC]
jmp 0x5004b8
mov edx, dword [esi + 0x18]
push edx
push eax
call ebp
mov ecx, dword [edi + 4]
mov edx, dword [esp + 0x10]
push 0xcc0020
mov dword [esp + 0x18], eax
mov eax, dword [edi + 8]
push eax
push ecx
push edx
mov edx, dword [edi + 0x10]
push edx
mov edx, dword [edi + 0xc]
push edx
push eax
push ecx
push ebx
call dword [sym.imp.GDI32.dll_BitBlt]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
push ecx
call ebp
mov edx, dword [esp + 0x10]
push edx
jmp 0x500239
cmp eax, 3
jne 0x50025e
cmp dword [esi + 0x1c], 0
je 0x50025e
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x5001f8
mov edx, dword [esp + 0x1c]
push edx
push ebx
call ebp
push ebx
call dword [sym.imp.GDI32.dll_DeleteDC]
jmp 0x5004b8
mov ecx, dword [esi + 0x1c]
push ecx
push eax
call ebp
mov edx, dword [esp + 0x10]
mov ecx, dword [edi + 0xc]
push 0xcc0020
push 0
push 0
push edx
mov edx, dword [edi + 8]
mov dword [esp + 0x24], eax
mov eax, dword [edi + 0x10]
push eax
mov eax, dword [edi + 4]
push ecx
push edx
push eax
push ebx
call dword [sym.imp.GDI32.dll_BitBlt]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
push ecx
push edx
call ebp
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.GDI32.dll_DeleteDC]
mov eax, dword [edi + 8]
mov edx, dword [edi + 0x10]
mov ecx, dword [edi + 4]
add edx, eax
push edx
mov edx, dword [edi + 0xc]
add edx, ecx
push edx
push eax
push ecx
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.USER32.dll_SetRect]
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 0xc]
cmp eax, dword [ecx + 0xc]
jl 0x500273
mov dword [esi + 0x14], 0
mov eax, dword [esi + 0x14]
mov ecx, dword [ecx + 8]
lea edx, [eax*8]
sub edx, eax
lea edi, [ecx + edx*4]
test eax, eax
jne 0x500314
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x5002b4
mov eax, dword [esp + 0x1c]
push eax
push ebx
call ebp
push ebx
call dword [sym.imp.GDI32.dll_DeleteDC]
jmp 0x5004b8
mov ecx, dword [esi + 0x18]
push ecx
push eax
call ebp
mov edx, dword [esp + 0x10]
push 0xcc0020
push 0
push 0
push edx
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0xc]
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push ecx
push edx
push 0
push 0
push ebx
call dword [sym.imp.GDI32.dll_BitBlt]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
push ecx
call ebp
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.GDI32.dll_DeleteDC]
mov eax, dword [esi + 0xc]
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push ecx
push edx
push 0
push 0
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.USER32.dll_SetRect]
cmp dword [edi + 0x18], 3
jne 0x5003d2
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x500345
mov edx, dword [esp + 0x1c]
push edx
push ebx
call ebp
push ebx
call dword [sym.imp.GDI32.dll_DeleteDC]
jmp 0x5004b8
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x500353
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 0xc]
mov edx, dword [esp + 0x18]
push eax
push ecx
push edx
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov dword [esi + 0x1c], eax
test eax, eax
jne 0x50038a
mov eax, dword [esp + 0x1c]
push eax
push ebx
call ebp
mov edi, dword [sym.imp.GDI32.dll_DeleteDC]
push ebx
call edi
mov ecx, dword [esp + 0x10]
push ecx
call edi
jmp 0x5004b8
mov edx, dword [esp + 0x10]
push eax
push edx
call ebp
mov ecx, dword [edi + 4]
mov edx, dword [edi + 0x10]
push 0xcc0020
mov dword [esp + 0x18], eax
mov eax, dword [edi + 8]
push eax
mov eax, dword [edi + 0xc]
push ecx
mov ecx, dword [esp + 0x1c]
push ebx
push edx
push eax
push 0
push 0
push ecx
call dword [sym.imp.GDI32.dll_BitBlt]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push edx
push eax
call ebp
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.GDI32.dll_DeleteDC]
mov edx, dword [esi + 0x14]
mov ecx, dword [edi + 0x10]
mov eax, dword [esi + 0xc]
add ecx, dword [edi + 8]
push edx
mov edx, dword [edi + 4]
push eax
push ecx
push edx
push ebx
call fcn.004ff430
mov eax, dword [esp + 0x38]
mov ecx, dword [edi + 4]
mov edx, dword [edi + 0x10]
add esp, 0x14
cmp eax, dword [esp + 0x2c]
mov eax, dword [edi + 8]
jne 0x500419
add edx, eax
push edx
mov edx, dword [edi + 0xc]
add edx, ecx
push edx
push eax
push ecx
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.USER32.dll_SetRect]
jmp 0x500444
add edx, eax
push edx
mov edx, dword [edi + 0xc]
add edx, ecx
push edx
push eax
push ecx
lea eax, [esp + 0x54]
push eax
call dword [sym.imp.USER32.dll_SetRect]
lea ecx, [esp + 0x44]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.USER32.dll_UnionRect]
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x40]
push 0xcc0020
push eax
push ecx
sub edx, eax
push ebx
push edx
mov edx, dword [esp + 0x50]
sub edx, ecx
mov ecx, dword [esi + 0xc]
push edx
mov edx, dword [esi + 8]
sub edx, dword [ecx + 0x14]
mov ecx, dword [esp + 0x30]
add edx, eax
mov eax, dword [esi + 4]
add eax, dword [esp + 0x4c]
push edx
push eax
push ecx
call dword [sym.imp.GDI32.dll_BitBlt]
mov edx, dword [esp + 0x1c]
push edx
push ebx
call ebp
push ebx
call dword [sym.imp.GDI32.dll_DeleteDC]
mov eax, dword [esp + 0x18]
mov ecx, dword [esi]
push eax
push ecx
call dword [sym.imp.USER32.dll_ReleaseDC]
mov edx, dword [edi + 0x14]
mov dword [esi + 0x10], edx
mov eax, dword [esp + 0x20]
test eax, eax
je 0x5004b1
cmp dword [esi + 0x10], eax
jge 0x5004b8
mov eax, dword [esi + 0x10]
mov dword [esp + 0x20], eax
mov esi, dword [esi + 0x24]
xor ebx, ebx
cmp esi, ebx
jne 0x5000e0
mov eax, dword [0x57440c]
mov edi, dword [esp + 0x20]
cmp eax, ebx
je 0x5004dc
sub dword [eax + 0x10], edi
mov eax, dword [eax + 0x24]
cmp eax, ebx
jne 0x5004d2
push 0x5743e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x57440c], ebx
je 0x50050f
mov edx, dword [0x574408]
lea ecx, [edi + edi*4]
add ecx, ecx
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [0x574400], 1
je 0x5000c2
pop esi
pop ebp
pop edi
pop ebx
add esp, 0x44
ret