Function at 0x10051530
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x40
mov ebx, dword [ebp + 0xc]
mov esi, ecx
test ebx, ebx
je 0x1005155a
push edx
call sub.kernel32.dll_GetStdHandle
test eax, eax
je 0x10051566
mov edi, eax
cmp eax, 0xffffffff
jne 0x10051579
call sub.kernel32.dll_GetLastError
jmp 0x1005156b
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x10051571
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
add esp, 0x40
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x24], 0
lea eax, [ebp - 0x24]
push eax
push edi
call sub.kernel32.dll_GetConsoleMode
test eax, eax
je 0x100515e8
mov eax, dword [ebp + 0x10]
movzx eax, byte [eax + 4]
test eax, eax
je 0x10051636
cmp al, 4
jae 0x100517a1
mov ecx, dword [ebp + 8]
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
neg dl
jno 0x10051690
mov edx, dword [ebp + 0x10]
mov byte [edx + eax], cl
movzx eax, byte [edx + 4]
inc al
mov byte [edx + 4], al
movzx ecx, byte [edx]
movzx ebx, byte [ecx + 0x100f0fea]
cmp al, bl
mov dword [ebp - 0x48], ebx
jae 0x100516d4
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x10051571
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0x103
lea eax, [ebp - 0x2c]
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 0x1005162b
push 0xffffffffffffffff
push edi
call sub.kernel32.dll_WaitForSingleObject
mov eax, dword [ebp - 0x2c]
cmp eax, 0x103
je 0x100517d2
test eax, eax
js 0x100516a6
mov eax, dword [ebp - 0x28]
mov bl, 4
jmp 0x100516ae
cmp ebx, 0x1000
mov eax, 0x1000
cmovb eax, ebx
lea ecx, [ebp - 0x44]
push eax
push dword [ebp + 8]
push ecx
call sym.core::str::converts::from_utf8::h614587554aa91dbb
add esp, 0xc
test byte [ebp - 0x44], 1
je 0x100516bb
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x10051751
mov ecx, dword [ebp + 8]
cmp eax, ebx
ja 0x10051831
push eax
push ecx
lea eax, [ebp - 0x24]
push eax
call sym.core::str::converts::from_utf8::h614587554aa91dbb
add esp, 0xc
cmp dword [ebp - 0x24], 1
je 0x1005183d
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x1c]
jmp 0x100516c1
mov eax, dword [ebp + 0x10]
mov byte [eax + 4], 0
mov byte [esi], 2
mov dword [esi + 4], 0x100f113c
jmp 0x10051571
xor ebx, ebx
push eax
call sub.ntdll.dll_RtlNtStatusToDosError
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x10051571
mov eax, dword [ebp - 0x40]
mov ebx, dword [ebp - 0x3c]
mov ecx, esi
mov edx, edi
push ebx
push eax
call sym.std::sys::pal::windows::stdio::write_valid_utf8_to_console::h689fd6e0ca9f50b5
add esp, 8
jmp 0x10051571
movzx ecx, al
cmp al, 5
jae 0x10051824
lea eax, [ebp - 0x44]
push ecx
mov ecx, dword [ebp + 0x10]
push ecx
push eax
call sym.core::str::converts::from_utf8::h614587554aa91dbb
add esp, 0xc
mov eax, dword [ebp + 0x10]
test byte [ebp - 0x44], 1
mov byte [eax + 4], 0
jne 0x10051697
mov ecx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x40]
cmp ecx, ebx
mov dword [ebp - 0x4c], ecx
jne 0x10051861
lea ecx, [ebp - 0x24]
mov edx, edi
push ebx
push eax
call sym.std::sys::pal::windows::stdio::write_valid_utf8_to_console::h689fd6e0ca9f50b5
add esp, 8
movzx eax, byte [ebp - 0x24]
cmp al, 4
jne 0x10051774
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x2c], ebx
cmp eax, ebx
mov dword [ebp - 0x34], eax
je 0x100515dc
mov dword [ebp - 0x24], 0
lea ecx, [ebp - 0x34]
lea edx, [ebp - 0x2c]
push 0x100f11dc
lea eax, [ebp - 0x24]
push eax
call sym.core::panicking::assert_failed::ha93b9b84e0318e5d
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x100f0fea]
cmp ecx, ebx
jbe 0x10051790
mov ecx, dword [ebp + 0x10]
mov byte [ecx], al
mov byte [ecx + 4], 1
mov al, 4
mov ecx, 1
jmp 0x10051797
movzx ecx, byte [ebp - 0x21]
movzx edi, word [ebp - 0x23]
mov edx, dword [ebp - 0x20]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x10051571
mov al, 2
mov ecx, 0x100f113c
mov dword [esi + 4], ecx
mov byte [esi], al
jmp 0x10051571
mov dword [ebp - 0x24], 0x100f11a4
mov dword [ebp - 0x20], 1
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 4
mov dword [ebp - 0x18], 0
push 0x100f11ac
lea eax, [ebp - 0x24]
push eax
call sym.core::panicking::panic_fmt::hced28cb7137b21e1
lea eax, [ebp - 0x38]
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x24], 0x100f0d04
mov dword [ebp - 0x20], 1
mov dword [ebp - 0x14], 0
mov byte [ebp - 0x30], 0
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], 0
lea eax, [ebp - 0x34]
lea edx, [ebp - 0x24]
lea ecx, [ebp - 0x44]
push edx
push eax
push ecx
call sym.__ZN3std2io5Write9write_fmt17h170a2f7748b08546E.llvm.10150728606014878797
add esp, 0xc
lea ecx, [ebp - 0x44]
call sym.__ZN4core3ptr81drop_in_place_LT_core..result..Result_LT__LP__RP__C_std..io..error..Error_GT__GT_17hb6cf10ccff73e133E.llvm.1015
mov ecx, 7
int 0x29
ud2
push 0x100f11bc
push 4
push ecx
call sym.core::slice::index::slice_end_index_len_fail::h31017dc9c470f2c8
push 0x100f1148
push ebx
push eax
call sym.core::slice::index::slice_end_index_len_fail::h31017dc9c470f2c8
movsd xmm0, qword [ebp - 0x20]
movsd qword [ebp - 0x2c], xmm0
lea eax, [ebp - 0x2c]
push 0x100f1158
push 0x100ef084
push eax
push 0x2b
push 0x100ef058
call sym.core::result::unwrap_failed::h534a40e08cfe968a
mov dword [ebp - 0x24], 0
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x4c]
push 0x100f11cc
lea eax, [ebp - 0x24]
push eax
call sym.core::panicking::assert_failed::ha93b9b84e0318e5d
mov esi, eax
push edi
call sub.kernel32.dll_CloseHandle
push esi
call sym.__Unwind_Resume
nop word [eax + eax]