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

Disassembly:
push 0xffffffffffffffff
push 0x55dc8b
mov eax, dword fs:[0]
push eax
sub esp, 0x994
mov eax, dword [0x6397d4]
xor eax, esp
mov dword [esp + 0x990], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6397d4]
xor eax, esp
push eax
lea eax, [esp + 0x9a8]
mov dword fs:[0], eax
mov eax, dword [0x66b728]
mov edi, dword [esp + 0x9b8]
mov esi, ecx
xor ebx, ebx
push 0x400
lea ecx, [esp + 0x1a8]
push ebx
push ecx
mov dword [esi + 4], eax
mov dword [esp + 0x20], ebx
call sub.MSVCR80.dll_memset
add esp, 0xc
lea ecx, [esp + 0x70]
call fcn.00504dc0
push 0x10
push 0x56f8dc
push edi
lea ecx, [esp + 0x7c]
mov dword [esp + 0x9bc], ebx
call fcn.00505730
push edi
push str._s_file_inited
push 0x6366b0
call fcn.00504320
add esp, 0xc
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
call fcn.00505060
cmp eax, 0xffffffff
je 0x521567
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpA]
push str.GX_METADATA
lea eax, [esp + 0x1a8]
push eax
call edi
test eax, eax
jne 0x520fe8
push 0x56e0b0
lea ecx, [esp + 0x1a8]
push ecx
call edi
test eax, eax
je 0x520fe8
lea ebx, [ebx]
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
call fcn.00505060
push str.BOX_MAX
lea eax, [esp + 0x1a8]
push eax
call edi
test eax, eax
jne 0x520f9a
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esi + 0x10]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esi + 0x14]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esi + 0x18]
jmp 0x520fd1
push str.BOX_MIN
lea ecx, [esp + 0x1a8]
push ecx
call edi
test eax, eax
jne 0x520fd1
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esi + 0x1c]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esi + 0x20]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esi + 0x24]
push 0x56e0b0
lea edx, [esp + 0x1a8]
push edx
call edi
test eax, eax
jne 0x520f50
push str.GX_MAP
lea eax, [esp + 0x1a8]
push eax
call edi
test eax, eax
jne 0x521118
push 0x56e0b0
lea ecx, [esp + 0x1a8]
push ecx
call edi
test eax, eax
je 0x5210f4
jmp 0x521020
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
call fcn.00505060
push str.STATIC_MODEL
lea eax, [esp + 0x1a8]
push eax
call edi
test eax, eax
jne 0x521086
lea ecx, [esp + 0x1a4]
push ecx
lea ecx, [esp + 0x74]
call fcn.00505060
lea edx, [esp + 0x1a4]
push edx
push str._s_PID_STATIC_MODEL
push 0x6366b0
call fcn.00504320
add esp, 0xc
lea eax, [esp + 0x1a4]
push eax
mov ecx, esi
call fcn.00520db0
mov dword [esp + 0x14], 1
push str.HEIGHT_FIELD
lea ecx, [esp + 0x1a8]
push ecx
call edi
test eax, eax
jne 0x5210dd
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
call fcn.00505060
lea eax, [esp + 0x1a4]
push eax
push str._s_PID_HEIGHT_FIELD
push 0x6366b0
call fcn.00504320
add esp, 0xc
push 0
lea ecx, [esp + 0x1a8]
push ecx
mov ecx, esi
call fcn.00520c50
mov dword [esp + 0x14], 1
push 0x56e0b0
lea edx, [esp + 0x1a8]
push edx
call edi
test eax, eax
jne 0x521020
cmp dword [esp + 0x14], 0
je 0x521118
push str.bBuildTree
push 0x6366b0
call fcn.00504320
add esp, 8
lea eax, [esi + 0x10]
push eax
mov ecx, esi
call fcn.00520a40
push str.GX_OBJECT
lea ecx, [esp + 0x1a8]
push ecx
call edi
test eax, eax
jne 0x52138f
lea ecx, [esp + 0x70]
call fcn.005058e0
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
mov ebx, eax
call fcn.00505060
test ebx, ebx
jbe 0x52137e
mov ebp, ebx
lea eax, [esp + 0x1a4]
push eax
lea ecx, [esp + 0x74]
call fcn.00505060
lea ecx, [esp + 0x1a4]
push ecx
push str._s_gxobject
push 0x6366b0
call fcn.00504320
add esp, 0xc
lea ecx, [esp + 0x70]
call fcn.005058e0
lea ecx, [esp + 0x70]
mov ebx, eax
call fcn.005058b0
fstp dword [esp + 0x64]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x68]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x6c]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x4c]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x50]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x54]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x58]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x5c]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x60]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x44]
push str.hex_start
push 0x6366b0
call fcn.00504320
add esp, 8
lea edx, [esp + 0x18]
push edx
lea ecx, [esp + 0x74]
call fcn.00504f80
push str.hex_end
push 0x6366b0
call fcn.00504320
mov edx, dword [esp + 0x20]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
add esp, 8
push edx
push 0
push 0
lea edx, [esp + 0x1b0]
push edx
push eax
mov eax, dword [ecx + 0x18c]
call eax
mov edi, eax
test edi, edi
jne 0x521299
lea ecx, [esp + 0x1a4]
push ecx
lea edx, [esp + 0x5a8]
push str.Failed_to_load_MapObject___s_
push edx
call dword [sym.imp.MSVCR80.dll_sprintf]
lea eax, [esp + 0x5b0]
push eax
push 0x6366b0
call fcn.00504320
add esp, 0x14
jmp 0x52136f
mov eax, dword [esi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x4c]
push 0
push edi
push eax
call edx
test eax, eax
jbe 0x5212de
mov eax, dword [esi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x1cc]
push edi
push eax
call edx
mov edx, dword [esp + 0x18]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
or edx, 8
push edx
push 0
push 0
lea edx, [esp + 0x1b0]
push edx
push eax
mov eax, dword [ecx + 0x18c]
call eax
mov edi, eax
test edi, edi
je 0x52136f
mov eax, dword [esi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x150]
push ebx
push edi
push eax
call edx
mov eax, dword [esi + 4]
mov ecx, dword [eax]
lea edx, [esp + 0x64]
push edx
push edi
push eax
mov eax, dword [ecx + 0x8c]
call eax
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push 0
lea edx, [esp + 0x50]
push edx
push edi
push eax
mov eax, dword [ecx + 0x64]
call eax
fld dword [esp + 0x44]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push ecx
fstp dword [esp]
lea edx, [esp + 0x5c]
push edx
push edi
push eax
mov eax, dword [ecx + 0x78]
call eax
mov eax, dword [esi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x180]
push edi
push eax
call edx
mov eax, dword [esi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x178]
push edi
push eax
call edx
mov eax, dword [esi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x170]
push edi
push eax
call edx
push edi
lea ecx, [esi + 0x1a0]
call fcn.0054ea60
sub ebp, 1
jne 0x521155
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpA]
lea eax, [esp + 0x1a4]
push eax
lea ecx, [esp + 0x74]
call fcn.00505060
push str.GX_LIGHT
lea ecx, [esp + 0x1a8]
push ecx
call edi
test eax, eax
jne 0x5213cd
lea ecx, [esp + 0x70]
call fcn.005058e0
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
call fcn.00505060
lea eax, [esp + 0x1a4]
push eax
lea ecx, [esp + 0x74]
call fcn.00505060
push 0x571690
lea ecx, [esp + 0x1a8]
push ecx
call edi
test eax, eax
jne 0x52154d
lea ecx, [esp + 0x70]
call fcn.005058e0
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
mov ebp, eax
call fcn.00505060
test ebp, ebp
jbe 0x52153c
xor eax, eax
lea ecx, [esp + 0x70]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
call fcn.005058e0
mov ebx, eax
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x74]
call fcn.00504f80
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x1c]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x20]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x24]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x28]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x2c]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x30]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x34]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x38]
lea ecx, [esp + 0x70]
call fcn.005058b0
fstp dword [esp + 0x3c]
lea ecx, [esp + 0x48]
push ecx
lea ecx, [esp + 0x74]
call fcn.00504f80
mov ecx, dword [esp + 0x48]
mov eax, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx + 0x194]
push ecx
push 0
push 0
push eax
call edx
mov edi, eax
mov eax, dword [esi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x150]
push ebx
push edi
push eax
call edx
mov eax, dword [esi + 4]
mov ecx, dword [eax]
lea edx, [esp + 0x1c]
push edx
push edi
push eax
mov eax, dword [ecx + 0x210]
call eax
mov eax, dword [esi + 4]
mov ecx, dword [eax]
lea edx, [esp + 0x28]
push edx
push edi
push eax
mov eax, dword [ecx + 0x214]
call eax
mov eax, dword [esi + 4]
mov ecx, dword [eax]
lea edx, [esp + 0x34]
push edx
push edi
push eax
mov eax, dword [ecx + 0x218]
call eax
sub ebp, 1
jne 0x521408
lea ecx, [esp + 0x1a4]
push ecx
lea ecx, [esp + 0x74]
call fcn.00505060
lea edx, [esp + 0x1a4]
push edx
lea ecx, [esp + 0x74]
call fcn.00505060
cmp eax, 0xffffffff
jne 0x520f16
lea ecx, [esp + 0x70]
call fcn.00504e70
mov esi, dword [esi + 8]
lea ecx, [esp + 0x70]
mov dword [esp + 0x9b0], 0xffffffff
call fcn.00505050
mov eax, esi
mov ecx, dword [esp + 0x9a8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x990]
xor ecx, esp
call fcn.0055160d
add esp, 0x9a0
ret 4