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

Disassembly:
sub esp, 0x40
push ebx
push ebp
mov ebp, ecx
push esi
lea eax, [esp + 0x3c]
push edi
push eax
lea ecx, [ebp + 0x3c]
call fcn.00501380
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x40]
mov edi, dword [esp + 0x54]
sub eax, ecx
lea esi, [ebp + 0xc]
dec eax
mov edx, dword [edi]
push esi
mov ecx, edi
mov dword [esp + 0x3c], eax
call dword [edx + 0x68]
mov ebx, eax
mov eax, dword [edi]
push esi
mov ecx, edi
call dword [eax + 0x60]
mov edx, dword [edi]
sub eax, ebx
push esi
mov ecx, edi
lea ebx, [eax + 2]
mov dword [esp + 0x30], eax
mov dword [esp + 0x18], ebx
call dword [edx + 0x64]
lea eax, [eax + ebx + 1]
mov ebx, dword [ebp + 8]
mov dword [esp + 0x3c], eax
mov byte [esp + 0x13], 1
mov dword [esp + 0x20], 0
push 0xa
push ebx
call fcn.005bafa0
add esp, 8
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x508fd4
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov byte [esp + 0x13], al
add ecx, ebx
mov dword [esp + 0x1c], ecx
mov eax, ecx
mov edi, dword [ebp + 8]
mov edx, dword [ebp]
mov esi, ebx
sub esi, edi
mov edi, eax
sub edi, ebx
push esi
push edx
lea ecx, [edi + esi]
mov dword [esp + 0x2c], ecx
call fcn.00503050
mov ecx, dword [esp + 0x2c]
push ecx
push eax
call fcn.00503040
mov edx, dword [ebp + 4]
sub eax, esi
push esi
push edx
mov dword [esp + 0x40], eax
call fcn.00503050
mov ecx, dword [esp + 0x3c]
push ecx
push eax
call fcn.00503040
mov edx, dword [esp + 0x78]
mov ecx, dword [esp + 0x4c]
add esp, 0x20
sub eax, esi
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x14]
push edx
push 0
mov esi, eax
sub esp, 0x10
sub esi, ecx
mov edx, esp
mov ecx, 1
dec esi
mov dword [edx], ecx
mov ecx, dword [esp + 0x50]
push eax
lea eax, [esp + 0x34]
mov dword [edx + 4], esi
mov dword [esp + 0x34], 5
mov dword [edx + 8], ecx
mov ecx, dword [esp + 0x58]
mov dword [edx + 0xc], ecx
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x70]
push edx
push 0
push ebx
push eax
push ecx
mov ecx, ebp
call fcn.00508c00
mov edx, dword [esp + 0x58]
mov eax, 1
push edx
push 1
sub esp, 0x10
mov edx, dword [esp + 0x50]
mov ecx, esp
mov dword [ecx], eax
mov eax, dword [esp + 0x54]
mov dword [ecx + 4], esi
mov dword [ecx + 8], edx
mov edx, dword [esp + 0x3c]
mov dword [ecx + 0xc], eax
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x40]
push ecx
push edx
mov edx, dword [esp + 0x74]
push eax
lea ecx, [esp + 0x3c]
push ebx
push ecx
push edx
mov ecx, ebp
call fcn.00508c00
mov eax, dword [esp + 0x58]
mov edx, dword [esp + 0x38]
push eax
push 0
sub esp, 0x10
mov eax, 1
mov ecx, esp
mov dword [ecx], eax
mov eax, dword [esp + 0x54]
mov dword [ecx + 4], esi
mov esi, dword [esp + 0x2c]
push esi
push edi
mov dword [ecx + 8], edx
lea edx, [esp + 0x38]
mov dword [ecx + 0xc], eax
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x74]
push ecx
push ebx
push edx
push eax
mov ecx, ebp
call fcn.00508c00
mov eax, dword [ebp + 0x34]
mov edi, dword [esp + 0x3c]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
add esi, eax
add edi, eax
mov eax, dword [esp + 0x20]
push edx
push eax
lea ebx, [ecx + 1]
mov dword [esp + 0x1c], esi
mov dword [esp + 0x44], edi
call fcn.00503050
mov dword [esp + 0x28], eax
mov al, byte [esp + 0x1b]
add esp, 8
test al, al
jne 0x508fab
mov eax, dword [esp + 0x20]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 8