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

Disassembly:
sub esp, 0x58
push ebx
push ecx
push edx
push esi
push edi
push ebp
mov dword [esp + 0x30], eax
mov esi, ebx
mov dword [esp + 0x3c], ecx
mov ebx, 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], 0
mov eax, dword [eax + 0x2d]
and eax, 0xa
cmp eax, 0
je 0x508c4e
mov ecx, 1
jmp 0x508c53
mov edx, dword [eax]
call dword [edx + 0x88]
cmp eax, 0
jne 0x508b43
jmp 0x508c8c
lea ebx, [esp + 0x50]
mov eax, ebx
mov eax, ebx
mov ecx, dword [esp + 0x34]
push eax
mov eax, dword [ecx + 4]
push eax
call sub.USER32.dll_GetWindowRect
mov eax, ebx
mov dword [esp + 0x38], eax
mov ebp, dword [esp + 0x30]
push eax
mov eax, dword [ebp + 4]
push eax
call sub.USER32.dll_ScreenToClient
mov eax, dword [esp + 0x38]
lea eax, [eax + 8]
push eax
mov eax, dword [ebp + 4]
push eax
call sub.USER32.dll_ScreenToClient
mov ecx, dword [esp + 0x1c]
cmp ecx, 0
je 0x508bab
mov eax, ebx
lea edx, [esp + 0x68]
mov dword [esp + 0x2c], edx
mov edx, dword [eax + 0xc]
sub edx, dword [eax + 4]
mov ebp, dword [eax + 8]
sub ebp, dword [eax]
mov eax, dword [esp + 0x2c]
mov dword [eax], ebp
mov dword [eax + 4], edx
mov edx, dword [esp + 0x6c]
jmp 0x508bce
mov eax, ebx
lea edx, [esp + 0x40]
mov dword [esp + 0x28], edx
mov edx, dword [eax + 0xc]
sub edx, dword [eax + 4]
mov ebp, dword [eax + 8]
sub ebp, dword [eax]
mov eax, dword [esp + 0x28]
mov dword [eax], ebp
mov dword [eax + 4], edx
mov edx, dword [esp + 0x40]
dec edx
mov eax, dword [esp + 0x20]
cmp eax, edx
jg 0x508bf5
cmp ecx, 0
je 0x508bf7
lea edx, [esp + 0x60]
mov eax, dword [ebx + 0xc]
sub eax, dword [ebx + 4]
mov ebp, dword [ebx + 8]
sub ebp, dword [ebx]
mov dword [edx], ebp
mov dword [edx + 4], eax
mov eax, dword [esp + 0x64]
jmp 0x508c10
jmp 0x508c10
lea edx, [esp + 0x48]
mov eax, dword [ebx + 0xc]
sub eax, dword [ebx + 4]
mov ebp, dword [ebx + 8]
sub ebp, dword [ebx]
mov dword [edx], ebp
mov dword [edx + 4], eax
mov eax, dword [esp + 0x48]
dec eax
mov dword [esp + 0x20], eax
cmp ecx, 0
je 0x508c2b
mov ebx, dword [esp + 0x50]
mov eax, dword [esp + 0x3c]
cmp dword [eax], ebx
setg al
movzx eax, al
jmp 0x508c3c
mov ebx, dword [esp + 0x54]
mov eax, dword [esp + 0x3c]
cmp dword [eax + 4], ebx
setg al
movzx eax, al
cmp eax, 0
je 0x508ce4
mov dword [esp + 0x24], edi
jmp 0x508ce4
mov ecx, 0
mov dword [esp + 0x1c], ecx
mov edi, 0
mov eax, dword [esp + 0x30]
lea ebp, [eax + 0x45]
mov eax, ebp
mov eax, dword [eax + 8]
cmp edi, eax
pushfd
mov ebx, dword [esp + 0x28]
inc ebx
popfd
jge 0x508cea
mov eax, edi
mov edx, ebp
mov edx, dword [edx + 4]
lea eax, [edx + eax*4]
mov eax, dword [eax]
mov dword [esp + 0x34], eax
cmp eax, 0
jne 0x508b31
mov edx, dword [esp + 0x20]
sub edx, 2
mov eax, dword [esp + 0x18]
add eax, edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x20], 0
cmp ecx, 0
je 0x508cb0
mov edx, dword [esp + 0x78]
jmp 0x508cb4
mov edx, dword [esp + 0x74]
cmp edx, eax
jge 0x508ce0
cmp edi, 0
jne 0x508cce
mov eax, ebp
mov ecx, 0
mov edx, 1
call fcn.004804f0
mov eax, ebp
mov ecx, esi
mov edx, 1
call fcn.004804f0
mov eax, ebx
jmp 0x508d0b
mov dword [esp + 0x24], edi
inc edi
jmp 0x508c5c
mov eax, ebp
mov ecx, 0
mov edx, 1
call fcn.004804f0
mov eax, ebp
mov ecx, esi
mov edx, 1
call fcn.004804f0
mov eax, ebx
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx
add esp, 0x58
ret 8