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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x587000
push eax
mov dword fs:[0], esp
sub esp, 0x68
push ebx
push ebp
push esi
push edi
mov esi, ecx
call fcn.00501b70
mov edi, eax
test edi, edi
je 0x5044ee
mov ecx, edi
call fcn.004fefb0
mov ebx, eax
mov ecx, edi
mov dword [esp + 0x10], ebx
call fcn.004fefc0
mov edi, dword [esp + 0x88]
mov dword [esp + 0x14], eax
cmp edi, ebx
jl 0x5044ee
mov ebp, dword [esp + 0x8c]
cmp ebp, eax
jl 0x5044ee
mov ebx, dword [esp + 0x94]
mov ecx, dword [esp + 0x90]
mov eax, dword [ebx]
mov edx, dword [ecx]
push eax
lea eax, [esp + 0x34]
push edx
push eax
mov ecx, esi
call fcn.00503f70
lea ecx, [esp + 0x20]
push eax
push ecx
call dword [sym.imp.USER32.dll_CopyRect]
cmp edi, dword [esp + 0x24]
jl 0x50438a
mov eax, dword [esp + 0x2c]
cmp edi, eax
jg 0x5042d9
cmp ebp, dword [esp + 0x20]
jl 0x5042d1
cmp ebp, dword [esp + 0x28]
jle 0x5044ee
cmp edi, eax
jle 0x5043df
mov eax, dword [esi + 0x1c]
lea edx, [esp + 0x30]
push edx
push eax
call dword [sym.imp.USER32.dll_GetClientRect]
push 0
lea ecx, [esp + 0x54]
call fcn.0057f070
mov ecx, dword [esi + 0x5c]
mov edx, dword [esi + 0x58]
push ecx
lea eax, [esp + 0x54]
push edx
push eax
mov dword [esp + 0x8c], 0
call fcn.00511240
add esp, 0xc
lea ecx, [esp + 0x50]
push ecx
lea ecx, [esp + 0x8c]
call fcn.005015d0
mov eax, dword [esp + 0x58]
lea edx, [esp + 0x30]
push 2
push edx
push eax
mov byte [esp + 0x8c], 1
call dword [sym.imp.GDI32.dll_DPtoLP]
mov ebx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x34]
sub ebx, ecx
lea ecx, [esp + 0x18]
push ecx
mov ecx, esi
call fcn.00503620
mov edx, dword [eax + 4]
mov ecx, esi
neg edx
push edx
push ebx
call fcn.005019d0
mov ebp, eax
mov ebx, edi
push ebx
mov ecx, esi
call fcn.00501600
neg eax
push eax
push ebp
mov ecx, esi
call fcn.005019d0
mov ebp, eax
test ebp, ebp
jl 0x504392
mov eax, dword [esp + 0x10]
dec ebx
cmp ebx, eax
jge 0x504366
jmp 0x504393
sub edi, dword [esp + 0x10]
mov dword [ebx], edi
jmp 0x5043df
inc ebx
cmp edi, ebx
mov ecx, edi
jl 0x50439b
mov ecx, ebx
mov eax, dword [esp + 0x10]
cmp eax, ecx
jle 0x5043a7
mov edi, eax
jmp 0x5043ad
cmp edi, ebx
jl 0x5043ad
mov edi, ebx
sub edi, eax
mov eax, dword [esp + 0x94]
lea ecx, [esp + 0x88]
mov dword [eax], edi
call fcn.005015f0
lea ecx, [esp + 0x50]
mov dword [esp + 0x80], 0xffffffff
call fcn.0057f0e2
mov ebp, dword [esp + 0x8c]
cmp ebp, dword [esp + 0x20]
jge 0x5043f9
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x90]
sub ebp, eax
mov dword [ecx], ebp
jmp 0x5044ee
cmp ebp, dword [esp + 0x28]
jle 0x5044ee
mov eax, dword [esi + 0x1c]
lea edx, [esp + 0x40]
push edx
push eax
call dword [sym.imp.USER32.dll_GetClientRect]
push 0
lea ecx, [esp + 0x68]
call fcn.0057f070
mov ecx, dword [esi + 0x5c]
mov edx, dword [esi + 0x58]
push ecx
lea eax, [esp + 0x68]
push edx
push eax
mov dword [esp + 0x8c], 2
call fcn.00511240
add esp, 0xc
lea ecx, [esp + 0x64]
push ecx
lea ecx, [esp + 0x98]
call fcn.005015d0
mov eax, dword [esp + 0x6c]
lea edx, [esp + 0x40]
push 2
push edx
push eax
mov byte [esp + 0x8c], 3
call dword [sym.imp.GDI32.dll_DPtoLP]
lea ecx, [esp + 0x18]
push ecx
mov ecx, esi
call fcn.00503620
mov edi, dword [esp + 0x48]
mov edx, dword [esp + 0x40]
mov ecx, dword [eax]
sub edi, edx
sub edi, ecx
mov ebx, ebp
push ebx
mov ecx, esi
call fcn.005016e0
neg eax
push eax
push edi
mov ecx, esi
call fcn.005018a0
mov edi, eax
test edi, edi
jl 0x5044a8
mov eax, dword [esp + 0x14]
dec ebx
cmp ebx, eax
jge 0x504484
jmp 0x5044a9
inc ebx
cmp ebp, ebx
mov eax, ebp
jl 0x5044b1
mov eax, ebx
mov ecx, dword [esp + 0x14]
cmp ecx, eax
jle 0x5044bd
mov ebx, ecx
jmp 0x5044c3
cmp ebp, ebx
jge 0x5044c3
mov ebx, ebp
mov edx, dword [esp + 0x90]
sub ebx, ecx
lea ecx, [esp + 0x94]
mov dword [edx], ebx
call fcn.005015f0
lea ecx, [esp + 0x64]
mov dword [esp + 0x80], 0xffffffff
call fcn.0057f0e2
mov ecx, dword [esp + 0x78]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x74
ret 0x10