Function at 0x412f70
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x190
mov eax, dword [0x456d10]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x457dc4]
push ebx
mov ebx, dword [0x45a93c]
push esi
push edi
xor edi, edi
mov word [ebp - 0x170], cx
xor esi, esi
mov dword [ebp - 0x190], edi
cmp byte [0x45a54e], 0
jne 0x412fb8
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
mov cx, word [ebp - 0x170]
test bl, 4
je 0x41323f
cmp byte [ebp + 0xc], 0
je 0x41323f
cmp cx, 2
je 0x41323f
cmp cx, 1
je 0x41323f
cmp cx, 8
je 0x413135
cmp cx, 0xd
je 0x413135
cmp cx, 0xa
je 0x413135
cmp cx, 3
je 0x413135
push 0
push 0
push 0x104
lea ecx, [ebp - 0x108]
push ecx
push 1
lea ecx, [ebp - 0x170]
push ecx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp byte [ebp + 0x10], 0
mov esi, eax
je 0x41308e
cmp esi, 0x104
jae 0x413252
lea eax, [ebp - 0x108]
mov byte [ebp + esi - 0x108], 0
push eax
lea eax, [ebp - 0x16c]
push 0x64
push eax
call fcn.00427b16
lea eax, [ebp - 0x16c]
push eax
push str._s__r
lea eax, [ebp - 0x108]
push 0x104
push eax
call fcn.004268c3
lea ecx, [ebp - 0x108]
add esp, 0x1c
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x413083
sub ecx, edx
add esi, ecx
xor ebx, ebx
push esi
push str.EchoBufLen___d_n
push 2
call fcn.0041a380
add esp, 0xc
test esi, esi
je 0x413239
cmp dword [0x47b504], edi
je 0x4131e7
lea ebx, [esi + 0x2c]
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
test edi, edi
je 0x413239
push ebx
push 0
push edi
call fcn.0042bf20
xor eax, eax
mov dword [edi + 4], ebx
mov word [edi], ax
lea eax, [ebp - 0x108]
push esi
push eax
lea eax, [edi + 0x20]
mov dword [edi + 0x18], esi
push eax
call fcn.0042a7d0
add esp, 0x18
lea eax, [ebp - 0x174]
push 0
push eax
push dword [edi + 4]
push edi
push dword [0x47b504]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4131cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Echo_WriteFile_failed_with__d_n
push 2
call fcn.0041a380
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x413239
test bl, 2
je 0x41308e
test bl, 1
je 0x41308e
push dword [0x47bacc]
movzx eax, cx
push eax
push str.Handle_echo_of_special_char__0x_02x__charinaline___d_n
push 2
call fcn.0041a380
add esp, 0x10
cmp word [ebp - 0x170], 8
jne 0x4131a4
lea eax, [ebp - 0x18c]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
mov ax, word [0x47b994]
cmp ax, word [ebp - 0x188]
je 0x4131a4
mov word [ebp - 0x108], 0x2008
mov esi, 3
mov byte [ebp - 0x106], 8
cmp word [ebp - 0x170], 0xd
jne 0x41308e
mov ebx, 1
mov word [ebp + esi - 0x108], 0xa0d
add esi, 2
mov dword [ebp - 0x190], ebx
jmp 0x413090
push str.Echo_WriteFile_succeeded_n
push 2
call fcn.0041a380
add esp, 8
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x413239
xor edi, edi
test esi, esi
jle 0x413223
lea ecx, [ecx]
mov ecx, dword [0x45af98]
mov al, byte [ebp + edi - 0x108]
mov byte [ecx], al
inc ecx
movzx eax, byte [ebp + edi - 0x108]
push eax
push str.Echo_char__c_n
push 2
mov dword [0x45af98], ecx
call fcn.0041a380
inc edi
add esp, 0xc
cmp edi, esi
jl 0x4131f0
test ebx, ebx
je 0x413239
or ecx, 0xffffffff
call fcn.00412710
call fcn.00414fb0
call fcn.00412780
mov edi, dword [ebp - 0x190]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004265fb
mov esp, ebp
pop ebp
ret
call fcn.00428745
int3