Function at 0x1400513a4
Capabilities:
Copy file

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0x90
mov rax, qword [0x1400b8040]
xor rax, rsp
mov qword [rbp + 0x27], rax
mov esi, r8d
xor r12d, r12d
and esi, 0xf
mov r14, rdx
mov r15, rcx
mov ebx, 1
cmp esi, 2
je 0x1400515d7
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x140051403
mov byte [rbp - 0x19], bl
mov dword [rbp - 0x15], r12d
jmp 0x140051410
mov byte [rbp - 0x19], r12b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp - 0x15], eax
mov rax, qword [rbp - 0x19]
mov rcx, rax
shr rcx, 0x20
cmp ecx, 0x50
jne 0x140051620
test esi, esi
je 0x140051620
lea eax, [rcx - 0x4d]
mov qword [rsp + 0x30], r12
mov edi, eax
mov dword [rsp + 0x28], r12d
lea edx, [rcx + 0x30]
mov dword [rsp + 0x20], eax
cmp esi, ebx
mov rcx, r15
cmovne edi, ebx
xor r9d, r9d
mov r8d, edi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x14005146d
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140051615
mov qword [rsp + 0x30], r12
xor r9d, r9d
mov dword [rsp + 0x28], r12d
mov r8d, edi
mov edx, 0x80
mov dword [rsp + 0x20], 3
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400514c9
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x1400514c9
mov byte [rbp - 0x19], r12b
mov dword [rbp - 0x15], eax
cmp rbx, 0xffffffffffffffff
je 0x14005161c
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x140051542
jmp 0x14005161c
cmp esi, 4
jne 0x140051549
lea rdx, [rbp - 0x19]
mov rcx, rbx
call fcn.140051078
test eax, eax
je 0x1400514fa
mov byte [rbp - 0x19], r12b
mov dword [rbp - 0x15], eax
cmp rdi, 0xffffffffffffffff
je 0x1400514ad
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x140051542
jmp 0x1400514ad
lea rdx, [rbp - 0x11]
mov rcx, rdi
call fcn.140051078
test eax, eax
jne 0x1400514de
mov rax, qword [rbp - 0x19]
cmp qword [rbp - 0x11], rax
jge 0x140051549
cmp rdi, 0xffffffffffffffff
je 0x140051527
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x140051542
cmp rbx, 0xffffffffffffffff
je 0x1400515d2
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x1400515d2
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_abort]
int3
lea rdx, [rbp - 9]
mov rcx, rbx
call fcn.140050fe0
test eax, eax
je 0x140051595
mov dword [rbp - 0x15], eax
mov byte [rbp - 0x19], r12b
cmp rdi, 0xffffffffffffffff
je 0x140051573
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x14005158e
cmp rbx, 0xffffffffffffffff
je 0x14005161c
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x14005161c
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_abort]
int3
lea rdx, [rbp + 0xf]
mov rcx, rdi
call fcn.140050fe0
test eax, eax
jne 0x140051559
mov rax, qword [rbp - 9]
cmp rax, qword [rbp + 0xf]
jne 0x1400515cc
mov rax, qword [rbp - 1]
cmp rax, qword [rbp + 0x17]
jne 0x1400515cc
mov rax, qword [rbp + 7]
cmp rax, qword [rbp + 0x1f]
jne 0x1400515cc
mov dword [rbp - 0x15], 0x20
jmp 0x14005155c
mov dword [rbp - 0x15], r12d
jmp 0x14005155c
mov ebx, 1
xor r8d, r8d
mov rdx, r14
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x140051601
movzx eax, word [rbp - 0x10]
mov word [rbp - 0x18], ax
mov al, byte [rbp - 0xe]
mov byte [rbp - 0x16], al
mov byte [rbp - 0x19], bl
mov dword [rbp - 0x15], r12d
jmp 0x14005161c
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, word [rbp - 0x10]
mov word [rbp - 0x18], cx
mov cl, byte [rbp - 0xe]
mov byte [rbp - 0x16], cl
mov dword [rbp - 0x15], eax
mov byte [rbp - 0x19], r12b
mov rax, qword [rbp - 0x19]
mov rcx, qword [rbp + 0x27]
xor rcx, rsp
call fcn.14004ffa0
lea r11, [rsp + 0x90]
mov rbx, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret