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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x7994f4]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 8]
xor eax, eax
push ebx
mov dword [ebp - 0x10], eax
xor edx, edx
push esi
mov ebx, dword [ecx + 0x14]
push edi
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x14], 0
mov eax, dword [ebx + 0x94]
div dword [ebx + 0x98]
or byte [ebx + 0x14], 4
mov ecx, dword [ecx + 0x18]
mov edx, eax
mov esi, dword [ebx + 0x18]
lea edi, [edx - 1]
not edi
lea eax, [ecx - 1]
and edi, eax
inc edi
mov dword [ebp - 0x1c], edi
cmp ecx, esi
jbe 0x507bec
sub ecx, edi
inc ecx
mov dword [ebp - 0xc], ecx
jmp 0x507c04
lea eax, [edx - 1]
add eax, edi
cmp eax, esi
jbe 0x507bff
mov ecx, esi
sub ecx, edi
inc ecx
mov dword [ebp - 0xc], ecx
jmp 0x507c04
mov ecx, edx
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x18], 0
test ecx, ecx
jle 0x507dd5
mov esi, edi
cmp dword [ebp - 0x14], 0
jne 0x507dd5
mov eax, dword [ebp - 0x20]
cmp esi, dword [eax + 0x18]
je 0x507cac
mov eax, dword [ebx + 0x38]
test eax, eax
je 0x507cac
push esi
push eax
call fcn.00514f60
add esp, 8
test eax, eax
je 0x507ca9
mov eax, dword [ebx + 0xd4]
push 0
push esi
push dword [eax + 0x2c]
call dword [0x786cb0]
mov ecx, eax
add esp, 0xc
test ecx, ecx
jne 0x507c63
mov dword [ebp - 8], eax
jmp 0x507d02
mov eax, dword [ecx + 4]
mov edx, dword [ebx + 0xd4]
cmp dword [eax], 0
jne 0x507c7e
push ecx
push esi
push edx
call fcn.0050a8e0
add esp, 0xc
jmp 0x507c85
inc dword [edx + 0xc]
inc word [eax + 0x1e]
mov dword [ebp - 8], eax
test eax, eax
je 0x507d02
test byte [eax + 0x1c], 8
mov edx, 1
mov ecx, dword [ebp - 0x10]
cmovne ecx, edx
push eax
mov dword [ebp - 0x10], ecx
call fcn.0052dee0
add esp, 4
jmp 0x507d02
mov ecx, dword [ebp - 0xc]
mov eax, dword [0x786d38]
cdq
idiv dword [ebx + 0x98]
inc eax
cmp esi, eax
je 0x507d05
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebx + 0xcc]
push esi
push ebx
call eax
mov ecx, eax
add esp, 0x10
mov dword [ebp - 0x14], ecx
test ecx, ecx
jne 0x507d02
push dword [ebp - 8]
call fcn.00508ed0
mov ecx, dword [ebp - 0x10]
mov edx, 1
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 8]
push eax
test byte [eax + 0x1c], 8
cmovne ecx, edx
mov dword [ebp - 0x10], ecx
call fcn.0052dee0
add esp, 8
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
inc esi
inc eax
mov dword [ebp - 0x18], eax
cmp eax, ecx
jl 0x507c15
cmp dword [ebp - 0x14], 0
jne 0x507dd5
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x507dd5
nop word [eax + eax]
mov eax, dword [ebx + 0xd4]
push 0
push edi
push dword [eax + 0x2c]
call dword [0x786cb0]
mov ecx, eax
add esp, 0xc
test ecx, ecx
je 0x507dc7
mov eax, dword [ecx + 4]
mov edx, dword [ebx + 0xd4]
cmp dword [eax], 0
jne 0x507d66
push ecx
push edi
push edx
call fcn.0050a8e0
add esp, 0xc
jmp 0x507d6d
inc dword [edx + 0xc]
inc word [eax + 0x1e]
test eax, eax
je 0x507dc7
or word [eax + 0x1c], 8
test byte [eax + 0x1c], 0x20
je 0x507dbe
mov edx, dword [eax + 0x14]
dec dword [edx + 0x78]
mov ecx, dword [edx + 0x88]
mov dword [eax + 0x10], ecx
mov esi, dword [edx + 0x3c]
mov dword [edx + 0x88], eax
push dword [eax + 4]
mov ecx, dword [eax + 0x18]
mov eax, dword [edx + 0x98]
dec ecx
mov edi, dword [esi]
cdq
push edx
push eax
push 0
push ecx
call fcn.00605ee0
push edx
push eax
mov eax, dword [edi + 0x48]
push esi
call eax
mov edi, dword [ebp - 0x1c]
add esp, 0x10
jmp 0x507dc7
push eax
call fcn.0052ec20
add esp, 4
inc edi
sub dword [ebp - 0xc], 1
mov dword [ebp - 0x1c], edi
jne 0x507d30
mov ecx, dword [ebp - 4]
and byte [ebx + 0x14], 0xfb
xor ecx, ebp
mov eax, dword [ebp - 0x14]
pop edi
pop esi
pop ebx
call fcn.0060565a
mov esp, ebp
pop ebp
ret