Function at 0x411170
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x30
mov ebx, dword [esp + 0x48]
mov esi, ecx
test ebx, ebx
je 0x41119b
push edx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x4111aa
mov edi, eax
cmp eax, 0xffffffff
jne 0x4111c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4111af
mov dword [esi + 4], 0
mov dword [esi], 0
jmp 0x4111bf
mov eax, 6
mov dword [esi + 4], 0
mov dword [esi + 8], eax
mov dword [esi], 1
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
lea ebp, [esp + 0x18]
mov dword [esp + 0x18], 0
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x41123b
mov eax, dword [esp + 0x4c]
mov ebp, dword [esp + 0x44]
movzx eax, byte [eax + 4]
test eax, eax
je 0x411260
cmp al, 4
jae 0x4113cb
mov cl, byte [ebp]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x4112b5
mov ebp, dword [esp + 0x4c]
mov byte [ebp + eax], cl
mov al, byte [ebp + 4]
inc al
mov byte [ebp + 4], al
movzx ecx, byte [ebp]
movzx ebx, byte [ecx + 0x42d808]
cmp bl, al
mov dword [esp + 0x10], ebx
jbe 0x411305
mov dword [esi + 4], 1
jmp 0x4111a2
mov dword [esp + 0x18], 0
push 0
push ebp
push ebx
push dword [esp + 0x50]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4112d0
mov ecx, dword [esp + 0x18]
xor eax, eax
xor edx, edx
jmp 0x4112dd
cmp ebx, 0x1000
mov eax, 0x1000
lea ecx, [esp + 4]
cmovb eax, ebx
push eax
push ebp
push ecx
call fcn.0041c210
add esp, 0xc
cmp dword [esp + 4], 1
jne 0x4112ea
cmp dword [esp + 8], 0
je 0x411372
mov eax, dword [esp + 8]
cmp eax, ebx
ja 0x4113e4
push eax
push ebp
lea ebx, [esp + 0x20]
push ebx
call fcn.0041c210
add esp, 0xc
mov ecx, ebx
call fcn.00408940
mov ebx, edx
jmp 0x4112f2
mov eax, dword [esp + 0x4c]
mov byte [eax + 4], 0
mov dword [esi + 8], 0x42ef24
mov dword [esi + 4], 0x1502
jmp 0x4111b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
mov edx, 1
mov dword [esi], edx
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
jmp 0x4111bf
mov eax, dword [esp + 8]
mov ebx, dword [esp + 0xc]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.00411430
add esp, 8
jmp 0x4111bf
movzx eax, al
mov ecx, ebp
mov edx, 4
push 0x42ef2c
push eax
push 0
call fcn.004088c0
add esp, 0xc
lea ecx, [esp + 4]
push edx
push eax
push ecx
call fcn.0041c210
add esp, 0xc
cmp dword [esp + 4], 1
mov byte [ebp + 4], 0
je 0x4112bd
mov ecx, dword [esp + 0xc]
mov eax, dword [esp + 8]
cmp ecx, ebx
mov dword [esp], ecx
jne 0x4113f5
lea ebp, [esp + 0x18]
mov edx, edi
mov ecx, ebp
push ebx
push eax
call fcn.00411430
add esp, 8
cmp dword [esp + 0x18], 1
jne 0x411392
movsd xmm0, qword [esp + 0x1c]
movsd qword [esi + 4], xmm0
jmp 0x4113bf
movzx eax, byte [ebp]
movzx ecx, byte [eax + 0x42d808]
cmp ecx, 2
jb 0x4113b1
cmp ecx, ebx
jbe 0x4113b1
mov ecx, dword [esp + 0x4c]
mov byte [ecx], al
mov byte [ecx + 4], 1
jmp 0x4113a1
mov eax, dword [esp + 0x1c]
mov dword [esp], ebx
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x41140f
xor eax, eax
mov dword [esi + 4], 1
mov dword [esi], eax
jmp 0x4111bf
mov dword [esi + 8], 0x42ef24
mov dword [esi + 4], 0x1502
mov eax, 1
mov dword [esi], eax
jmp 0x4111bf
mov ecx, str.Unexpected_number_of_bytes_for_incomplete_UTF_8_codepoint.library_std_src_syswindows_stdio.rs
mov edx, 0x3a
push 0x42eec4
call fcn.0042c7a0
add esp, 4
ud2
push 0x42ef5c
push ebx
push eax
call fcn.0042cac0
add esp, 0xc
ud2
lea ecx, [esp + 0x10]
mov edx, esp
mov dword [esp + 0x18], 0
push 0x42ef3c
lea eax, [esp + 0x1c]
push eax
jmp 0x411423
lea ecx, [esp + 0x14]
mov edx, esp
mov dword [esp + 0x18], 0
push 0x42ef4c
push ebp
call fcn.0042c110
add esp, 8
ud2