Function at 0x4059c0
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x130
mov eax, dword [0x40e004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
mov eax, 0x2f
mov dword [ebp - 0x130], esi
push edi
mov dword [ebp - 0x12c], eax
mov esi, dword [esi]
mov dword [ebp - 0x128], 0x80
cmp dword [ebp + 0xc], ebx
je 0x408533
mov edi, dword [esi]
test edi, 0x100
je 0x405a18
mov ebx, 1
and edi, 0xfffffeff
mov dword [ebp - 0x124], ecx
test edx, edx
jne 0x40854d
mov dword [ebp - 0x120], 0x4012ec
push 0x10
lea eax, [ebp - 0x1c]
push eax
push dword [esi]
call dword [sym.imp.msvcrt.dll__ultow]
add esp, 0xc
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x11c], eax
cmp edi, 0x10
jne 0x408565
mov dword [ebp - 0x118], 0x4012c4
test ebx, ebx
je 0x408646
mov dword [ebp - 0x114], 0x4012a8
push 0x10
lea eax, [ebp - 0x34]
push eax
push dword [esi + 4]
call dword [sym.imp.msvcrt.dll__ultow]
lea eax, [ebp - 0x34]
add esp, 0xc
mov dword [ebp - 0x110], eax
mov eax, dword [esi + 4]
cmp eax, 4
jne 0x408655
mov dword [ebp - 0x10c], 0x401294
cmp dword [esi + 4], 1
je 0x4086e9
test byte [esi + 8], 1
je 0x4086cb
mov eax, 0x401280
mov dword [ebp - 0x108], eax
test byte [esi + 8], 2
jne 0x4086d5
mov eax, 0x401264
mov dword [ebp - 0x104], eax
test byte [esi + 8], 4
jne 0x4086df
mov eax, 0x401240
mov dword [ebp - 0x100], eax
test dword [esi + 8], 0x100
je 0x405af7
mov eax, 0x401218
mov edi, dword [ebp - 0x12c]
mov dword [ebp - 0x100], eax
push 0xa
lea eax, [ebp - 0x4c]
push eax
push dword [esi + 0xc]
call dword [sym.imp.msvcrt.dll__ultow]
lea eax, [ebp - 0x4c]
mov dword [ebp - 0xfc], eax
lea eax, [ebp - 0x64]
push 0x10
push eax
push dword [esi + 0xc]
call dword [sym.imp.msvcrt.dll__ultow]
lea eax, [ebp - 0x64]
mov dword [ebp - 0xf8], eax
lea eax, [ebp - 0x7c]
push 0xa
push eax
push dword [esi + 0x10]
call dword [sym.imp.msvcrt.dll__ultow]
lea eax, [ebp - 0x7c]
mov dword [ebp - 0xf4], eax
lea eax, [ebp - 0x94]
push 0x10
push eax
push dword [esi + 0x10]
call dword [sym.imp.msvcrt.dll__ultow]
lea eax, [ebp - 0x94]
mov dword [ebp - 0xf0], eax
lea eax, [ebp - 0xac]
push 0x10
push eax
push dword [esi + 0x14]
call dword [sym.imp.msvcrt.dll__ultow]
lea eax, [ebp - 0xac]
mov dword [ebp - 0xec], eax
lea eax, [ebp - 0xc4]
push 0x10
push eax
push dword [esi + 0x18]
call dword [sym.imp.msvcrt.dll__ultow]
add esp, 0x48
lea eax, [ebp - 0xc4]
cmp dword [ebp + 0xc], 0
mov dword [ebp - 0xe8], eax
je 0x4086f4
lea eax, [ebp - 0x124]
push eax
push 2
lea eax, [ebp - 0x12c]
push eax
push 0
push edi
push 0
push 0x2900
call dword [sym.imp.api_ms_win_core_localization_l1_2_0.dll_FormatMessageW]
test eax, eax
je 0x405c67
mov esi, dword [0x40ebc0]
mov edi, dword [ebp - 0x12c]
push esi
mov dword [ebp - 0x128], eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileType]
and eax, 0xffff7fff
cmp eax, 2
je 0x40873a
mov eax, dword [ebp - 0x128]
add eax, eax
push eax
push 0
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x405c5b
mov edx, dword [ebp - 0x128]
push 0
push 0
lea ecx, [edx + edx]
push ecx
push esi
push edx
push edi
push 0
push 1
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
mov dword [ebp - 0x128], eax
test eax, eax
je 0x405c54
push 0
lea ecx, [ebp - 0x128]
push ecx
push eax
push esi
push dword [0x40ebc0]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
push esi
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
push dword [ebp - 0x12c]
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00405f50
mov esp, ebp
pop ebp
ret 8
mov eax, 0x31
mov dword [ebp - 0x128], 0x82
mov dword [ebp - 0x12c], eax
jmp 0x405a03
inc eax
mov dword [ebp - 0x120], edx
inc dword [ebp - 0x128]
mov dword [ebp - 0x12c], eax
jmp 0x405a30
cmp edi, 0x210
ja case.0x40858b.3
je 0x408628
dec edi
cmp edi, 0xdf
ja case.0x40858b.3
movzx eax, byte [edi + 0x40879f]
jmp dword [eax*4 + 0x408773]
mov dword [ebp - 0x118], 0x4048a8
jmp 0x405a5d
mov dword [ebp - 0x118], 0x4048d4
jmp 0x405a5d
mov dword [ebp - 0x118], 0x40490c
jmp 0x405a5d
mov dword [ebp - 0x118], 0x404948
jmp 0x405a5d
mov dword [ebp - 0x118], 0x404980
jmp 0x405a5d
mov dword [ebp - 0x118], 0x4049bc
jmp 0x405a5d
mov dword [ebp - 0x118], 0x4049cc
jmp 0x405a5d
mov dword [ebp - 0x118], 0x4049e0
jmp 0x405a5d
mov dword [ebp - 0x118], 0x404a00
jmp 0x405a5d
mov dword [ebp - 0x118], 0x404a28
jmp 0x405a5d
mov dword [ebp - 0x118], 0x404a38
jmp 0x405a5d
mov dword [ebp - 0x118], 0x404a68
jmp 0x405a5d
mov dword [ebp - 0x114], 0x4012ec
jmp 0x405a6f
dec eax
cmp eax, 6
ja case.0x40865b.4
jmp dword [eax*4 + 0x40887f]
mov dword [ebp - 0x10c], 0x404a78
jmp 0x405aa0
mov dword [ebp - 0x10c], 0x404a8c
jmp 0x405aa0
mov dword [ebp - 0x10c], 0x404aac
jmp 0x405aa0
mov dword [ebp - 0x10c], 0x404ac8
jmp 0x405aa0
mov dword [ebp - 0x10c], 0x404aec
jmp 0x405aa0
mov dword [ebp - 0x10c], 0x404b0c
jmp 0x405aa0
mov dword [ebp - 0x10c], 0x404a68
jmp 0x405aa0
mov eax, 0x404b1c
jmp 0x405ab9
mov eax, 0x404b38
jmp 0x405ace
mov eax, 0x404b4c
jmp 0x405ae3
mov edi, dword [ebp - 0x128]
jmp 0x405b03
mov esi, dword [ebp - 0x130]
lea eax, [ebp - 0xdc]
push 0xa
push eax
mov eax, dword [esi]
push dword [eax + 0x1c]
call dword [sym.imp.msvcrt.dll__ultow]
lea eax, [ebp - 0xdc]
add esp, 0xc
mov dword [ebp - 0xe4], eax
mov eax, dword [esi]
test byte [eax + 0x20], 1
mov eax, 0x404b70
jne 0x40872f
mov eax, 0x4012ec
mov dword [ebp - 0xe0], eax
jmp 0x405bb2
lea eax, [ebp - 0x130]
push eax
push esi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_GetConsoleMode]
test eax, eax
je 0x405c01
push 0
lea eax, [ebp - 0x128]
push eax
push dword [ebp - 0x128]
push edi
push dword [0x40ebc0]
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
jmp 0x405c5b