Function at 0x4f2ba0
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 0x4f2bca
push edx
call sub.KERNEL32.dll_GetStdHandle
test eax, eax
je 0x4f2bd6
mov edi, eax
cmp eax, 0xffffffff
jne 0x4f2be9
call sub.KERNEL32.dll_GetLastError
jmp 0x4f2bdb
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x4f2be1
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 0x4f2c5a
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ecx + 4]
test eax, eax
je 0x4f2ca8
mov ebx, ecx
mov ecx, dword [ebp + 8]
cmp al, 4
jae 0x4f2e1c
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x4f2d09
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 + 0x5a1bd4]
cmp cl, bl
mov dword [ebp - 0x44], ebx
jae 0x4f2d24
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x4f2be1
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 0x4f2c9d
push 0xffffffffffffffff
push edi
call sub.KERNEL32.dll_WaitForSingleObject
mov eax, dword [ebp - 0x14]
cmp eax, 0x103
je 0x4f2e4e
test eax, eax
js 0x4f2d0f
mov eax, dword [ebp - 0x10]
mov bl, 4
jmp 0x4f2d17
cmp ebx, 0x1000
mov eax, 0x1000
cmovb eax, ebx
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x38]
push eax
call dbg.from_utf8
add esp, 4
cmp dword [ebp - 0x38], 0
je 0x4f2d58
mov edx, dword [ebp - 0x34]
test edx, edx
je 0x4f2d71
xor ecx, ecx
push 0x5a1d30
push ebx
push dword [ebp + 8]
call sym.__ZN106__LT_core..ops..range..Range_LT_usize_GT__u20_as_u20_core..slice..index..SliceIndex_LT__u5b_T_u5d__GT__GT_5index17h14e8
add esp, 0xc
mov ebx, edx
lea ecx, [ebp - 0x2c]
mov edx, eax
push ebx
call dbg.from_utf8
add esp, 4
lea ecx, [ebp - 0x2c]
call dbg.unwrap<&str, core::str::error::Utf8Error>
mov ebx, edx
jmp 0x4f2d5e
mov byte [ebx + 4], 0
jmp 0x4f2d49
xor ebx, ebx
push eax
call sub.ntdll.dll_RtlNtStatusToDosError
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x4f2be1
movzx eax, cl
cmp cl, 5
jae 0x4f2ea3
lea ecx, [ebp - 0x38]
push eax
call dbg.from_utf8
add esp, 4
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x38], 0
mov byte [eax + 4], 0
je 0x4f2da0
mov byte [esi], 2
mov dword [esi + 4], 0x5a1d24
jmp 0x4f2be1
mov eax, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x30]
mov ecx, esi
mov edx, edi
push ebx
push eax
call dbg.write_valid_utf8_to_console
add esp, 8
jmp 0x4f2be1
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x5a1bd4]
cmp ecx, 2
jb 0x4f2df0
cmp ecx, ebx
jbe 0x4f2df0
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 0x4f2be1
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x34]
cmp ecx, ebx
mov dword [ebp - 0x14], ecx
jne 0x4f2eb9
lea ecx, [ebp - 0x2c]
mov edx, edi
push ebx
push eax
call dbg.write_valid_utf8_to_console
add esp, 8
movzx eax, byte [ebp - 0x2c]
cmp al, 4
jne 0x4f2e00
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x14], ebx
cmp eax, ebx
mov dword [ebp - 0x40], eax
je 0x4f2c4e
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x40]
lea edx, [ebp - 0x14]
push 0x5a1dc4
jmp 0x4f2ecb
mov al, 2
mov dword [esi + 4], 0x5a1d24
mov byte [esi], al
jmp 0x4f2be1
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 0x4f2be1
mov dword [ebp - 0x2c], 0x5a1d8c
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x24], str.called__Option::unwrap____on_a__None__value_rustc_82e1608dfa6e0b5569232559e3d385fea5a93112library_std_src_threadmod.rs
mov dword [ebp - 0x20], 0
lea ecx, [ebp - 0x2c]
mov edx, 0x5a1d94
call dbg.panic_fmt
ud2
lea eax, [ebp - 0x44]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x2c], 0x5a19a4
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 eax, [ebp - 0x40]
lea edx, [ebp - 0x2c]
lea ecx, [ebp - 0x38]
push edx
push eax
push ecx
call dbg.write_fmt<std::sys::windows::stdio::Stderr>
add esp, 0xc
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
call dbg.drop_in_place<core::option::Option<std::io::error::Error>>
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x5a1da4
call dbg.slice_end_index_len_fail
add esp, 4
ud2
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x44]
lea edx, [ebp - 0x14]
push 0x5a1db4
lea eax, [ebp - 0x2c]
push eax
call dbg.assert_failed<usize, usize>
add esp, 8
ud2