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

Disassembly:
push rbp
push r12
push r13
push r14
push r15
sub rsp, 0x870
mov rax, qword [0x140106438]
xor rax, rsp
mov qword [rsp + 0x860], rax
xor ebp, ebp
lea rax, [0x1400e0718]
mov qword [rsp + 0x40], rax
lea rax, str.w__ccsUTF_8
mov qword [rsp + 0x48], rax
lea rax, str.w__ccsUTF_16LE
mov qword [rsp + 0x50], rax
mov r13, rcx
mov qword [rsp + 0x38], rbp
mov r15d, ebp
mov word [rsp + 0x20], bp
mov r14d, ebp
mov r12d, ebp
test rcx, rcx
je 0x140021f06
cmp byte [rcx], bpl
je 0x140021f06
mov qword [rsp + 0x8b0], rsi
call fcn.140003550
mov qword [rsp + 0x30], rax
mov rsi, rax
test rax, rax
jne 0x140021b6f
mov rdx, r13
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x140021ed7
lea rcx, str._SetupData_
call fcn.140003550
mov r15, rax
test rax, rax
jne 0x140021b9b
lea rdx, str._SetupData_
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x140021ed7
lea rcx, str.SetupSourceDevice___deviceharddisk1partition1_
call fcn.140003550
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x140021bc9
lea rdx, str.SetupSourceDevice___deviceharddisk1partition1_
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x140021ed7
lea rdx, str.r__ccsUNICODE
mov qword [rsp + 0x8b8], rdi
mov rcx, rsi
call fcn.14009b834
mov rdi, rax
test rax, rax
jne 0x140021bfc
mov rdx, r13
lea rcx, str.Could_not_open_file__s_n
call fcn.140041aa0
jmp 0x140021ecf
mov edx, 2
lea rcx, [rsp + 0x20]
mov r9, rdi
lea r8d, [rdx - 1]
call fcn.1400a6f3c
cmp rax, 1
je 0x140021c34
mov rdx, r13
lea rcx, str.Could_not_read_file__s_n
call fcn.140041aa0
mov rcx, rdi
call fcn.14009b928
jmp 0x140021ecf
movzx eax, word [rsp + 0x20]
mov qword [rsp + 0x8a8], rbx
cmp eax, 0xbbef
je 0x140021c57
cmp eax, 0xfeff
mov ebx, 2
cmovne ebx, ebp
jmp 0x140021c5c
mov ebx, 1
xor r8d, r8d
mov dword [rsp + 0x28], ebx
xor edx, edx
mov rcx, rdi
call fcn.1400a5ff0
mov rcx, 0xffffffffffffffff
inc rcx
cmp word [rsi + rcx*2], bp
jne 0x140021c74
add rcx, 2
mov edx, 2
call fcn.1400966e0
mov r14, rax
test rax, rax
jne 0x140021cac
lea rcx, str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.140041aa0
mov rcx, rdi
call fcn.14009b928
jmp 0x140021ec7
mov rdx, r14
mov rcx, rsi
sub rdx, rsi
nop word [rax + rax]
movzx eax, word [rcx]
mov word [rdx + rcx], ax
lea rcx, [rcx + 2]
test ax, ax
jne 0x140021cc0
mov rax, 0xffffffffffffffff
nop word [rax + rax]
cmp word [r14 + rax*2 + 2], bp
lea rax, [rax + 1]
jne 0x140021ce0
mov ecx, 0x7e
mov edx, ebx
mov word [r14 + rax*2], cx
mov rcx, r14
mov rdx, qword [rsp + rdx*8 + 0x40]
call fcn.14009b834
mov rbx, rax
test rax, rax
jne 0x140021d29
mov rdx, r13
lea rcx, str.Could_not_open_temporary_output_file__s_n
call fcn.140041aa0
mov rcx, rdi
call fcn.14009b928
jmp 0x140021ebf
mov r8, rdi
lea rcx, [rsp + 0x60]
mov edx, 0x400
call fcn.1400a62f0
test rax, rax
je 0x140021dd9
mov rsi, qword [rsp + 0x38]
nop dword [rax]
lea rdx, [0x1400d3b10]
lea rcx, [rsp + 0x60]
call fcn.1400a65cc
mov r8, 0xffffffffffffffff
nop dword [rax + rax]
inc r8
cmp word [r15 + r8*2], bp
jne 0x140021d70
lea rcx, [rsp + 0x60]
mov rdx, r15
lea rcx, [rcx + rax*2]
call fcn.1400a6b44
lea rcx, [rsp + 0x60]
mov rdx, rbx
test eax, eax
je 0x140021d9e
call fcn.1400a5d7c
jmp 0x140021dbc
call fcn.1400a5d7c
mov r8, rsi
lea rdx, [0x1400e07e8]
mov rcx, rbx
call fcn.140012b20
lea r12, str.SetupSourceDevice___deviceharddisk1partition1_
mov r8, rdi
lea rcx, [rsp + 0x60]
mov edx, 0x400
call fcn.1400a62f0
test rax, rax
jne 0x140021d50
jmp 0x140021de1
mov eax, dword [rsp + 0x28]
mov dword [rsp + 0x28], eax
mov rcx, rdi
call fcn.14009b928
mov rcx, rbx
call fcn.14009b928
test r12, r12
je 0x140021eba
lea rdx, [0x1400e01b4]
mov rcx, r14
call fcn.14009b834
mov rcx, qword [rsp + 0x30]
lea rdx, [0x1400e0804]
mov rbx, rax
call fcn.14009b834
mov rdi, rax
test rbx, rbx
je 0x140021e8e
test rax, rax
je 0x140021e8e
cmp dword [rsp + 0x28], 2
lea rcx, [rsp + 0x24]
mov r9, rbx
mov r8d, 1
sete bpl
inc rbp
mov rdx, rbp
call fcn.1400a6f3c
cmp rax, 1
jne 0x140021e84
mov r9, rdi
lea rcx, [rsp + 0x24]
mov r8d, 1
mov rdx, rbp
call fcn.1400a6548
mov r9, rbx
lea rcx, [rsp + 0x24]
mov r8d, 1
mov rdx, rbp
call fcn.1400a6f3c
cmp rax, 1
je 0x140021e52
mov rcx, rbx
call fcn.14009b928
jmp 0x140021eb2
mov rdx, r13
lea rcx, str.Could_not_write__s___original_file_has_been_left_unmodified_n
call fcn.140041aa0
mov r12, rbp
test rbx, rbx
je 0x140021ead
mov rcx, rbx
call fcn.14009b928
test rdi, rdi
je 0x140021eba
mov rcx, rdi
call fcn.14009b928
mov rsi, qword [rsp + 0x30]
mov rcx, r14
call fcn.1400a702c
mov rbx, qword [rsp + 0x8a8]
mov rdi, qword [rsp + 0x8b8]
mov rcx, rsi
call fcn.14009b5a0
mov rcx, r14
call fcn.14009b5a0
mov rcx, r15
call fcn.14009b5a0
mov rcx, qword [rsp + 0x38]
call fcn.14009b5a0
mov rsi, qword [rsp + 0x8b0]
mov rax, r12
jmp 0x140021f08
xor eax, eax
mov rcx, qword [rsp + 0x860]
xor rcx, rsp
call fcn.140092060
add rsp, 0x870
pop r15
pop r14
pop r13
pop r12
pop rbp
ret