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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x74
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, eax
mov ebx, ecx
lea eax, [esi + 0x30]
lea ecx, [esp + 0x60]
call fcn.00515470
mov ecx, dword [esi + 0x2c]
cmp ebx, ecx
jb 0x513081
cmp byte [esp + 0x7c], 0
je 0x513076
mov esi, dword [esp + 0x78]
call fcn.005154d0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
xor edx, edx
cmp edi, edx
jne 0x51308d
cmp byte [esp + 0x7c], dl
jmp 0x51306b
lea eax, [ebx + edi]
cmp eax, ecx
jae 0x51309a
mov dword [esp + 0x18], eax
jmp 0x5130a0
mov dword [esp + 0x18], ecx
mov eax, ecx
mov esi, ebx
mov ecx, eax
shr esi, 0xe
shr ecx, 0xe
sub esp, 8
cmp esi, ecx
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], ecx
jne 0x513148
sub eax, ebx
mov dword [esp + 0x24], eax
mov eax, esp
lea edi, [esp + 0x38]
mov dword [eax], edx
mov dword [eax + 4], edx
call fcn.004cb0e0
lea eax, [esp + 0x28]
push eax
mov eax, dword [ebp + 8]
mov ecx, edi
push ecx
push esi
call fcn.00512b10
xor eax, eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x30]
mov edx, dword [eax + 0x14]
mov eax, dword [eax + 0x10]
push edx
push eax
lea esi, [esp + 0x48]
call fcn.004af920
mov ecx, dword [esp + 0x1c]
mov edx, dword [ebp + 0xc]
and ebx, 0x3fff
add ebx, dword [esp + 0x40]
push ecx
push ebx
push edx
call dword [0x100ef7ec]
call fcn.004c2ef0
call fcn.00514cf0
cmp byte [esp + 0x7c], 0
je 0x51313b
mov esi, dword [esp + 0x78]
call fcn.005154d0
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
and ebx, 0x3fff
mov eax, ebx
mov ebx, 0x4000
sub ebx, eax
mov dword [esp + 0x1c], eax
mov eax, esp
lea edi, [esp + 0x48]
mov dword [esp + 0x24], ebx
mov dword [eax], edx
mov dword [eax + 4], edx
call fcn.004cb0e0
lea eax, [esp + 0x28]
push eax
mov eax, dword [ebp + 8]
mov ecx, edi
push ecx
push esi
call fcn.00512b10
xor eax, eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x40]
mov edx, dword [eax + 0x14]
mov eax, dword [eax + 0x10]
push edx
push eax
lea esi, [esp + 0x38]
call fcn.004af920
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x30]
mov edi, dword [ebp + 0xc]
push ebx
add ecx, edx
push ecx
push edi
call dword [0x100ef7ec]
call fcn.004c2ef0
cmp dword [esp + 0x28], 0
lea eax, [ebx + edi]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ebx
jne 0x5131d7
cmp dword [esp + 0x2c], 0
je 0x5131f5
mov eax, dword [ebp + 8]
add eax, 0x10
lea ecx, [esp + 0x28]
lea ebx, [esp + 0x30]
call fcn.00514790
mov edi, ebx
call fcn.00514cf0
mov ebx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
add ecx, 1
cmp ecx, eax
jae 0x5132bc
mov edx, dword [ebp + 8]
sub eax, ecx
mov dword [esp + 0x1c], eax
add edx, 0x10
shl eax, 0xe
add eax, ebx
mov dword [esp + 0x24], edx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x28]
lea ebx, [esp + 0x50]
call fcn.00514790
mov ebx, eax
lea edi, [esp + 0x40]
call fcn.00514c90
lea edi, [esp + 0x50]
call fcn.00514cf0
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
xor edi, edi
push ecx
push edx
lea esi, [esp + 0x38]
mov dword [esp + 0x38], edi
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], edi
call fcn.004af920
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x10]
push 0x4000
push eax
push ecx
call dword [0x100ef7ec]
mov eax, dword [esp + 0x38]
cmp eax, edi
mov edx, dword [esp + 0x3c]
jne 0x51328e
cmp edx, edi
je 0x51329d
mov ecx, dword [0x100ef540]
mov esi, dword [ecx]
push edx
mov edx, dword [esi + 0x24]
push eax
call edx
add dword [esp + 0x10], 0x4000
sub dword [esp + 0x1c], 1
mov dword [esp + 0x38], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x30], edi
jne 0x513221
mov eax, dword [esp + 0x18]
and eax, 0x3fff
mov dword [esp + 0x1c], eax
je 0x513333
mov eax, dword [ebp + 8]
add eax, 0x10
lea ecx, [esp + 0x28]
lea ebx, [esp + 0x50]
call fcn.00514790
mov ebx, eax
lea edi, [esp + 0x40]
call fcn.00514c90
lea edi, [esp + 0x50]
call fcn.00514cf0
xor eax, eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push ecx
push edx
lea esi, [esp + 0x38]
call fcn.004af920
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x10]
push edi
push eax
push ecx
call dword [0x100ef7ec]
call fcn.004c2ef0
add dword [esp + 0x14], edi
lea edi, [esp + 0x40]
call fcn.00514cf0
cmp byte [esp + 0x7c], 0
je 0x51334c
mov esi, dword [esp + 0x78]
call fcn.005154d0
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8