Function at 0x59a040
Capabilities:
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x720fdb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x98
push ebx
push esi
mov esi, ecx
mov eax, dword [esi + 0x4c]
test eax, eax
push edi
jne 0x59a0d3
mov edi, dword [ebp + 8]
push 0x740ca4
mov ecx, edi
call fcn.005e5670
push eax
call fcn.006fad9d
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x59a0ed
lea ecx, [esp + 0x10]
call fcn.005b3190
mov ecx, edi
mov dword [esp + 0xac], 0
call fcn.005e5670
push eax
lea eax, [esp + 0x14]
push str.ERROR:_opening_a_Binary_walkmesh_file_for_writeing_that_already_exists__File:__s_
push eax
call fcn.005e5680
push ebx
call fcn.006facf0
add esp, 0x10
lea ecx, [esp + 0x10]
mov dword [esp + 0xac], 0xffffffff
call fcn.005e5c20
or eax, 0xffffffff
mov ecx, dword [esp + 0xa4]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0x74a0a4
mov ecx, edi
call fcn.005e5670
push eax
call fcn.006fad9d
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x59a11f
mov ecx, dword [esp + 0xa4]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea ecx, [esp + 0x18]
call fcn.005808e0
mov edx, dword [0x74a09c]
xor eax, eax
mov ecx, 0x22
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
mov ecx, dword [0x74a098]
mov al, byte [0x74a0a0]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], ecx
mov ecx, dword [esi + 4]
mov byte [esp + 0x20], al
mov dword [esp + 0x20], ecx
lea edx, [esi + 0x70]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov edx, dword [edx + 8]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
lea eax, [esi + 0x7c]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov eax, dword [eax + 8]
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edx
lea ecx, [esi + 0x2c]
mov edx, dword [ecx]
mov dword [esp + 0x38], eax
mov eax, dword [ecx + 4]
mov ecx, dword [ecx + 8]
mov dword [esp + 0x54], edx
mov edx, dword [esi + 0x50]
push ebx
push 1
mov dword [esp + 0x68], edx
mov dword [esp + 0x60], eax
mov eax, dword [esi + 0x58]
mov dword [esp + 0x64], ecx
mov ecx, dword [esi + 0x5c]
lea edx, [esp + 0x20]
push 0x88
push edx
mov dword [esp + 0x78], eax
mov dword [esp + 0x98], ecx
call fcn.006fab27
push ebx
call fcn.006fba49
mov ecx, dword [esi + 0x54]
mov dword [esp + 0x78], eax
mov eax, dword [esi + 0x50]
push ebx
push eax
push 0xc
push ecx
call fcn.006fab27
push ebx
call fcn.006fba49
mov dword [esp + 0x94], eax
mov eax, dword [esi + 0x58]
push ebx
lea edx, [eax + eax*2]
mov eax, dword [esi + 0x60]
push edx
push 4
push eax
call fcn.006fab27
push ebx
call fcn.006fba49
mov ecx, dword [esi + 0x58]
mov edx, dword [esi + 0x64]
push ebx
push ecx
push 4
push edx
mov dword [esp + 0xbc], eax
call fcn.006fab27
add esp, 0x4c
push ebx
call fcn.006fba49
mov ecx, dword [esi + 0x68]
mov dword [esp + 0x78], eax
mov eax, dword [esi + 0x58]
push ebx
push eax
push 0xc
push ecx
call fcn.006fab27
push ebx
call fcn.006fba49
mov edx, dword [esi + 0x58]
push ebx
push edx
mov dword [esp + 0x98], eax
mov eax, dword [esi + 0x6c]
push 4
push eax
call fcn.006fab27
push 0
push 0
push ebx
call fcn.006fbb19
push ebx
push 1
lea ecx, [esp + 0x54]
push 0x88
push ecx
call fcn.006fab27
add esp, 0x44
push ebx
call fcn.006facf0
mov ecx, dword [esp + 0xa8]
add esp, 4
pop edi
pop esi
mov eax, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 4