Function at 0x10010470
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x3c
mov edi, dword [ebp + 8]
mov esi, ecx
test edi, edi
je 0x1001049b
mov ebx, edx
push 0xfffffffffffffff4
call sub.KERNEL32.dll_GetStdHandle
test eax, eax
je 0x100104a7
cmp eax, 0xffffffff
jne 0x100104ba
call sub.KERNEL32.dll_GetLastError
jmp 0x100104ac
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x100104b2
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x44], 0
lea ecx, [ebp - 0x44]
push ecx
push eax
mov dword [ebp - 0x18], eax
call sub.KERNEL32.dll_GetConsoleMode
test eax, eax
je 0x1001052a
mov eax, dword [ebp + 0xc]
movzx eax, byte [eax + 4]
test eax, eax
je 0x10010579
cmp al, 3
ja 0x100106dd
movzx ecx, byte [ebx]
mov edi, dword [ebp + 0xc]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x100105c9
mov byte [edi + eax], cl
movzx ecx, byte [edi + 4]
inc cl
mov byte [edi + 4], cl
movzx eax, byte [edi]
movzx ebx, byte [eax + 0x104f6b10]
cmp cl, bl
mov dword [ebp - 0x48], ebx
jae 0x100105e4
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x100104b2
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0x103
lea eax, [ebp - 0x14]
push 0
push 0
push edi
push ebx
push eax
push 0
push 0
push 0
mov edi, dword [ebp - 0x18]
push edi
call sub.ntdll.dll_NtWriteFile
cmp eax, 0x103
jne 0x1001056e
push 0xffffffffffffffff
push edi
call sub.KERNEL32.dll_WaitForSingleObject
mov eax, dword [ebp - 0x14]
cmp eax, 0x103
je 0x1001070f
test eax, eax
js 0x100105cf
mov eax, dword [ebp - 0x10]
mov bl, 4
jmp 0x100105d7
cmp edi, 0x1000
mov eax, 0x1000
cmovb eax, edi
lea ecx, [ebp - 0x24]
mov edx, ebx
push eax
call fcn.100042f0
add esp, 4
cmp dword [ebp - 0x24], 0
je 0x10010617
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x10010631
cmp eax, edi
ja 0x10010770
lea edi, [ebp - 0x44]
mov edx, ebx
mov ecx, edi
push eax
call fcn.100042f0
add esp, 4
mov ecx, edi
call fcn.10011270
mov edi, edx
jmp 0x1001061d
mov byte [edi + 4], 0
jmp 0x10010608
xor ebx, ebx
push eax
call sub.ntdll.dll_RtlNtStatusToDosError
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x100104b2
movzx eax, cl
cmp cl, 5
jae 0x10010762
lea ecx, [ebp - 0x24]
mov edx, edi
push eax
call fcn.100042f0
add esp, 4
cmp dword [ebp - 0x24], 0
mov byte [edi + 4], 0
je 0x1001065d
mov byte [esi], 2
mov dword [esi + 4], 0x104f6c60
jmp 0x100104b2
mov eax, dword [ebp - 0x20]
mov edi, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov ecx, esi
push edi
push eax
call fcn.10010eb0
add esp, 8
jmp 0x100104b2
movzx eax, byte [ebx]
movzx ecx, byte [eax + 0x104f6b10]
cmp ecx, 2
jb 0x100106b1
cmp ecx, edi
jbe 0x100106b1
mov ecx, dword [ebp + 0xc]
mov dword [esi + 4], 1
mov byte [ecx], al
mov byte [ecx + 4], 1
mov cl, 4
mov byte [esi], cl
jmp 0x100104b2
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x20]
cmp ecx, ebx
mov dword [ebp - 0x14], ecx
jne 0x10010783
mov edx, dword [ebp - 0x18]
lea edi, [ebp - 0x44]
mov ecx, edi
push ebx
push eax
call fcn.10010eb0
add esp, 8
movzx eax, byte [ebp - 0x44]
cmp al, 4
jne 0x100106c1
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x14], ebx
cmp eax, ebx
mov dword [ebp - 0x2c], eax
je 0x1001051e
mov dword [ebp - 0x44], 0
lea ecx, [ebp - 0x2c]
lea edx, [ebp - 0x14]
push 0x104f6c9c
push edi
jmp 0x10010799
mov al, 2
mov dword [esi + 4], 0x104f6c60
mov byte [esi], al
jmp 0x100104b2
movzx ecx, byte [ebp - 0x41]
movzx edi, word [ebp - 0x43]
mov edx, dword [ebp - 0x40]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x100104b2
mov dword [ebp - 0x44], str.Unexpected_number_of_bytes_for_incomplete_UTF_8_codepoint.
mov dword [ebp - 0x40], 1
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x3c], str.called__Option::unwrap____on_a__None__value_rustc_d5c2e9c342b358556da91d61ed4133f6f50fc0c3library_alloc_srccollections_btree_navigate.rsIndex_out_of_bounds
mov dword [ebp - 0x38], 0
lea ecx, [ebp - 0x44]
mov edx, 0x104f6d00
call fcn.10003210
ud2
lea eax, [ebp - 0x48]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x44], 0x104f6a40
mov dword [ebp - 0x40], 1
mov dword [ebp - 0x34], 0
mov byte [ebp - 0x28], 0
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], 0
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0x44]
lea ecx, [ebp - 0x24]
push eax
call fcn.1000f910
add esp, 4
mov edx, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
call fcn.1000fa10
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x104f6c8c
jmp 0x10010779
mov ecx, eax
mov edx, edi
push 0x104f6c6c
call fcn.100038f0
add esp, 4
ud2
mov dword [ebp - 0x44], 0
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x14]
push 0x104f6cac
lea eax, [ebp - 0x44]
push eax
call fcn.10010210
add esp, 8
ud2