Function at 0x140021e30
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.1400261e0
sub rsp, rax
mov rax, qword [0x14006a020]
xor rax, rsp
mov qword [rbp + 0x11f0], rax
cmp dword [rcx + 0x14], 0
mov rbx, rcx
jne 0x1400224f1
mov eax, dword [rcx + 0x10]
xor r14d, r14d
mov ecx, eax
test al, 1
je 0x140021ffb
cmp dword [rbx + 0x18], 6
jb 0x140021ffb
cmp dword [rbx + 0x1c], 1
jb 0x140021ffb
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 rdi, rax
test rax, rax
je 0x14002211a
xor edx, edx
lea r9, [rsp + 0x40]
xor r8d, r8d
lea ecx, [rdx + 0xb]
call rdi
mov eax, dword [rsp + 0x40]
test eax, eax
je 0x14002211a
mov edx, eax
lea ecx, [r14 + 1]
call fcn.14002c1e0
mov r8d, dword [rsp + 0x40]
lea r9, [rsp + 0x40]
mov rdx, rax
lea ecx, [r14 + 0xb]
mov r15, rax
call rdi
test eax, eax
jne 0x14002211a
mov rsi, r15
lea r12, str.SystemRoot_system32_
mov rdi, 0xffffffffffffffff
inc rdi
cmp byte [r12 + rdi], r14b
jne 0x140021f31
mov eax, dword [rsp + 0x40]
cmp rax, rdi
je 0x140021f77
nop dword [rax]
nop word [rax + rax]
mov r8, rdi
mov rdx, r12
mov rcx, rsi
call fcn.1400338a0
test eax, eax
je 0x140021f77
mov edx, dword [rsp + 0x40]
inc rsi
mov rax, rsi
sub rdx, rdi
sub rax, r15
cmp rax, rdx
jb 0x140021f50
mov rcx, rsi
call qword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
lea rcx, [rbx + 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 0x140021fa0
lea rdx, [rcx - 1]
cmp byte [rdx + 1], r14b
lea rdx, [rdx + 1]
jne 0x140021fb3
movzx eax, word [0x1400612b0]
dec rcx
mov word [rdx], ax
nop word [rax + rax]
cmp byte [rcx + 1], r14b
lea rcx, [rcx + 1]
jne 0x140021fd0
xor edx, edx
nop dword [rax]
movzx eax, byte [r9 + rdx]
mov byte [rcx + rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140021fe0
mov rcx, r15
call fcn.140032fd8
mov ecx, dword [rbx + 0x10]
lea r12, [0x1400607b0]
mov edi, 0xffffffff
mov esi, 0x5a4d
test cl, 2
je 0x140022152
mov rcx, qword [rbx + 8]
mov edx, 8
call qword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x140022152
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x140022195
cmp word [rcx], si
jne 0x140022195
call qword [sym.imp.imagehlp.dll_ImageNtHeader]
mov r13, rax
test rax, rax
je 0x140022195
cmp dword [rax], 0x4550
jne 0x140022195
movzx esi, word [rax + 0x14]
lea r12, [rbx + 0x140]
mov rcx, qword [r12]
add rsi, 0x24
mov qword [r12 + 8], rcx
mov r15, r14
cmp r14w, word [rax + 6]
jae 0x140022146
add rsi, rax
nop dword [rax]
mov eax, dword [rsi + 0x18]
and eax, 0xc0000000
cmp eax, 0x40000000
jne 0x140022131
mov eax, dword [rsi - 4]
mov edx, edi
mov r8d, dword [rsi]
add r8, qword [rbx + 8]
mov qword [rsp + 0x60], r8
mov dword [rsp + 0x68], eax
test eax, eax
je 0x1400220f4
mov r9d, eax
lea r12, [0x1400607b0]
nop word [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 [r12 + rax*4]
sub r9, 1
jne 0x1400220d0
lea r12, [rbx + 0x140]
not edx
mov dword [rsp + 0x6c], edx
mov rdx, qword [rbx + 0x148]
cmp rdx, qword [rbx + 0x150]
je 0x140022124
movups xmm0, xmmword [rsp + 0x60]
movups xmmword [rdx], xmm0
add qword [r12 + 8], 0x10
jmp 0x140022131
mov eax, 1
jmp 0x1400224f3
lea r8, [rsp + 0x60]
mov rcx, r12
call fcn.140022b00
movzx eax, word [r13 + 6]
add rsi, 0x28
inc r15
cmp r15, rax
jb 0x140022090
mov esi, 0x5a4d
lea r12, [0x1400607b0]
test byte [rbx + 0x10], 4
je 0x1400224f1
cmp dword [rbx + 0x20], r14d
je 0x1400221b5
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 [rbx + 0x158], rax
test rax, rax
jne 0x14002219f
mov eax, 4
jmp 0x1400224f3
mov eax, 2
jmp 0x1400224f3
lea rcx, str.ntdll.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
sub qword [rbx + 0x158], rax
jmp 0x1400221b6
int3
lea rcx, str.ntdll.dll
cmp dword [rbx + 0x20], r14d
je 0x140022253
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov r8d, 0x1000
lea rcx, [rbp + 0x1f0]
mov rdx, rax
call fcn.140027df0
cmp word [rbp + 0x1f0], si
jne 0x140022523
movsxd rax, dword [rbp + 0x22c]
lea r8, [rbp + 0x1f0]
add r8, rax
cmp dword [r8], 0x4550
jne 0x140022523
movzx eax, word [r8 + 0x14]
lea rcx, [r8 + 0x18]
movzx r10d, word [r8 + 6]
add rcx, rax
mov rdx, r14
test r10, r10
je 0x1400222b6
mov r9, qword [rbx + 0x158]
mov r8d, dword [rcx + 0xc]
cmp r8, r9
ja 0x140022245
mov eax, dword [rcx + 8]
add eax, r8d
cmp r9, rax
jbe 0x1400222b6
add rcx, 0x28
inc rdx
cmp rdx, r10
jb 0x140022231
jmp 0x1400222b6
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
cmp word [rax], si
jne 0x140022523
movsxd r8, dword [rax + 0x3c]
add r8, rax
cmp dword [r8], 0x4550
jne 0x140022523
movzx eax, word [r8 + 0x14]
lea rcx, [r8 + 0x18]
movzx r10d, word [r8 + 6]
add rcx, rax
mov rdx, r14
test r10, r10
je 0x1400222b6
mov r9, qword [rbx + 0x158]
mov r8d, dword [rcx + 0xc]
cmp r8, r9
ja 0x1400222aa
mov eax, dword [rcx + 8]
add eax, r8d
cmp r9, rax
jbe 0x1400222b6
add rcx, 0x28
inc rdx
cmp rdx, r10
jb 0x140022296
mov esi, dword [rbx + 0x158]
sub esi, dword [rcx + 0xc]
add esi, dword [rcx + 0x14]
test esi, esi
je 0x140022523
xor edx, edx
lea rcx, [rbp - 0x20]
mov r8d, 0x208
call fcn.1400284a0
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 0x1400222f2
mov eax, dword [0x1400612e8]
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 [0x1400612ec]
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 0x140022358
lea eax, [r15 + 4]
jmp 0x1400224f3
mov r9d, 1
xor r8d, r8d
mov edx, esi
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 [rbx + 0x20]
lea rsi, [rsp + 0x70]
nop dword [rax]
mov r8d, r15d
lea rdx, [rsp + 0x60]
mov rcx, rsi
call fcn.1400219f0
mov eax, eax
cmp rax, 5
jne 0x1400223bd
cmp byte [rsi], 0xb8
je 0x1400223c2
add rsi, rax
jmp 0x1400223a0
mov eax, dword [rsi + 1]
xor edx, edx
mov r8d, dword [rbx + 0x2c]
mov r9d, 0x1000
mov dword [rbx + 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 [rbx + 0x30], rax
test rax, rax
jne 0x140022430
mov eax, 5
jmp 0x1400224f3
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
call fcn.14003386c
mov rsi, qword [rbx + 0x30]
cmp dword [rbx + 0x2c], r14d
jbe 0x14002245b
call fcn.140033840
mov byte [r14 + rsi], al
inc r14
mov eax, dword [rbx + 0x2c]
cmp r14, rax
jb 0x140022447
call fcn.140033840
mov ecx, dword [rbx + 0x2c]
xor edx, edx
sub rcx, 0x1d
cdqe
div rcx
mov eax, dword [rbx + 0x160]
mov rcx, qword [rbx + 0x30]
add rcx, rdx
mov dword [rsp + 0x49], eax
movups xmm0, xmmword [rsp + 0x48]
mov qword [rbx + 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 [rbx + 0x170], rcx
movsd qword [rcx], xmm0
mov word [rcx + 8], ax
mov byte [rcx + 0xa], 0xc3
mov eax, dword [rbx + 0x2c]
test eax, eax
je 0x1400224ec
mov rdx, qword [rbx + 0x30]
mov r8d, eax
nop dword [rax + rax]
movzx ecx, byte [rdx]
lea rdx, [rdx + 1]
mov eax, edi
shr edi, 8
xor rcx, rax
movzx eax, cl
xor edi, dword [r12 + rax*4]
sub r8, 1
jne 0x1400224d0
not edi
mov dword [rbx + 0x38], edi
xor eax, eax
mov rcx, qword [rbp + 0x11f0]
xor rcx, rsp
call fcn.140025910
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 0x1400224f3