Function at 0x405f50
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x414218
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x54
push ebx
push ebp
push esi
mov esi, ecx
lea ecx, [esp + 0x14]
call fcn.00403150
mov al, byte [esp + 0xf]
xor ebp, ebp
push 0x18
mov dword [esp + 0x6c], ebp
mov byte [esp + 0x2c], al
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov dword [eax], eax
mov dword [eax + 4], eax
add esp, 4
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ebp
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.00403150
lea ecx, [esi + 0x154]
mov byte [esp + 0x68], 2
call fcn.0040eef0
test eax, eax
je 0x406007
lea ecx, [esi + 0x15c]
call fcn.0040eef0
test eax, eax
je 0x406007
cmp dword [esi + 0x178], ebp
jne 0x406007
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee70
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x68], 0
push eax
mov ecx, dword [eax]
push ecx
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x34]
call fcn.00406cd0
mov edx, dword [esp + 0x2c]
push edx
jmp 0x406512
lea ebx, [esi + 0x15c]
push edi
mov ecx, ebx
call fcn.0040eef0
test eax, eax
jne 0x406076
cmp dword [esi + 0x178], ebp
je 0x4060a0
lea ecx, [esp + 0x1c]
call fcn.00403150
lea edi, [esi + 0x17c]
lea ecx, [esp + 0x1c]
push edi
mov byte [esp + 0x70], 3
call fcn.0040ee80
push ebx
lea ecx, [esp + 0x20]
call fcn.0040ef60
lea ecx, [esp + 0x1c]
call fcn.0040eef0
test eax, eax
jne 0x406068
push edi
lea ecx, [esi + 0x154]
call fcn.0040ee80
mov dword [esi + 0x178], ebp
lea ecx, [esp + 0x1c]
mov byte [esp + 0x6c], 2
call fcn.0040ee70
cmp dword [esi + 0x178], ebp
je 0x4060a0
lea eax, [esi + 0x18c]
lea ecx, [esi + 0x17c]
push eax
push ecx
mov ecx, dword [esi + 0x1c]
call fcn.00403bc0
cmp dword [esi + 0x178], ebp
jne 0x40647c
lea ecx, [esp + 0x14]
call fcn.0040eed0
lea eax, [esi + 0x158]
lea ecx, [esp + 0x14]
push eax
call fcn.0040ef00
push ebx
lea ecx, [esp + 0x18]
call fcn.0040ef90
lea eax, [esi + 0x154]
lea ecx, [esp + 0x14]
push eax
call fcn.0040ef60
lea ecx, [esp + 0x1c]
call fcn.00403150
lea ecx, [esp + 0x1c]
mov byte [esp + 0x6c], 4
call fcn.0040eed0
push ebx
lea ecx, [esp + 0x20]
call fcn.0040ef00
lea edx, [esp + 0x14]
lea ecx, [esp + 0x1c]
push edx
call fcn.0040ef00
mov al, byte [esp + 0x13]
push ebp
push ebp
lea ecx, [esp + 0x40]
mov byte [esp + 0x40], al
call fcn.00406e40
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ebp
lea ecx, [esp + 0x38]
mov byte [esp + 0x6c], 5
push ecx
lea ecx, [esp + 0x20]
call fcn.0040efc0
test eax, eax
je 0x40621d
lea edx, [esp + 0x44]
push edx
call dword [sym.imp.USER32.dll_SetRectEmpty]
lea ecx, [esp + 0x38]
call fcn.00406a00
lea eax, [esp + 0x28]
lea ecx, [esp + 0x38]
push eax
call fcn.004069f0
mov eax, dword [eax]
mov ecx, dword [esp + 0x3c]
mov edi, dword [sym.imp.USER32.dll_IsRectEmpty]
cmp eax, ecx
mov dword [esp + 0x20], eax
je 0x406205
mov ebx, dword [sym.imp.USER32.dll_UnionRect]
add eax, 8
mov ecx, eax
mov edx, dword [ecx]
mov dword [esp + 0x54], edx
mov eax, dword [ecx + 4]
mov dword [esp + 0x58], eax
mov edx, dword [ecx + 8]
mov dword [esp + 0x5c], edx
lea edx, [esp + 0x44]
mov ecx, dword [ecx + 0xc]
push edx
mov dword [esp + 0x64], ecx
mov ecx, dword [esp + 0x54]
cmp eax, ecx
jle 0x4061da
call edi
test eax, eax
jne 0x4061b8
mov ecx, dword [esi + 0x1c]
lea eax, [esp + 0x44]
push eax
call fcn.00403b80
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x58]
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x44], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x48], edx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], ecx
jmp 0x4061e6
lea eax, [esp + 0x58]
lea ecx, [esp + 0x48]
push eax
push ecx
call ebx
lea edx, [esp + 0x28]
push ebp
push edx
lea ecx, [esp + 0x28]
call fcn.00406c90
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x3c]
cmp eax, ecx
jne 0x406178
lea eax, [esp + 0x44]
push eax
call edi
test eax, eax
jne 0x40621d
lea ecx, [esp + 0x44]
push ecx
mov ecx, dword [esi + 0x1c]
call fcn.00403b80
lea ecx, [esp + 0x38]
mov byte [esp + 0x6c], 4
call fcn.004069a0
lea ecx, [esp + 0x18]
call fcn.0040eed0
lea edi, [esi + 0x15c]
mov ecx, edi
call fcn.0040eef0
test eax, eax
jne 0x4062e7
mov dl, byte [esp + 0x13]
push 0x18
mov byte [esp + 0x3c], dl
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov dword [eax], eax
mov dword [eax + 4], eax
add esp, 4
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ebp
lea eax, [esp + 0x38]
mov ecx, edi
push eax
mov byte [esp + 0x70], 6
call fcn.0040efc0
mov ecx, dword [esp + 0x3c]
test eax, eax
je 0x4062c3
mov eax, dword [ecx]
cmp eax, ecx
mov dword [esp + 0x20], eax
je 0x4062c3
mov ecx, dword [esi + 0x1c]
add eax, 8
push eax
call fcn.00403fa0
mov ecx, dword [esp + 0x20]
add ecx, 8
push ecx
lea ecx, [esp + 0x1c]
call fcn.0040ee80
lea edx, [esp + 0x28]
push ebp
push edx
lea ecx, [esp + 0x28]
call fcn.00406c90
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x3c]
cmp eax, ecx
jne 0x40628b
mov eax, dword [ecx]
push ecx
push eax
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x44]
mov byte [esp + 0x78], 4
call fcn.00406cd0
mov ecx, dword [esp + 0x3c]
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
lea ecx, [esp + 0x14]
call fcn.0040eef0
test eax, eax
jne 0x40638c
mov dl, byte [esp + 0x13]
push 0x18
mov byte [esp + 0x3c], dl
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov dword [eax], eax
mov dword [eax + 4], eax
add esp, 4
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ebp
lea eax, [esp + 0x38]
lea ecx, [esp + 0x14]
push eax
mov byte [esp + 0x70], 7
call fcn.0040efc0
test eax, eax
mov eax, dword [esp + 0x3c]
je 0x406368
mov ecx, dword [eax]
cmp ecx, eax
mov dword [esp + 0x20], ecx
je 0x406368
add ecx, 8
push ecx
lea ecx, [esp + 0x1c]
push ecx
mov ecx, dword [esi + 0x1c]
call fcn.00403950
lea edx, [esp + 0x28]
push ebp
push edx
lea ecx, [esp + 0x28]
call fcn.00406c90
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x3c]
cmp ecx, eax
jne 0x40633c
mov ecx, dword [eax]
push eax
lea eax, [esp + 0x2c]
push ecx
push eax
lea ecx, [esp + 0x44]
mov byte [esp + 0x78], 4
call fcn.00406cd0
mov ecx, dword [esp + 0x3c]
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
lea ebx, [esi + 0x158]
lea edi, [esi + 0x154]
push ebx
mov ecx, edi
call fcn.0040ef90
lea eax, [esi + 0x15c]
mov ecx, edi
push eax
call fcn.0040ef90
lea ecx, [esp + 0x18]
call fcn.0040eef0
test eax, eax
jne 0x4063cd
lea ecx, [esi + 0x15c]
call fcn.0040eed0
mov ecx, ebx
call fcn.0040eed0
cmp dword [esi + 0x44], ebp
jne 0x406422
lea ecx, [esp + 0x20]
call fcn.00403150
lea edx, [esi + 0x34]
lea ecx, [esp + 0x20]
push edx
mov byte [esp + 0x70], 8
call fcn.0040ee80
lea eax, [esp + 0x18]
lea ecx, [esp + 0x20]
push eax
call fcn.0040ef60
lea ecx, [esp + 0x20]
call fcn.0040eef0
test eax, eax
jne 0x40640f
mov dword [esi + 0x44], 1
lea ecx, [esp + 0x20]
mov byte [esp + 0x6c], 4
call fcn.0040ee70
cmp dword [esi + 0x44], ebp
je 0x40646e
lea ecx, [esp + 0x54]
lea edi, [esi + 0x34]
push ecx
mov ecx, dword [esi + 0x1c]
call fcn.00403ce0
mov ecx, dword [eax]
mov edx, edi
mov dword [edx], ecx
mov ecx, dword [eax + 4]
mov dword [edx + 4], ecx
mov ecx, dword [eax + 8]
mov dword [edx + 8], ecx
mov eax, dword [eax + 0xc]
lea ecx, [esi + 0x198]
push ecx
push edi
push edi
mov dword [edx + 0xc], eax
call dword [sym.imp.USER32.dll_IntersectRect]
test eax, eax
je 0x40646b
mov ecx, dword [esi + 0x1c]
lea edx, [esp + 0x18]
push edi
push edx
call fcn.00403950
mov dword [esi + 0x44], ebp
lea ecx, [esp + 0x1c]
mov byte [esp + 0x6c], 2
call fcn.0040ee70
lea eax, [esp + 0x2c]
lea ecx, [esp + 0x18]
push eax
xor ebx, ebx
call fcn.0040efc0
test eax, eax
je 0x4064b0
mov eax, dword [esp + 0x30]
mov edi, dword [eax]
cmp edi, eax
je 0x4064b0
lea ecx, [edi + 8]
push ecx
mov ecx, dword [esi + 0x1c]
call fcn.00403b70
mov edi, dword [edi]
add ebx, eax
cmp edi, dword [esp + 0x30]
jne 0x40649a
mov eax, dword [esi + 0x178]
pop edi
cmp eax, ebp
je 0x4064bc
inc ebx
cmp ebx, ebp
jne 0x406547
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee70
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x68], 0
mov esi, eax
mov ecx, dword [eax]
cmp ecx, eax
mov dword [esp + 0x1c], ecx
je 0x406511
lea edx, [esp + 0x24]
push ebp
push edx
lea ecx, [esp + 0x24]
call fcn.00406c90
mov eax, dword [eax]
lea ecx, [esp + 0x18]
push eax
push ecx
lea ecx, [esp + 0x30]
call fcn.00411950
cmp dword [esp + 0x1c], esi
jne 0x4064e7
mov eax, dword [esp + 0x2c]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
lea ecx, [esp + 0x14]
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
mov dword [esp + 0x68], 0xffffffff
call fcn.0040ee70
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x54]
mov dword fs:[0], ecx
add esp, 0x60
ret
xor edx, edx
lea eax, [esp + 0x20]
mov dl, bh
push 4
mov dh, bl
push eax
push ebp
mov ecx, esi
mov word [esp + 0x2e], dx
call fcn.00405f00
test eax, eax
jne 0x406598
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee70
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x68], 0
push eax
mov ecx, dword [eax]
push ecx
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [esp + 0x34]
call fcn.00406cd0
mov edx, dword [esp + 0x2c]
push edx
jmp 0x40661e
cmp dword [esi + 0x178], ebp
je 0x4065e0
lea eax, [esi + 0x18c]
lea ecx, [esi + 0x17c]
push eax
push ecx
mov ecx, esi
mov dword [esi + 0x178], ebp
call fcn.004067f0
test eax, eax
jne 0x4065e0
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee70
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x68], 0
push eax
lea edx, [esp + 0x28]
mov ecx, dword [eax]
push ecx
jmp 0x40660f
lea ecx, [esp + 0x28]
push ecx
mov ecx, esi
call fcn.00406700
test eax, eax
mov byte [esp + 0x68], 1
lea ecx, [esp + 0x10]
jne 0x406630
call fcn.0040ee70
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x68], 0
push eax
lea edx, [esp + 0x1c]
mov ecx, dword [eax]
push ecx
push edx
lea ecx, [esp + 0x34]
call fcn.00406cd0
mov eax, dword [esp + 0x2c]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
jmp 0x406643
call fcn.0040ee70
lea ecx, [esp + 0x28]
mov byte [esp + 0x68], 0
call fcn.004069a0
lea ecx, [esp + 0x14]
mov dword [esp + 0x68], 0xffffffff
call fcn.0040ee70
mov ecx, dword [esp + 0x60]
pop esi
pop ebp
mov eax, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x60
ret