Function at 0x412110
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 0x41213a
push edx
call sub.KERNEL32.dll_GetStdHandle
test eax, eax
je 0x412146
mov edi, eax
cmp eax, 0xffffffff
jne 0x412159
call sub.KERNEL32.dll_GetLastError
jmp 0x41214b
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x412151
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 0x4121ca
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ecx + 4]
test eax, eax
je 0x412218
mov ebx, ecx
mov ecx, dword [ebp + 8]
cmp al, 3
ja 0x41237d
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x41226a
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 + 0x7f5c54]
cmp cl, bl
mov dword [ebp - 0x44], ebx
jae 0x412285
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x412151
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 0x41220d
push 0xffffffffffffffff
push edi
call sub.KERNEL32.dll_WaitForSingleObject
mov eax, dword [ebp - 0x14]
cmp eax, 0x103
je 0x4123af
test eax, eax
js 0x412270
mov eax, dword [ebp - 0x10]
mov bl, 4
jmp 0x412278
cmp ebx, 0x1000
mov eax, 0x1000
cmovb eax, ebx
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x38]
push eax
call fcn.00404d10
add esp, 4
cmp dword [ebp - 0x38], 0
je 0x4122b9
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x4122d2
mov edx, dword [ebp + 8]
cmp eax, ebx
ja 0x412410
lea ebx, [ebp - 0x2c]
mov ecx, ebx
push eax
call fcn.00404d10
add esp, 4
mov ecx, ebx
call fcn.00412f10
mov ebx, edx
jmp 0x4122bf
mov byte [ebx + 4], 0
jmp 0x4122aa
xor ebx, ebx
push eax
call sub.ntdll.dll_RtlNtStatusToDosError
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x412151
movzx eax, cl
cmp cl, 5
jae 0x412402
lea ecx, [ebp - 0x38]
push eax
call fcn.00404d10
add esp, 4
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x38], 0
mov byte [eax + 4], 0
je 0x412301
mov byte [esi], 2
mov dword [esi + 4], 0x7f5da4
jmp 0x412151
mov eax, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x30]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.00412b50
add esp, 8
jmp 0x412151
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x7f5c54]
cmp ecx, 2
jb 0x412351
cmp ecx, ebx
jbe 0x412351
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 0x412151
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
cmp ecx, ebx
mov dword [ebp - 0x14], ecx
jne 0x412423
lea ecx, [ebp - 0x2c]
mov edx, edi
push ebx
push eax
call fcn.00412b50
add esp, 8
movzx eax, byte [ebp - 0x2c]
cmp al, 4
jne 0x412361
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x14], ebx
cmp eax, ebx
mov dword [ebp - 0x40], eax
je 0x4121be
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x40]
lea edx, [ebp - 0x14]
push 0x7f5de0
jmp 0x412435
mov al, 2
mov dword [esi + 4], 0x7f5da4
mov byte [esi], al
jmp 0x412151
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 0x412151
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, 0x7f5e44
call fcn.00403c30
ud2
lea eax, [ebp - 0x44]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x2c], 0x7f5b84
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.004105d0
add esp, 4
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
call fcn.004106d0
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x7f5dd0
jmp 0x412419
mov ecx, eax
mov edx, ebx
push 0x7f5db0
call fcn.00404310
add esp, 4
ud2
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x44]
lea edx, [ebp - 0x14]
push 0x7f5df0
lea eax, [ebp - 0x2c]
push eax
call fcn.004117a0
add esp, 8
ud2