Function at 0x140001060
Capabilities:
Read file on windows
Write file on windows

Disassembly:
mov qword [rsp + 0x20], rbp
push r14
sub rsp, 0x30
mov ebp, ecx
mov r14, rdx
mov rcx, qword [rdx]
call qword [sym.imp.libbu.dll_bu_setprogname]
lea eax, [rbp - 3]
cmp eax, 2
ja 0x140001481
mov qword [rsp + 0x40], rbx
lea rdx, [0x1400022b8]
mov qword [rsp + 0x48], rsi
mov rsi, qword [r14 + 8]
mov rcx, rsi
call qword [sym.imp.libbu.dll_bu_strcmp]
mov rbx, 0xffffffffffffffff
test eax, eax
jne 0x1400010b7
lea rsi, [0x1400022b0]
jmp 0x1400010e9
mov rax, rbx
nop word [rax + rax]
inc rax
cmp byte [rsi + rax], 0
jne 0x1400010c0
cmp rax, 4
ja 0x14000145d
mov rax, rbx
inc rax
cmp byte [rsi + rax], 0
jne 0x1400010d6
cmp rax, 1
jb 0x14000145d
mov qword [rsp + 0x50], rdi
lea rdx, [0x1400022b8]
mov rdi, qword [r14 + 0x10]
mov rcx, rdi
call qword [sym.imp.libbu.dll_bu_strcmp]
test eax, eax
jne 0x14000110f
lea rdi, [0x1400022b4]
jmp 0x140001138
mov rax, rbx
inc rax
cmp byte [rdi + rax], 0
jne 0x140001112
cmp rax, 4
ja 0x140001439
inc rbx
cmp byte [rdi + rbx], 0
jne 0x140001125
cmp rbx, 1
jb 0x140001439
cmp ebp, 5
jne 0x14000116c
mov rcx, qword [r14 + 0x20]
lea rdx, [0x140002304]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov qword [0x140004188], rax
test rax, rax
jne 0x140001199
mov rcx, qword [r14 + 0x20]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
lea eax, [rbp - 3]
jmp 0x140001224
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
mov qword [0x140004188], rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
mov edx, 0x8000
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
cmp ebp, 4
jl 0x1400011c7
mov rcx, qword [r14 + 0x18]
lea rdx, [0x140002308]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov qword [0x140004190], rax
test rax, rax
jne 0x1400011ec
mov rcx, qword [r14 + 0x18]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
mov eax, 3
jmp 0x140001224
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
mov qword [0x140004190], rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
mov edx, 0x8000
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
mov rcx, qword [0x140004188]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__isatty]
test eax, eax
je 0x14000123f
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.cv:_trying_to_send_binary_output_to_terminal_n
call fcn.140001010
mov eax, 5
mov rdi, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x58]
add rsp, 0x30
pop r14
ret
mov rcx, rsi
call qword [sym.imp.libbu.dll_bu_cv_cookie]
mov rcx, rdi
mov dword [0x1400041bc], eax
call qword [sym.imp.libbu.dll_bu_cv_cookie]
mov ecx, dword [0x1400041bc]
mov dword [0x1400041b8], eax
call qword [sym.imp.libbu.dll_bu_cv_itemlen]
mov ecx, dword [0x1400041b8]
mov qword [0x1400041b0], rax
call qword [sym.imp.libbu.dll_bu_cv_itemlen]
mov rcx, qword [0x1400041b0]
mov qword [0x1400041a8], rax
test rcx, rcx
jne 0x1400012b6
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8, rsi
lea rdx, str.cv:_unrecognized_input_format___s__n
mov rcx, rax
call fcn.140001010
mov eax, 6
jmp 0x140001224
test rax, rax
jne 0x1400012e0
lea ecx, [rax + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8, rdi
lea rdx, str.cv:_unrecognized_output_format___s__n
mov rcx, rax
call fcn.140001010
mov eax, 6
jmp 0x140001224
shl rcx, 0x10
lea rdx, str.cv_input_buffer
shl rax, 0x10
mov qword [0x1400041a0], rcx
mov qword [0x140004198], rax
call qword [sym.imp.libbu.dll_bu_malloc]
mov rcx, qword [0x140004198]
lea rdx, str.cv_output_buffer
mov qword [0x140004180], rax
call qword [sym.imp.libbu.dll_bu_malloc]
mov rcx, qword [0x140004190]
mov qword [0x140004178], rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
test eax, eax
jne 0x1400013d9
nop word [rax + rax]
mov r9, qword [0x140004190]
mov r8d, 0x10000
mov rdx, qword [0x1400041b0]
mov rcx, qword [0x140004180]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov rbx, rax
test rax, rax
je 0x1400013d9
mov ecx, dword [0x1400041bc]
mov r9, qword [0x140004180]
mov r8, qword [0x140004198]
mov edx, dword [0x1400041b8]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ecx
mov rcx, qword [0x140004178]
call qword [sym.imp.libbu.dll_bu_cv_w_cookie]
mov r8, rbx
cmp rax, rbx
jne 0x14000141f
mov r9, qword [0x140004188]
mov rdx, qword [0x1400041a8]
mov rcx, qword [0x140004178]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov rdi, rax
cmp rax, rbx
jne 0x1400013fa
mov rcx, qword [0x140004190]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
test eax, eax
je 0x140001340
mov rcx, qword [0x140004190]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov rcx, qword [0x140004188]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
xor eax, eax
jmp 0x140001224
lea rcx, [0x1400023e4]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
mov r8, rbx
lea rcx, str.cv:_fwrite___ret_zu__count_zu_n
mov rdx, rdi
call qword [sym.imp.libbu.dll_bu_log]
jmp 0x14000121f
mov rdx, rax
lea rcx, str.cv:_bu_cv_w_cookie___ret_zu__count_zu_n
call qword [sym.imp.libbu.dll_bu_log]
mov eax, 4
jmp 0x140001224
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.cv:_unrecognized_output_pattern_n
call fcn.140001010
mov eax, 1
jmp 0x140001224
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.cv:_unrecognized_input_pattern_n
call fcn.140001010
mov eax, 1
jmp 0x140001229
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rdx, rax
lea rcx, str.Usage:_cv_in_pat_out_pat___infile__outfile__n_nWhere_a_pattern__no_embedded_blanks__is:__hn___su___csild8163264__ne.g.__hui_is_host_unsigned_int__nl_is_network__signed__long_n
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
mov rbp, qword [rsp + 0x58]
mov eax, 1
add rsp, 0x30
pop r14
ret