Function at 0x4018b0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
push esi
lea eax, [esp + 0xc]
push edi
push eax
push ebp
call fcn.00402df0
mov ebx, eax
add esp, 8
test ebx, ebx
mov dword [esp + 0x18], ebx
je 0x401b23
cmp byte [ebx], 0x4d
jne 0x401b1a
cmp byte [ebx + 1], 0x5a
jne 0x401b1a
mov ecx, dword [esp + 0x10]
push ecx
push ebx
push 0x405030
push 0x405010
call fcn.004011a0
add esp, 0x10
test eax, eax
jne 0x401b1a
mov edx, dword [esp + 0x10]
push edx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x14]
mov esi, eax
mov edx, ecx
xor eax, eax
mov edi, esi
push esi
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov dword [esp + 0x1c], esi
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x18]
push eax
push ebx
call fcn.00402ce0
push 0x4052f4
push ebp
call sub.MSVCRT.dll_fopen
mov edi, eax
add esp, 0x18
test edi, edi
jne 0x401967
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ecx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x28]
push ecx
push ebp
push 0x405030
push 0x405010
call fcn.004011a0
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x4019a4
mov edx, dword [esp + 0x14]
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov eax, dword [0x405248]
test eax, eax
je 0x4019cf
mov eax, dword [esp + 0x2c]
push eax
push ebp
push 0
push 0x405030
call fcn.004011a0
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4019d3
mov dword [0x405248], eax
jmp 0x4019d3
mov ebx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x2c]
push ecx
push ebp
call fcn.00401cd0
add esp, 8
cmp eax, 0xffffffff
jne 0x401a05
mov edx, dword [esp + 0x14]
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x1c]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x1c]
push ecx
push eax
push ebp
mov ebp, dword [esp + 0x24]
push edx
push ebp
call fcn.00402730
add esp, 0x14
test eax, eax
jne 0x401a43
mov eax, dword [esp + 0x14]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push ebp
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push edi
call sub.MSVCRT.dll_fclose
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ecx, dword [esp + 0x1c]
push edi
push eax
push 1
push ecx
call sub.MSVCRT.dll_fwrite
mov edx, dword [esp + 0x2c]
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [0x405248]
add esp, 0x14
test eax, eax
je 0x401a93
mov ebp, dword [ebx + 0xc8]
push ebx
call fcn.00402560
add ebp, 0xdc
push edi
push ebp
lea eax, [ebx - 0x10]
push 1
push eax
call sub.MSVCRT.dll_fwrite
push ebx
call fcn.00402590
mov ebp, dword [esp + 0x30]
add esp, 0x18
mov ebx, dword [esi + 0xc8]
push esi
call fcn.00402560
add ebx, 0xdc
push edi
push ebx
lea ecx, [esi - 0x10]
push 1
push ecx
call sub.MSVCRT.dll_fwrite
push esi
call fcn.00402590
mov edx, dword [esp + 0x3c]
push 0x5c
push edx
call sub.MSVCRT.dll_strrchr
add esp, 0x20
test eax, eax
jne 0x401adc
push ebp
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
push edi
push ecx
inc eax
push esi
push eax
push 0x405020
call fcn.00401810
add esp, 0x14
test eax, eax
jne 0x401b03
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
push ebp
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push edi
call sub.MSVCRT.dll_fclose
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret