Function at 0x412120
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x38
mov ebx, dword [ebp + 0xc]
mov esi, ecx
test ebx, ebx
je 0x41214a
push edx
call sub.KERNEL32.dll_GetStdHandle
test eax, eax
je 0x412156
mov edi, eax
cmp eax, 0xffffffff
jne 0x412169
call sub.KERNEL32.dll_GetLastError
jmp 0x41215b
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x412161
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
add esp, 0x38
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x2c], 0
lea eax, [ebp - 0x2c]
push eax
push edi
call sub.KERNEL32.dll_GetConsoleMode
test eax, eax
je 0x4121da
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ecx + 4]
test eax, eax
je 0x412228
mov ebx, ecx
mov ecx, dword [ebp + 8]
cmp al, 3
ja 0x41238d
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x41227a
mov byte [ebx + eax], cl
mov edx, ebx
movzx ecx, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx ebx, byte [eax + 0x8f1854]
cmp cl, bl
mov dword [ebp - 0x44], ebx
jae 0x412295
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x412161
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0x103
lea eax, [ebp - 0x14]
push 0
push 0
push ebx
push dword [ebp + 8]
push eax
push 0
push 0
push 0
push edi
call sub.ntdll.dll_NtWriteFile
cmp eax, 0x103
jne 0x41221d
push 0xffffffffffffffff
push edi
call sub.KERNEL32.dll_WaitForSingleObject
mov eax, dword [ebp - 0x14]
cmp eax, 0x103
je 0x4123bf
test eax, eax
js 0x412280
mov eax, dword [ebp - 0x10]
mov bl, 4
jmp 0x412288
cmp ebx, 0x1000
mov eax, 0x1000
cmovb eax, ebx
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x38]
push eax
call fcn.00404d20
add esp, 4
cmp dword [ebp - 0x38], 0
je 0x4122c9
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x4122e2
mov edx, dword [ebp + 8]
cmp eax, ebx
ja 0x412420
lea ebx, [ebp - 0x2c]
mov ecx, ebx
push eax
call fcn.00404d20
add esp, 4
mov ecx, ebx
call fcn.00412f20
mov ebx, edx
jmp 0x4122cf
mov byte [ebx + 4], 0
jmp 0x4122ba
xor ebx, ebx
push eax
call sub.ntdll.dll_RtlNtStatusToDosError
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x412161
movzx eax, cl
cmp cl, 5
jae 0x412412
lea ecx, [ebp - 0x38]
push eax
call fcn.00404d20
add esp, 4
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x38], 0
mov byte [eax + 4], 0
je 0x412311
mov byte [esi], 2
mov dword [esi + 4], 0x8f19a4
jmp 0x412161
mov eax, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x30]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.00412b60
add esp, 8
jmp 0x412161
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x8f1854]
cmp ecx, 2
jb 0x412361
cmp ecx, ebx
jbe 0x412361
mov ecx, dword [ebp + 0x10]
mov dword [esi + 4], 1
mov byte [ecx], al
mov byte [ecx + 4], 1
mov cl, 4
mov byte [esi], cl
jmp 0x412161
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
cmp ecx, ebx
mov dword [ebp - 0x14], ecx
jne 0x412433
lea ecx, [ebp - 0x2c]
mov edx, edi
push ebx
push eax
call fcn.00412b60
add esp, 8
movzx eax, byte [ebp - 0x2c]
cmp al, 4
jne 0x412371
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x14], ebx
cmp eax, ebx
mov dword [ebp - 0x40], eax
je 0x4121ce
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x40]
lea edx, [ebp - 0x14]
push 0x8f19e0
jmp 0x412445
mov al, 2
mov dword [esi + 4], 0x8f19a4
mov byte [esi], al
jmp 0x412161
movzx ecx, byte [ebp - 0x29]
movzx edi, word [ebp - 0x2b]
mov edx, dword [ebp - 0x28]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x412161
mov dword [ebp - 0x2c], str.Unexpected_number_of_bytes_for_incomplete_UTF_8_codepoint.
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x24], str.called__Option::unwrap____on_a__None__value_rustc_d5c2e9c342b358556da91d61ed4133f6f50fc0c3library_alloc_srccollections_btree_navigate.rsIndex_out_of_bounds
mov dword [ebp - 0x20], 0
lea ecx, [ebp - 0x2c]
mov edx, 0x8f1a44
call fcn.00403c40
ud2
lea eax, [ebp - 0x44]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x2c], 0x8f1784
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x1c], 0
mov byte [ebp - 0x3c], 0
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], 0
lea edx, [ebp - 0x40]
lea eax, [ebp - 0x2c]
lea ecx, [ebp - 0x38]
push eax
call fcn.004105e0
add esp, 4
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
call fcn.004106e0
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x8f19d0
jmp 0x412429
mov ecx, eax
mov edx, ebx
push 0x8f19b0
call fcn.00404320
add esp, 4
ud2
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x44]
lea edx, [ebp - 0x14]
push 0x8f19f0
lea eax, [ebp - 0x2c]
push eax
call fcn.004117b0
add esp, 8
ud2