Function at 0x180020cdc
Capabilities:
Access pe header
Check os version
Encode data using xor

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x70
mov r8, qword gs:[0x30]
mov rdi, rdx
mov rbp, rcx
mov rax, qword [r8 + 0x30]
mov esi, 1
cmp qword [r8 + 0x28], rax
jne 0x180020d1d
and qword [r8 + 0x28], 0
mov r12d, esi
jmp 0x180020d20
xor r12d, r12d
lea rcx, [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
xor r8d, r8d
mov edx, 0x400000
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_HeapCreate]
test rax, rax
mov qword [0x1800339a8], rax
jne 0x180020d4f
lea ebx, [rax + 8]
jmp 0x180020f94
mov rax, qword [rsp + 0x38]
xor r9d, r9d
xor r8d, r8d
shr rax, 8
mov edx, esi
xor ecx, ecx
mov dword [0x180033960], eax
call qword [sym.imp.KERNEL32.dll_CreateEventA]
test rax, rax
mov qword [0x180033bb0], rax
je 0x180020dd7
call qword [sym.imp.KERNEL32.dll_GetVersion]
cmp al, 5
jne 0x180020d8f
movzx ecx, ax
shr cx, 8
jne 0x180020d91
cmp al, al
jbe 0x180020dd0
mov dword [0x180033b94], eax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
xor edx, edx
mov ecx, 0x10047a
mov r8d, eax
mov qword [0x180033ba0], rbp
mov dword [0x180033b90], eax
call qword [sym.imp.KERNEL32.dll_OpenProcess]
or rcx, 0xffffffffffffffff
test rax, rax
cmove rax, rcx
xor ebx, ebx
mov qword [0x180033b88], rax
jmp 0x180020ddf
mov ebx, 0x32
jmp 0x180020ddf
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jne 0x180020f94
lea r8, [rsp + 0xc8]
lea rdx, [rsp + 0xc0]
mov rcx, rbp
call fcn.18001f1ac
test eax, eax
mov ebx, eax
jne 0x180020f4e
mov r13d, dword [rsp + 0xc8]
mov esi, dword [rsp + 0xc0]
mov edi, eax
mov eax, r13d
test r13d, 0xfff
lea r9d, [rbx + 4]
setne dil
shr eax, 0xc
add rsi, rbp
add edi, eax
xor ecx, ecx
mov r8d, 0x3000
mov edx, edi
mov qword [rsp + 0x40], rsi
shl edx, 0xc
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
test rax, rax
mov rbp, rax
mov qword [rsp + 0x48], rax
je 0x180020f3c
xor r15d, r15d
test edi, edi
je 0x180020f07
mov r13d, dword [rsp + 0xc0]
mov r14, rax
mov rbp, rsi
sub r14, rsi
lea rsi, [0x180000000]
mov rax, qword [rsi + 0x2d798]
lea rcx, [rsp + 0x58]
add r15d, 1
mov qword [rcx], rax
mov eax, dword [rsi + 0x2d7a0]
lea rdx, [r14 + rbp]
mov dword [rcx + 8], eax
mov eax, dword [rsp + 0x58]
mov ecx, r15d
xor eax, dword [rsp + 0x5c]
mov r8d, 0x1000
mov dword [rsp + 0x20], 1
lea r9d, [rax + r13 + 9]
shr r9d, cl
mov rcx, rbp
call fcn.1800119b4
mov eax, dword [r14 + rsi + 0x361bc]
add rbp, 0x1000
sub eax, dword [r14 + rsi + 0x361b8]
add eax, dword [r14 + rsi + 0x361b4]
cmp r15d, edi
mov dword [0x180033bc8], eax
jb 0x180020e80
mov rsi, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x48]
mov r13d, dword [rsp + 0xc8]
jmp 0x180020f0d
mov eax, dword [0x180033bc8]
cmp eax, 0x63699bc3
jne 0x180020f24
mov r8d, r13d
mov rdx, rbp
mov rcx, rsi
call sub.ntdll.dll_memcpy
jmp 0x180020f29
mov ebx, 0xc
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x180020f41
mov ebx, 8
mov rdi, qword [rsp + 0xb8]
mov esi, 1
test ebx, ebx
jne 0x180020f94
lea rdx, [0x180033ba8]
xor r8d, r8d
xor ecx, ecx
call fcn.18001a948
test eax, eax
setne bl
test ebx, ebx
jne 0x180020f94
mov ecx, dword [0x180033b90]
xor edx, edx
call fcn.18000e9c8
mov ecx, dword [0x180033b98]
test eax, eax
cmovne ecx, esi
mov dword [0x180033b98], ecx
mov rcx, rdi
call fcn.1800272c4
mov ebx, eax
test r12d, r12d
je 0x180020ff2
mov r9d, 8
lea rax, [rsp + 0x30]
lea r8, [rsp + 0x50]
lea edx, [r9 + 1]
mov rcx, 0xfffffffffffffffe
mov qword [rsp + 0x20], rax
call qword [sym.imp.ntdll.dll_NtQueryInformationThread]
test eax, eax
js 0x180020ff2
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov rcx, rax
mov rdi, rax
call qword [sym.imp.ntdll.dll_RtlImageNtHeader]
test rax, rax
je 0x180020ff2
mov ecx, dword [rax + 0x28]
add rcx, rdi
cmp qword [rsp + 0x50], rcx
jne 0x180020ff2
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_ExitThread]
mov eax, ebx
mov rbx, qword [rsp + 0xb0]
add rsp, 0x70
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret