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

Disassembly:
push 0xffffffffffffffff
push 0x414208
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.0040eee0
test eax, eax
je 0x405ff7
lea ecx, [esi + 0x15c]
call fcn.0040eee0
test eax, eax
je 0x405ff7
cmp dword [esi + 0x178], ebp
jne 0x405ff7
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee60
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.00406cc0
mov edx, dword [esp + 0x2c]
push edx
jmp 0x406502
lea ebx, [esi + 0x15c]
push edi
mov ecx, ebx
call fcn.0040eee0
test eax, eax
jne 0x406066
cmp dword [esi + 0x178], ebp
je 0x406090
lea ecx, [esp + 0x1c]
call fcn.00403150
lea edi, [esi + 0x17c]
lea ecx, [esp + 0x1c]
push edi
mov byte [esp + 0x70], 3
call fcn.0040ee70
push ebx
lea ecx, [esp + 0x20]
call fcn.0040ef50
lea ecx, [esp + 0x1c]
call fcn.0040eee0
test eax, eax
jne 0x406058
push edi
lea ecx, [esi + 0x154]
call fcn.0040ee70
mov dword [esi + 0x178], ebp
lea ecx, [esp + 0x1c]
mov byte [esp + 0x6c], 2
call fcn.0040ee60
cmp dword [esi + 0x178], ebp
je 0x406090
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 0x40646c
lea ecx, [esp + 0x14]
call fcn.0040eec0
lea eax, [esi + 0x158]
lea ecx, [esp + 0x14]
push eax
call fcn.0040eef0
push ebx
lea ecx, [esp + 0x18]
call fcn.0040ef80
lea eax, [esi + 0x154]
lea ecx, [esp + 0x14]
push eax
call fcn.0040ef50
lea ecx, [esp + 0x1c]
call fcn.00403150
lea ecx, [esp + 0x1c]
mov byte [esp + 0x6c], 4
call fcn.0040eec0
push ebx
lea ecx, [esp + 0x20]
call fcn.0040eef0
lea edx, [esp + 0x14]
lea ecx, [esp + 0x1c]
push edx
call fcn.0040eef0
mov al, byte [esp + 0x13]
push ebp
push ebp
lea ecx, [esp + 0x40]
mov byte [esp + 0x40], al
call fcn.00406e30
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.0040efb0
test eax, eax
je 0x40620d
lea edx, [esp + 0x44]
push edx
call dword [sym.imp.USER32.dll_SetRectEmpty]
lea ecx, [esp + 0x38]
call fcn.004069f0
lea eax, [esp + 0x28]
lea ecx, [esp + 0x38]
push eax
call fcn.004069e0
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 0x4061f5
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 0x4061ca
call edi
test eax, eax
jne 0x4061a8
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 0x4061d6
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.00406c80
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x3c]
cmp eax, ecx
jne 0x406168
lea eax, [esp + 0x44]
push eax
call edi
test eax, eax
jne 0x40620d
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.00406990
lea ecx, [esp + 0x18]
call fcn.0040eec0
lea edi, [esi + 0x15c]
mov ecx, edi
call fcn.0040eee0
test eax, eax
jne 0x4062d7
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.0040efb0
mov ecx, dword [esp + 0x3c]
test eax, eax
je 0x4062b3
mov eax, dword [ecx]
cmp eax, ecx
mov dword [esp + 0x20], eax
je 0x4062b3
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.0040ee70
lea edx, [esp + 0x28]
push ebp
push edx
lea ecx, [esp + 0x28]
call fcn.00406c80
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x3c]
cmp eax, ecx
jne 0x40627b
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.00406cc0
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.0040eee0
test eax, eax
jne 0x40637c
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.0040efb0
test eax, eax
mov eax, dword [esp + 0x3c]
je 0x406358
mov ecx, dword [eax]
cmp ecx, eax
mov dword [esp + 0x20], ecx
je 0x406358
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.00406c80
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x3c]
cmp ecx, eax
jne 0x40632c
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.00406cc0
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.0040ef80
lea eax, [esi + 0x15c]
mov ecx, edi
push eax
call fcn.0040ef80
lea ecx, [esp + 0x18]
call fcn.0040eee0
test eax, eax
jne 0x4063bd
lea ecx, [esi + 0x15c]
call fcn.0040eec0
mov ecx, ebx
call fcn.0040eec0
cmp dword [esi + 0x44], ebp
jne 0x406412
lea ecx, [esp + 0x20]
call fcn.00403150
lea edx, [esi + 0x34]
lea ecx, [esp + 0x20]
push edx
mov byte [esp + 0x70], 8
call fcn.0040ee70
lea eax, [esp + 0x18]
lea ecx, [esp + 0x20]
push eax
call fcn.0040ef50
lea ecx, [esp + 0x20]
call fcn.0040eee0
test eax, eax
jne 0x4063ff
mov dword [esi + 0x44], 1
lea ecx, [esp + 0x20]
mov byte [esp + 0x6c], 4
call fcn.0040ee60
cmp dword [esi + 0x44], ebp
je 0x40645e
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 0x40645b
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.0040ee60
lea eax, [esp + 0x2c]
lea ecx, [esp + 0x18]
push eax
xor ebx, ebx
call fcn.0040efb0
test eax, eax
je 0x4064a0
mov eax, dword [esp + 0x30]
mov edi, dword [eax]
cmp edi, eax
je 0x4064a0
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 0x40648a
mov eax, dword [esi + 0x178]
pop edi
cmp eax, ebp
je 0x4064ac
inc ebx
cmp ebx, ebp
jne 0x406537
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee60
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 0x406501
lea edx, [esp + 0x24]
push ebp
push edx
lea ecx, [esp + 0x24]
call fcn.00406c80
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 0x4064d7
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.0040ee60
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.00405ef0
test eax, eax
jne 0x406588
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee60
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.00406cc0
mov edx, dword [esp + 0x2c]
push edx
jmp 0x40660e
cmp dword [esi + 0x178], ebp
je 0x4065d0
lea eax, [esi + 0x18c]
lea ecx, [esi + 0x17c]
push eax
push ecx
mov ecx, esi
mov dword [esi + 0x178], ebp
call fcn.004067e0
test eax, eax
jne 0x4065d0
lea ecx, [esp + 0x10]
mov byte [esp + 0x68], 1
call fcn.0040ee60
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x68], 0
push eax
lea edx, [esp + 0x28]
mov ecx, dword [eax]
push ecx
jmp 0x4065ff
lea ecx, [esp + 0x28]
push ecx
mov ecx, esi
call fcn.004066f0
test eax, eax
mov byte [esp + 0x68], 1
lea ecx, [esp + 0x10]
jne 0x406620
call fcn.0040ee60
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.00406cc0
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 0x406633
call fcn.0040ee60
lea ecx, [esp + 0x28]
mov byte [esp + 0x68], 0
call fcn.00406990
lea ecx, [esp + 0x14]
mov dword [esp + 0x68], 0xffffffff
call fcn.0040ee60
mov ecx, dword [esp + 0x60]
pop esi
pop ebp
mov eax, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x60
ret