Function at 0x140002220
Capabilities:
Allocate or change rwx memory
Encode data using xor
Execute shellcode via indirect call
Get common file path
Hash data with crc32
Parse pe header
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1200]
mov eax, 0x1300
call fcn.140006a20
sub rsp, rax
mov rax, qword [0x14000b040]
xor rax, rsp
mov qword [rbp + 0x11f0], rax
cmp dword [rcx + 0x14], 0
mov rsi, rcx
jne 0x1400028e1
xor r14d, r14d
test byte [rcx + 0x10], 1
je 0x1400023e9
cmp dword [rcx + 0x18], 6
jb 0x1400023e9
cmp dword [rcx + 0x1c], 1
jb 0x1400023e9
mov edx, 0x104
mov dword [rsp + 0x40], r14d
lea rcx, [rbp - 0x20]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea rcx, str.ntdll.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rcx, rax
lea rdx, str.ZwQuerySystemInformation
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rbx, rax
test rax, rax
je 0x140002502
xor edx, edx
lea r9, [rsp + 0x40]
xor r8d, r8d
lea ecx, [rdx + 0xb]
call rbx
mov eax, dword [rsp + 0x40]
test eax, eax
je 0x140002502
mov edx, eax
lea ecx, [r14 + 1]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov r8d, dword [rsp + 0x40]
lea r9, [rsp + 0x40]
mov rdx, rax
lea ecx, [r14 + 0xb]
mov r15, rax
call rbx
test eax, eax
jne 0x140002502
mov rdi, r15
lea r12, str.SystemRoot_system32_
mov rbx, 0xffffffffffffffff
nop
inc rbx
cmp byte [r12 + rbx], r14b
jne 0x140002320
mov eax, dword [rsp + 0x40]
cmp rax, rbx
je 0x140002368
nop dword [rax]
nop word [rax + rax]
mov r8, rbx
mov rdx, r12
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncmp]
test eax, eax
je 0x140002368
mov edx, dword [rsp + 0x40]
inc rdi
mov rax, rdi
sub rdx, rbx
sub rax, r15
cmp rax, rdx
jb 0x140002340
mov rcx, rdi
call qword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
lea rcx, [rsi + 0x3c]
mov r9, rax
lea rax, [rbp - 0x20]
mov r8, rcx
sub r8, rax
lea rdx, [rbp - 0x20]
nop word [rax + rax]
movzx eax, byte [rdx]
mov byte [r8 + rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140002390
lea rdx, [rcx - 1]
cmp byte [rdx + 1], r14b
lea rdx, [rdx + 1]
jne 0x1400023a3
movzx eax, word [0x1400080d0]
dec rcx
mov word [rdx], ax
nop word [rax + rax]
cmp byte [rcx + 1], r14b
lea rcx, [rcx + 1]
jne 0x1400023c0
xor edx, edx
nop dword [rax]
movzx eax, byte [r9 + rdx]
mov byte [rcx + rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x1400023d0
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test byte [rsi + 0x10], 2
lea r12, [0x140007c20]
mov ebx, 0xffffffff
mov edi, 0x5a4d
je 0x14000253a
mov rcx, qword [rsi + 8]
mov edx, 8
call qword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x14000253a
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x14000257d
cmp word [rcx], di
jne 0x14000257d
call qword [sym.imp.imagehlp.dll_ImageNtHeader]
mov r13, rax
test rax, rax
je 0x14000257d
cmp dword [rax], 0x4550
jne 0x14000257d
movzx r15d, word [rax + 0x14]
lea rdi, [rsi + 0x140]
mov rax, qword [rdi]
add r15, 0x24
cmp rax, qword [rdi + 8]
je 0x14000246c
mov qword [rdi + 8], rax
mov r12, r14
cmp r14w, word [r13 + 6]
jae 0x14000252e
add r15, r13
nop dword [rax]
mov eax, dword [r15 + 0x18]
and eax, 0xc0000000
cmp eax, 0x40000000
jne 0x140002519
mov eax, dword [r15 - 4]
mov edx, ebx
mov r8d, dword [r15]
add r8, qword [rsi + 8]
mov qword [rsp + 0x60], r8
mov dword [rsp + 0x68], eax
test eax, eax
je 0x1400024e3
mov r9d, eax
lea rdi, [0x140007c20]
nop dword [rax + rax]
movzx ecx, byte [r8]
lea r8, [r8 + 1]
mov eax, edx
shr edx, 8
xor rcx, rax
movzx eax, cl
xor edx, dword [rdi + rax*4]
sub r9, 1
jne 0x1400024c0
lea rdi, [rsi + 0x140]
not edx
mov dword [rsp + 0x6c], edx
mov rdx, qword [rdi + 8]
cmp rdx, qword [rdi + 0x10]
je 0x14000250c
movups xmm0, xmmword [rsp + 0x60]
movups xmmword [rdx], xmm0
add qword [rdi + 8], 0x10
jmp 0x140002519
mov eax, 1
jmp 0x1400028e3
lea r8, [rsp + 0x60]
mov rcx, rdi
call fcn.140002e80
movzx eax, word [r13 + 6]
add r15, 0x28
inc r12
cmp r12, rax
jb 0x140002480
mov edi, 0x5a4d
lea r12, [0x140007c20]
test byte [rsi + 0x10], 4
je 0x1400028e1
cmp dword [rsi + 0x20], r14d
je 0x14000259d
lea rcx, str.ntdll.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rcx, rax
lea rdx, str.ZwQueryInformationProcess
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsi + 0x158], rax
test rax, rax
jne 0x140002587
mov eax, 4
jmp 0x1400028e3
mov eax, 2
jmp 0x1400028e3
lea rcx, str.ntdll.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
sub qword [rsi + 0x158], rax
jmp 0x14000259e
int3
lea rcx, str.ntdll.dll
cmp dword [rsi + 0x20], r14d
je 0x140002642
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov r8d, 0x1000
lea rcx, [rbp + 0x1f0]
mov rdx, rax
call sub.VCRUNTIME140.dll_memcpy
cmp word [rbp + 0x1f0], di
jne 0x140002913
movsxd rax, dword [rbp + 0x22c]
lea r8, [rbp + 0x1f0]
add r8, rax
cmp dword [r8], 0x4550
jne 0x140002913
movzx ecx, word [r8 + 0x14]
mov rdx, r14
movzx r10d, word [r8 + 6]
add rcx, 0x18
add rcx, r8
test r10, r10
je 0x1400026a5
mov r9, qword [rsi + 0x158]
nop dword [rax]
mov r8d, dword [rcx + 0xc]
cmp r8, r9
ja 0x140002634
mov eax, dword [rcx + 8]
add eax, r8d
cmp r9, rax
jbe 0x1400026a5
add rcx, 0x28
inc rdx
cmp rdx, r10
jb 0x140002620
jmp 0x1400026a5
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
cmp word [rax], di
jne 0x140002913
movsxd r8, dword [rax + 0x3c]
add r8, rax
cmp dword [r8], 0x4550
jne 0x140002913
movzx ecx, word [r8 + 0x14]
mov rdx, r14
movzx r10d, word [r8 + 6]
add rcx, 0x18
add rcx, r8
test r10, r10
je 0x1400026a5
mov r9, qword [rsi + 0x158]
mov r8d, dword [rcx + 0xc]
cmp r8, r9
ja 0x140002699
mov eax, dword [rcx + 8]
add eax, r8d
cmp r9, rax
jbe 0x1400026a5
add rcx, 0x28
inc rdx
cmp rdx, r10
jb 0x140002685
mov edi, dword [rcx + 0x14]
sub edi, dword [rcx + 0xc]
add edi, dword [rsi + 0x158]
test edi, edi
je 0x140002913
xor edx, edx
lea rcx, [rbp - 0x20]
mov r8d, 0x208
call sub.VCRUNTIME140.dll_memset
mov edx, 0x104
lea rcx, [rbp - 0x20]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea rcx, [rbp - 0x20]
sub rcx, 2
cmp word [rcx + 2], r14w
lea rcx, [rcx + 2]
jne 0x1400026e1
mov eax, dword [0x140008108]
xor r9d, r9d
movups xmm0, xmmword [str._ntdll.dll]
mov qword [rsp + 0x30], r14
mov edx, 0x80000000
mov dword [rsp + 0x28], 0x80
movups xmmword [rcx], xmm0
mov dword [rcx + 0x10], eax
lea r8d, [r9 + 1]
movzx eax, word [0x14000810c]
mov word [rcx + 0x14], ax
lea rcx, [rbp - 0x20]
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r15, rax
cmp rax, 0xffffffffffffffff
jne 0x140002747
lea eax, [r15 + 4]
jmp 0x1400028e3
mov r9d, 1
xor r8d, r8d
mov edx, edi
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
lea r9, [rsp + 0x40]
mov qword [rsp + 0x20], r14
mov r8d, 0x64
lea rdx, [rsp + 0x70]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r15d, dword [rsi + 0x20]
lea rdi, [rsp + 0x70]
nop dword [rax + rax]
mov r8d, r15d
lea rdx, [rsp + 0x60]
mov rcx, rdi
call fcn.140003030
mov eax, eax
cmp rax, 5
jne 0x1400027ad
cmp byte [rdi], 0xb8
je 0x1400027b2
add rdi, rax
jmp 0x140002790
mov eax, dword [rdi + 1]
xor edx, edx
mov r8d, dword [rsi + 0x2c]
mov r9d, 0x1000
mov dword [rsi + 0x160], eax
mov byte [rsp + 0x48], 0xb8
lea rcx, [rdx - 1]
mov dword [rsp + 0x4d], 0x3e8
mov dword [rsp + 0x51], 0x14c200
mov dword [rsp + 0x55], 0x340fd48b
mov byte [rsp + 0x59], 0xc3
mov byte [rsp + 0x60], 0xb8
mov dword [rsp + 0x65], 0xfd18b4c
mov byte [rsp + 0x69], 5
mov dword [rsp + 0x20], 0x40
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov qword [rsi + 0x30], rax
test rax, rax
jne 0x140002820
mov eax, 5
jmp 0x1400028e3
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_srand]
mov rdi, qword [rsi + 0x30]
cmp dword [rsi + 0x2c], r14d
jbe 0x14000284d
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
mov byte [rdi + r14], al
inc r14
mov eax, dword [rsi + 0x2c]
cmp r14, rax
jb 0x140002838
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
mov ecx, dword [rsi + 0x2c]
xor edx, edx
sub rcx, 0x1d
cdqe
div rcx
mov eax, dword [rsi + 0x160]
mov rcx, qword [rsi + 0x30]
add rcx, rdx
mov dword [rsp + 0x49], eax
movups xmm0, xmmword [rsp + 0x48]
mov qword [rsi + 0x168], rcx
mov dword [rsp + 0x61], eax
movzx eax, word [rsp + 0x58]
movups xmmword [rcx], xmm0
mov word [rcx + 0x10], ax
add rcx, 0x12
movzx eax, word [rsp + 0x68]
movsd xmm0, qword [rsp + 0x60]
mov qword [rsi + 0x170], rcx
movsd qword [rcx], xmm0
mov word [rcx + 8], ax
mov byte [rcx + 0xa], 0xc3
mov eax, dword [rsi + 0x2c]
test eax, eax
je 0x1400028dc
mov rdx, qword [rsi + 0x30]
mov r8d, eax
nop
movzx eax, byte [rdx]
lea rdx, [rdx + 1]
mov ecx, ebx
shr ebx, 8
xor rcx, rax
movzx eax, cl
xor ebx, dword [r12 + rax*4]
sub r8, 1
jne 0x1400028c0
not ebx
mov dword [rsi + 0x38], ebx
xor eax, eax
mov rcx, qword [rbp + 0x11f0]
xor rcx, rsp
call fcn.140005ea0
lea r11, [rsp + 0x1300]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
mov eax, 6
jmp 0x1400028e3