Function at 0x412100
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 0x41212a
push edx
call sub.KERNEL32.dll_GetStdHandle
test eax, eax
je 0x412136
mov edi, eax
cmp eax, 0xffffffff
jne 0x412149
call sub.KERNEL32.dll_GetLastError
jmp 0x41213b
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x412141
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 0x4121ba
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ecx + 4]
test eax, eax
je 0x412208
mov ebx, ecx
mov ecx, dword [ebp + 8]
cmp al, 3
ja 0x41236d
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x41225a
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 + 0x7f4a54]
cmp cl, bl
mov dword [ebp - 0x44], ebx
jae 0x412275
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x412141
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 0x4121fd
push 0xffffffffffffffff
push edi
call sub.KERNEL32.dll_WaitForSingleObject
mov eax, dword [ebp - 0x14]
cmp eax, 0x103
je 0x41239f
test eax, eax
js 0x412260
mov eax, dword [ebp - 0x10]
mov bl, 4
jmp 0x412268
cmp ebx, 0x1000
mov eax, 0x1000
cmovb eax, ebx
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x38]
push eax
call fcn.00404d00
add esp, 4
cmp dword [ebp - 0x38], 0
je 0x4122a9
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x4122c2
mov edx, dword [ebp + 8]
cmp eax, ebx
ja 0x412400
lea ebx, [ebp - 0x2c]
mov ecx, ebx
push eax
call fcn.00404d00
add esp, 4
mov ecx, ebx
call fcn.00412f00
mov ebx, edx
jmp 0x4122af
mov byte [ebx + 4], 0
jmp 0x41229a
xor ebx, ebx
push eax
call sub.ntdll.dll_RtlNtStatusToDosError
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x412141
movzx eax, cl
cmp cl, 5
jae 0x4123f2
lea ecx, [ebp - 0x38]
push eax
call fcn.00404d00
add esp, 4
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x38], 0
mov byte [eax + 4], 0
je 0x4122f1
mov byte [esi], 2
mov dword [esi + 4], 0x7f4ba4
jmp 0x412141
mov eax, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x30]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.00412b40
add esp, 8
jmp 0x412141
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x7f4a54]
cmp ecx, 2
jb 0x412341
cmp ecx, ebx
jbe 0x412341
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 0x412141
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
cmp ecx, ebx
mov dword [ebp - 0x14], ecx
jne 0x412413
lea ecx, [ebp - 0x2c]
mov edx, edi
push ebx
push eax
call fcn.00412b40
add esp, 8
movzx eax, byte [ebp - 0x2c]
cmp al, 4
jne 0x412351
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x14], ebx
cmp eax, ebx
mov dword [ebp - 0x40], eax
je 0x4121ae
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x40]
lea edx, [ebp - 0x14]
push 0x7f4be0
jmp 0x412425
mov al, 2
mov dword [esi + 4], 0x7f4ba4
mov byte [esi], al
jmp 0x412141
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 0x412141
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, 0x7f4c44
call fcn.00403c20
ud2
lea eax, [ebp - 0x44]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x2c], 0x7f4984
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.004105c0
add esp, 4
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
call fcn.004106c0
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x7f4bd0
jmp 0x412409
mov ecx, eax
mov edx, ebx
push 0x7f4bb0
call fcn.00404300
add esp, 4
ud2
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x44]
lea edx, [ebp - 0x14]
push 0x7f4bf0
lea eax, [ebp - 0x2c]
push eax
call fcn.00411790
add esp, 8
ud2