Function at 0x10011850
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x30
mov ebp, dword [esp + 0x44]
mov esi, ecx
test ebp, ebp
je 0x1001187e
mov ebx, edx
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x1001188d
mov edi, eax
cmp eax, 0xffffffff
jne 0x100118aa
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x10011892
mov dword [esi + 4], 0
mov dword [esi], 0
jmp 0x100118a2
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 eax, [esp + 0x10]
mov dword [esp + 0x10], 0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x10011919
mov eax, dword [esp + 0x48]
movzx eax, byte [eax + 4]
test eax, eax
je 0x10011947
cmp al, 4
jae 0x10011aa5
mov cl, byte [ebx]
mov ebp, dword [esp + 0x48]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x1001199e
mov byte [ebp + eax], cl
mov cl, byte [ebp + 4]
inc cl
mov byte [ebp + 4], cl
movzx eax, byte [ebp]
movzx ebx, byte [eax + 0x10050570]
cmp bl, cl
mov dword [esp + 0x28], ebx
jbe 0x100119ea
mov dword [esi + 4], 1
jmp 0x10011885
test edi, edi
je 0x10011abe
mov dword [esp + 0x10], 0
push 0
lea eax, [esp + 0x14]
push eax
push ebp
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100119b5
mov ecx, dword [esp + 0x10]
xor eax, eax
xor edx, edx
jmp 0x100119c2
cmp ebp, 0x1000
mov eax, 0x1000
lea ecx, [esp + 4]
mov edx, ebx
cmovb eax, ebp
push eax
call fcn.100032b0
add esp, 4
cmp dword [esp + 4], 1
jne 0x100119cf
cmp dword [esp + 8], 0
je 0x10011a49
mov eax, dword [esp + 8]
cmp eax, ebp
ja 0x10011ae5
lea ebp, [esp + 0x10]
mov edx, ebx
mov ecx, ebp
push eax
call fcn.100032b0
add esp, 4
mov ecx, ebp
call fcn.10012390
mov ebx, edx
jmp 0x100119d7
mov byte [ebp + 4], 0
mov dword [esi + 8], str.Windows_stdio_in_console_mode_does_not_support_writing_non_UTF_8_byte_sequences
mov dword [esi + 4], 0x1502
jmp 0x1001189c
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 0x100118a2
mov eax, dword [esp + 8]
mov ebx, dword [esp + 0xc]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.100120d0
add esp, 8
jmp 0x100118a2
movzx eax, cl
cmp cl, 5
jae 0x10011ad7
lea ecx, [esp + 4]
mov edx, ebp
push eax
call fcn.100032b0
add esp, 4
cmp dword [esp + 4], 1
mov byte [ebp + 4], 0
je 0x100119a2
mov ecx, dword [esp + 0xc]
mov eax, dword [esp + 8]
cmp ecx, ebx
mov dword [esp], ecx
jne 0x10011af8
lea ebp, [esp + 0x10]
mov edx, edi
mov ecx, ebp
push ebx
push eax
call fcn.100120d0
add esp, 8
cmp dword [esp + 0x10], 1
jne 0x10011a68
movsd xmm0, qword [esp + 0x14]
movsd qword [esi + 4], xmm0
jmp 0x10011a99
movzx eax, byte [ebx]
movzx ecx, byte [eax + 0x10050570]
cmp ecx, 2
jb 0x10011a8b
cmp ecx, ebp
jbe 0x10011a8b
mov ecx, dword [esp + 0x48]
mov byte [ecx], al
mov byte [ecx + 4], 1
jmp 0x10011a7b
mov eax, dword [esp + 0x14]
mov dword [esp], ebx
cmp eax, ebx
mov dword [esp + 0x2c], eax
jne 0x10011b12
xor eax, eax
mov dword [esi + 4], 1
mov dword [esi], eax
jmp 0x100118a2
mov dword [esi + 8], str.Windows_stdio_in_console_mode_does_not_support_writing_non_UTF_8_byte_sequences
mov dword [esi + 4], 0x1502
mov eax, 1
mov dword [esi], eax
jmp 0x100118a2
mov ecx, str.Unexpected_number_of_bytes_for_incomplete_UTF_8_codepoint.C:zmfbwgycsjdghsdluwsaeevjrnqidzankjmrsblmvqvxwcuyzqvhdwwftmfjbeorylhufaqthathotvsyidawtgtrjxkkrxouvepcwhueopxbkjrlxdlcgkrgdnlqxev
mov edx, 0x3a
push 0x1005186c
call fcn.1002a1a0
add esp, 4
ud2
mov ecx, 0x10050bba
mov edx, 0x23
push 0x10050c64
call fcn.10029ce0
add esp, 4
ud2
mov ecx, eax
mov edx, 4
push 0x100518d4
jmp 0x10011aee
mov ecx, eax
mov edx, ebp
push 0x10051904
call fcn.10029c70
add esp, 4
ud2
lea ecx, [esp + 0x28]
mov edx, esp
mov dword [esp + 0x10], 0
push 0x100518e4
lea eax, [esp + 0x14]
push eax
jmp 0x10011b26
lea ecx, [esp + 0x2c]
mov edx, esp
mov dword [esp + 0x10], 0
push 0x100518f4
push ebp
call fcn.1002a2b0
add esp, 8
ud2