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

Disassembly:
sub esp, 0x68
mov dword [esp + 8], ecx
push ebx
mov ebx, dword [esp + 0x70]
movzx edx, byte [ebx + 0xb]
mov eax, dword [ebx + 0x14]
xor ecx, ecx
mov ch, byte [ebx + 9]
push ebp
mov ebp, dword [esp + 0x78]
push esi
push edi
mov dword [esp + 0x10], eax
mov eax, dword [ebp]
mov cl, byte [ebx + 0xa]
shl ecx, 8
or ecx, edx
mov edi, ecx
mov ecx, ebp
call dword [eax + 0x1c]
mov ecx, dword [esp + 0x84]
mov edx, dword [esp + 0x10]
xor esi, esi
push esi
push ecx
push edi
push edx
push eax
lea ecx, [esp + 0x3c]
mov dword [esp + 0x94], eax
call fcn.0054d100
mov bl, byte [ebx + 8]
cmp bl, 0xf
je 0x518524
cmp bl, 0x10
jne 0x518556
mov ecx, dword [esp + 0x28]
add ecx, 4
dec edi
call fcn.0052cda0
test al, al
jne 0x51877a
mov ecx, dword [esp + 0x80]
cmp ecx, esi
je 0x51877a
call fcn.00560dc0
cmp eax, 3
jb 0x51877a
mov eax, dword [esp + 0x28]
mov ebx, dword [eax + 0xc]
push 2
lea ecx, [eax + 4]
add ebx, edi
call fcn.0052cf80
mov ecx, dword [esp + 0x28]
add ecx, 4
mov dword [esp + 0x10], eax
call fcn.0052ce60
mov ecx, dword [esp + 0x28]
add ecx, 4
mov dword [esp + 0x20], eax
call fcn.0052ce60
mov ecx, dword [esp + 0x28]
add ecx, 4
mov dword [esp + 0x14], eax
call fcn.0052ce60
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 0xc]
mov eax, dword [ebp + 4]
xor edi, edi
cmp eax, esi
mov dword [esp + 0x24], ecx
je 0x518736
mov edx, dword [ebp + 0x14]
mov ecx, dword [esp + 0x84]
mov dword [esp + 0x6c], esi
mov dword [esp + 0x70], esi
mov dword [esp + 0x74], esi
mov dword [esp + 0x60], esi
mov dword [esp + 0x64], esi
mov dword [esp + 0x68], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x58], esi
mov dword [esp + 0x5c], esi
mov dword [esp + 0x48], esi
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], esi
mov dword [esp + 0x80], edx
call fcn.004b4e00
push eax
mov eax, dword [esp + 0x84]
push eax
call fcn.00515900
push esi
push esi
push esi
mov ecx, dword [ebp + 4]
mov ecx, dword [ecx + 0x2c]
lea edx, [esp + 0x44]
push edx
lea edx, [esp + 0x54]
push edx
lea edx, [esp + 0x64]
push edx
lea edx, [esp + 0x74]
push edx
lea edx, [esp + 0x84]
push edx
lea edx, [esp + 0x94]
push edx
mov edx, dword [esp + 0xb0]
push edx
mov edx, dword [esp + 0x40]
push esi
push edx
push esi
push eax
push esi
push ecx
mov dword [esp + 0xc8], eax
call fcn.005167d0
add esp, 0x48
test eax, eax
je 0x518699
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x80]
mov ecx, eax
and ecx, 8
push ecx
mov ecx, dword [esp + 0x1c]
and eax, 2
push eax
mov eax, dword [esp + 0x38]
push edx
push eax
call fcn.00514ba0
mov edi, eax
mov ecx, dword [esp + 0x80]
push ecx
call fcn.005dd350
mov edx, dword [esp + 0x34]
push edx
call fcn.005dd350
mov eax, dword [esp + 0x44]
push eax
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x44], esi
call fcn.005dd350
mov ecx, dword [esp + 0x54]
push ecx
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], esi
mov dword [esp + 0x54], esi
call fcn.005dd350
mov edx, dword [esp + 0x64]
push edx
mov dword [esp + 0x5c], esi
mov dword [esp + 0x60], esi
mov dword [esp + 0x64], esi
call fcn.005dd350
mov eax, dword [esp + 0x74]
push eax
mov dword [esp + 0x6c], esi
mov dword [esp + 0x70], esi
mov dword [esp + 0x74], esi
call fcn.005dd350
mov ecx, dword [esp + 0x84]
push ecx
mov dword [esp + 0x7c], esi
mov dword [esp + 0x80], esi
mov dword [esp + 0x84], esi
call fcn.005dd350
add esp, 0x1c
mov dword [esp + 0x6c], esi
mov dword [esp + 0x70], esi
mov dword [esp + 0x74], esi
mov edx, dword [esp + 0x10]
push edx
call fcn.005dd350
add esp, 4
cmp edi, esi
je 0x51877a
cmp dword [edi + 0xa4], ebp
jne 0x51877a
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov dword [edi + 0x7c], eax
mov eax, dword [esp + 0x24]
mov dword [edi + 0x78], ecx
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x7c]
mov dword [edx + 0xc], eax
mov edx, dword [edi]
push ebx
lea eax, [esp + 0x2c]
push eax
push ecx
mov ecx, edi
call dword [edx + 0x20]
lea ecx, [esp + 0x28]
call fcn.00549fe0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x68
ret 0xc