Function at 0x4bad90
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x3c
mov edi, dword [ebp + 0xc]
mov esi, ecx
test edi, edi
je 0x4badb8
push edx
call sub.kernel32.dll_GetStdHandle
test eax, eax
je 0x4badc4
cmp eax, 0xffffffff
jne 0x4badd7
call sub.kernel32.dll_GetLastError
jmp 0x4badc9
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x4badcf
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 - 0x28], 0
lea ecx, [ebp - 0x28]
push ecx
mov dword [ebp - 0x10], eax
push eax
call sub.kernel32.dll_GetConsoleMode
test eax, eax
je 0x4bae43
mov ebx, dword [ebp + 0x10]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x4bae63
cmp al, 4
jae 0x4bafae
mov ecx, dword [ebp + 8]
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x4baeb6
mov byte [ebx + eax], cl
movzx ecx, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx eax, byte [eax + 0x515a88]
cmp cl, al
mov dword [ebp - 0x38], eax
jae 0x4baebc
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x4badcf
mov edx, dword [ebp - 0x10]
lea ecx, [ebp - 0x28]
push edi
push dword [ebp + 8]
call fcn.004bb050
add esp, 8
movsd xmm0, qword [ebp - 0x28]
movsd qword [esi], xmm0
jmp 0x4badcf
cmp edi, 0x1000
mov eax, 0x1000
cmovb eax, edi
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x34]
push eax
call fcn.00444870
add esp, 4
cmp dword [ebp - 0x34], 0
je 0x4baef1
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x4baf0b
cmp eax, edi
ja 0x4bafef
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x28]
push eax
call fcn.00444870
add esp, 4
cmp dword [ebp - 0x28], 0
jne 0x4baffd
mov eax, dword [ebp - 0x24]
mov edi, dword [ebp - 0x20]
jmp 0x4baef7
mov byte [ebx + 4], 0
jmp 0x4baee2
mov edi, eax
movzx eax, cl
cmp cl, 5
jae 0x4bafde
lea ecx, [ebp - 0x34]
mov edx, ebx
push eax
call fcn.00444870
add esp, 4
cmp dword [ebp - 0x34], 0
mov byte [ebx + 4], 0
je 0x4baf2b
mov byte [esi], 2
mov dword [esi + 4], 0x515bd8
jmp 0x4badcf
mov eax, dword [ebp - 0x30]
mov edi, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x10]
mov ecx, esi
push edi
push eax
call fcn.004bb120
add esp, 8
jmp 0x4badcf
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x515a88]
cmp ecx, edi
jbe 0x4baf81
mov byte [ebx], al
mov byte [ebx + 4], 1
mov al, 4
mov ecx, 1
jmp 0x4baf88
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x30]
cmp ecx, edi
mov dword [ebp - 0x3c], ecx
jne 0x4bb024
mov ebx, edi
mov edx, dword [ebp - 0x10]
lea edi, [ebp - 0x28]
mov ecx, edi
push ebx
push eax
call fcn.004bb120
add esp, 8
movzx eax, byte [ebp - 0x28]
cmp al, 4
jne 0x4baf92
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x48], ebx
cmp eax, ebx
mov dword [ebp - 0x40], eax
je 0x4bae37
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x40]
lea edx, [ebp - 0x48]
push 0x515c78
push edi
call fcn.004bb4e0
mov al, 2
mov ecx, 0x515bd8
mov dword [esi + 4], ecx
mov byte [esi], al
jmp 0x4badcf
movzx ecx, byte [ebp - 0x25]
movzx edi, word [ebp - 0x27]
mov edx, dword [ebp - 0x24]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x4badcf
mov dword [ebp - 0x28], 0x515c40
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], 4
mov dword [ebp - 0x1c], 0
lea ecx, [ebp - 0x28]
mov edx, 0x515c48
call fcn.004424d0
mov ecx, eax
mov edx, 4
push 0x515c58
call fcn.00443260
mov ecx, eax
mov edx, edi
push 0x515be4
call fcn.00443260
movsd xmm0, qword [ebp - 0x24]
movsd qword [ebp - 0x48], xmm0
lea eax, [ebp - 0x48]
mov ecx, str.called__Result::unwrap____on_an__Err__valueTERMdumbC:Userswin10_x64.cargo_registry_srcindex.crates.io_1cd66030c949c28d_termcolor_1.4.1_srclib.rs_ninternal_error:_entered_unreachable_code_rustc_eeb90cda1969383f56a2637cbd3037bdf598841clibrarycore_src_strmod.rs
mov edx, 0x2b
push 0x515bf4
push 0x5142f0
push eax
call fcn.00444e30
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x38]
lea edx, [ebp - 0x3c]
push 0x515c68
lea eax, [ebp - 0x28]
push eax
call fcn.004bb4e0
mov esi, eax
push dword [ebp - 0x10]
call sub.kernel32.dll_CloseHandle
push esi
call fcn.004f50b0
nop