Function at 0x403160
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x466078]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov dword [ebp - 0x2c], ecx
call fcn.00403f50
mov dword [ebp - 0x44], eax
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x44]
push ecx
call fcn.00403fb0
add esp, 8
movzx edx, al
test edx, edx
je 0x4031a5
lea eax, [ebp + 8]
push eax
call fcn.00403f60
add esp, 4
jmp 0x403328
mov ecx, dword [ebp - 0x2c]
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
test eax, eax
je 0x4031eb
mov ecx, dword [ebp - 0x2c]
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
mov esi, eax
mov ecx, dword [ebp - 0x2c]
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::epptr_void_const]
cmp esi, eax
jae 0x4031eb
lea ecx, [ebp + 8]
push ecx
call fcn.00403340
add esp, 4
mov bl, al
mov ecx, dword [ebp - 0x2c]
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::_Pninc_void_]
mov byte [eax], bl
mov eax, dword [ebp + 8]
jmp 0x403328
mov edx, dword [ebp - 0x2c]
cmp dword [edx + 0x4c], 0
jne 0x4031fe
call fcn.00403f50
jmp 0x403328
mov ecx, dword [ebp - 0x2c]
call fcn.00403820
mov eax, dword [ebp - 0x2c]
cmp dword [eax + 0x38], 0
jne 0x40324d
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ecx + 0x4c]
push edx
lea eax, [ebp + 8]
push eax
call fcn.00403340
add esp, 4
movzx ecx, al
push ecx
call fcn.004021d0
add esp, 8
movzx edx, al
test edx, edx
je 0x40323d
mov eax, dword [ebp + 8]
mov dword [ebp - 0x3c], eax
jmp 0x403245
call fcn.00403f50
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x3c]
jmp 0x403328
mov dword [ebp - 0x50], 0x20
lea ecx, [ebp + 8]
push ecx
call fcn.00403340
add esp, 4
mov byte [ebp - 0x2e], al
lea edx, [ebp - 0x48]
push edx
lea eax, [ebp - 8]
push eax
lea ecx, [ebp - 0x28]
push ecx
lea edx, [ebp - 0x4c]
push edx
lea eax, [ebp - 0x2d]
push eax
lea ecx, [ebp - 0x2e]
push ecx
mov edx, dword [ebp - 0x2c]
add edx, 0x40
push edx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax + 0x38]
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::codecvt_char__char__struct__Mbstatet_::out_struct__Mbstatet___char_const___char_const___char_const____char___char___char___const]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
je 0x4032a5
cmp dword [ebp - 0x34], 1
je 0x4032a5
cmp dword [ebp - 0x34], 3
je 0x4032f3
jmp 0x403323
mov ecx, dword [ebp - 0x48]
lea edx, [ebp - 0x28]
sub ecx, edx
mov dword [ebp - 0x38], ecx
je 0x4032d8
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax + 0x4c]
push ecx
mov edx, dword [ebp - 0x38]
push edx
push 1
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp dword [ebp - 0x38], eax
je 0x4032d8
call fcn.00403f50
jmp 0x403328
mov ecx, dword [ebp - 0x2c]
mov byte [ecx + 0x3d], 1
lea edx, [ebp - 0x2e]
cmp dword [ebp - 0x4c], edx
je 0x4032ec
mov eax, dword [ebp + 8]
jmp 0x403328
call fcn.00403f50
jmp 0x403328
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax + 0x4c]
push ecx
movzx edx, byte [ebp - 0x2e]
push edx
call fcn.004021d0
add esp, 8
movzx eax, al
test eax, eax
je 0x403316
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x40], ecx
jmp 0x40331e
call fcn.00403f50
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
jmp 0x403328
call fcn.00403f50
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00404ba4
mov esp, ebp
pop ebp
ret 4