Function at 0x438310
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x44500d
mov eax, dword fs:[0]
push eax
sub esp, 0x18
mov eax, dword [0x474630]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebx + 0xc], 8
mov dword [ebp - 4], 0
jbe 0x438396
push str.TerrainPatch::SavePatch
push str.FUNC:__s____MSG:_ERROR:_Texture_map_list_is_to_big__could_not_save_patch_
call fcn.00405f50
add esp, 8
xor bl, bl
mov ecx, dword [ebp + 0x1c]
cmp ecx, 0x10
jb 0x43856e
mov edx, dword [ebp + 8]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x438564
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x438564
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
cmp dword [ebp + 0x1c], 0x10
lea eax, [ebp + 8]
push 0x4477d0
cmovae eax, dword [ebp + 8]
push eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen_s]
mov eax, dword [ebp - 0x20]
add esp, 0xc
test eax, eax
je 0x43835c
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push eax
push 1
lea eax, [ebx + 0x18]
push 0x24
push eax
call edi
push 0x20
lea eax, [ebx + 0x1c]
push eax
push 0xa0b0c0d0
call fcn.004119f0
mov esi, dword [ebx + 8]
add esp, 0x1c
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x14], 0xffffffff
mov eax, dword [esi]
mov dword [ebp - 0x24], eax
cmp eax, esi
je 0x438423
lea edi, [ebp - 0x18]
mov al, byte [eax + 0x10]
lea ecx, [ebp - 0x24]
mov byte [edi], al
lea edi, [edi + 1]
call fcn.00411a50
mov eax, dword [ebp - 0x24]
cmp eax, esi
jne 0x438406
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push dword [ebp - 0x20]
lea eax, [ebp - 0x18]
push 1
push 8
push eax
call edi
push 8
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x1c]
call fcn.004119f0
push dword [ebp - 0x20]
lea esi, [ebx + 0x3c]
mov dword [ebp - 0x1c], eax
push 1
push 8
push esi
call edi
push 8
push esi
push dword [ebp - 0x1c]
call fcn.004119f0
mov dword [ebp - 0x1c], eax
add esp, 0x38
mov eax, dword [ebx]
sub eax, 1
je 0x4384ad
mov eax, dword [ebx + 8]
mov esi, dword [eax]
mov dword [ebp - 0x24], esi
cmp esi, eax
je 0x4384ad
cmp dword [esi + 0x10], 0
je 0x43849d
push dword [ebp - 0x20]
push 1
push 0x10000
push dword [esi + 0x14]
call edi
push 0x10000
push dword [esi + 0x14]
push dword [ebp - 0x1c]
call fcn.004119f0
add esp, 0x1c
mov dword [ebp - 0x1c], eax
lea ecx, [ebp - 0x24]
call fcn.00411a50
mov esi, dword [ebp - 0x24]
cmp esi, dword [ebx + 8]
jne 0x438472
push dword [ebp - 0x20]
lea esi, [ebx + 0x44]
push 1
push 0x20402
push esi
call edi
push 0x20402
push esi
push dword [ebp - 0x1c]
call fcn.004119f0
push dword [ebp - 0x20]
lea esi, [ebx + 0x20446]
mov dword [ebp - 0x1c], eax
push 1
push 0x30000
push esi
call edi
push 0x30000
push esi
push dword [ebp - 0x1c]
call fcn.004119f0
push dword [ebp - 0x20]
lea esi, [ebx + 0x50446]
mov dword [ebp - 0x1c], eax
push 1
push 0x10000
push esi
call edi
add esp, 0x48
push 0x10000
push esi
push dword [ebp - 0x1c]
call fcn.004119f0
push 0
push 0
push dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push dword [ebp - 0x20]
lea eax, [ebp - 0x1c]
push 1
push 4
push eax
call edi
cmp dword [ebp + 0x1c], 0x10
lea eax, [ebp + 8]
push dword [ebp - 0x1c]
cmovae eax, dword [ebp + 8]
push eax
push str.TerrainPatch::SavePatch
push str.FUNC:__s____MSG:_Saved:___s___0x_08x_
call fcn.00405f50
push dword [ebp - 0x20]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x3c
mov bl, 1
jmp 0x43835e
push ecx
push edx
call fcn.00441da8
add esp, 8
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00442210
mov esp, ebp
pop ebp
ret 0x18