Function at 0x4018c0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x1c
lea eax, [esp]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x2c]
push edi
push eax
push esi
call fcn.00402f20
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x40198b
cmp byte [ebx], 0x4d
jne 0x401982
cmp byte [ebx + 1], 0x5a
jne 0x401982
mov ecx, dword [esp + 0x10]
push ecx
push ebx
push 0x405030
push 0x405010
call fcn.004011b0
add esp, 0x10
test eax, eax
jne 0x401982
mov edx, dword [0x405020]
mov eax, dword [0x405024]
mov ecx, dword [str.sourytlx]
mov dword [esp + 0x1c], edx
mov edx, dword [0x40502c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
xor eax, eax
mov byte [esp + eax + 0x1c], al
inc eax
cmp eax, 8
jl 0x40193b
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x1c]
push eax
push ebx
push 0x405030
push ecx
call fcn.004011b0
add esp, 0x10
test eax, eax
je 0x401993
push eax
push esi
call fcn.00402660
add esp, 8
test eax, eax
je 0x401982
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
push edx
push eax
push esi
call fcn.004018c0
add esp, 0xc
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret
mov ecx, dword [esp + 0x10]
push ecx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x14]
mov ebp, eax
mov edx, ecx
xor eax, eax
mov edi, ebp
push ebp
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov dword [esp + 0x1c], ebp
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x18]
push eax
push ebx
call fcn.00402e10
push 0x40531c
push esi
call sub.MSVCRT.dll_fopen
mov edi, eax
add esp, 0x18
test edi, edi
jne 0x4019f0
push ebp
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, 0x1c
ret
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x34]
push ecx
push edx
push 0x405030
push 0x405010
call fcn.004011b0
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x401a29
push ebp
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, 0x1c
ret
mov eax, dword [0x40527c]
test eax, eax
je 0x401a58
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
push eax
push ecx
push 0
push 0x405030
call fcn.004011b0
mov ebp, eax
add esp, 0x10
test ebp, ebp
jne 0x401a5c
mov dword [0x40527c], eax
jmp 0x401a5c
mov ebp, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
push edx
push eax
call fcn.00401d30
add esp, 8
cmp eax, 0xffffffff
jne 0x401a8e
mov ecx, dword [esp + 0x14]
push ecx
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, 0x1c
ret
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x18]
push edx
push eax
mov eax, dword [esp + 0x3c]
push eax
push ecx
push ebx
call fcn.00402860
add esp, 0x14
test eax, eax
jne 0x401acc
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__
push edi
call sub.MSVCRT.dll_fclose
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret
push edi
push eax
mov eax, dword [esp + 0x20]
push 1
push eax
call sub.MSVCRT.dll_fwrite
mov ecx, dword [esp + 0x28]
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [0x40527c]
add esp, 0x14
test eax, eax
je 0x401b1f
mov edx, dword [ebp + 0xc8]
push ebp
mov dword [esp + 0x38], edx
call fcn.00402600
mov eax, dword [esp + 0x38]
push edi
add eax, 0xdc
lea ecx, [ebp - 0x10]
push eax
push 1
push ecx
call sub.MSVCRT.dll_fwrite
push ebp
call fcn.00402630
add esp, 0x18
mov ebp, dword [esi + 0xc8]
push esi
call fcn.00402600
add ebp, 0xdc
push edi
push ebp
lea edx, [esi - 0x10]
push 1
push edx
call sub.MSVCRT.dll_fwrite
push esi
call fcn.00402630
mov eax, dword [esp + 0x48]
push 0x5c
push eax
call sub.MSVCRT.dll_strrchr
add esp, 0x20
test eax, eax
je 0x401982
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
push edi
push ecx
inc eax
push esi
push eax
push 0x405020
call fcn.00401820
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push edi
call sub.MSVCRT.dll_fclose
add esp, 0x20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret