Function at 0x180040ea0
Capabilities:
Allocate or change rwx memory
Create thread
Hijack thread execution
Resume thread
Spawn thread to rwx shellcode
Suspend thread
Terminate thread

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rsi
push rdi
sub rsp, 0x5a8
mov rax, qword [0x180084090]
xor rax, rsp
mov qword [rsp + 0x590], rax
mov qword [rsp + 0x50], 0
mov byte [rsp + 0x40], 0x48
mov byte [rsp + 0x41], 0xb8
mov byte [rsp + 0x42], 0
mov byte [rsp + 0x43], 0
mov byte [rsp + 0x44], 0
mov byte [rsp + 0x45], 0
mov byte [rsp + 0x46], 0
mov byte [rsp + 0x47], 0
mov byte [rsp + 0x48], 0
mov byte [rsp + 0x49], 0
mov byte [rsp + 0x4a], 0xff
mov byte [rsp + 0x4b], 0xe0
mov r9d, 0x40
mov r8d, 0x3000
mov edx, 0xc
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov qword [rsp + 0x30], rax
cmp qword [rsp + 0x30], 0
je 0x1800413c2
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
je 0x1800413a1
cmp qword [rsp + 0x58], 0xffffffffffffffff
je 0x1800413a1
lea rax, [0x180040d40]
mov qword [rsp + 0x42], rax
lea rsi, [rsp + 0x40]
mov rdi, qword [rsp + 0x30]
mov ecx, 0xc
rep movsb byte [rdi], byte [rsi]
mov qword [rsp + 0x68], 0
mov ecx, 0x38
call fcn.180050744
mov qword [rsp + 0x578], rax
cmp qword [rsp + 0x578], 0
je 0x180040fc5
mov rcx, qword [rsp + 0x578]
call fcn.180040cc0
mov qword [rsp + 0x588], rax
jmp 0x180040fd1
mov qword [rsp + 0x588], 0
mov rax, qword [rsp + 0x588]
mov qword [rsp + 0x570], rax
mov rax, qword [rsp + 0x570]
mov qword [rsp + 0x70], rax
mov rcx, qword [rsp + 0x70]
mov rax, qword [rsp + 0x5d0]
mov qword [rcx + 8], rax
mov rcx, qword [rsp + 0x70]
mov rax, qword [rsp + 0x5d8]
mov qword [rcx + 0x10], rax
mov rcx, qword [rsp + 0x70]
mov rax, qword [rsp + 0x58]
mov qword [rcx + 0x18], rax
mov dword [rsp + 0x84], 0
mov eax, dword [rsp + 0x5e0]
mov dword [rsp + 0x80], eax
mov eax, dword [rsp + 0x5e0]
and eax, 4
cmp eax, 4
jne 0x180041053
mov dword [rsp + 0x84], 1
jmp 0x180041064
mov eax, dword [rsp + 0x80]
or eax, 4
mov dword [rsp + 0x80], eax
mov eax, dword [rsp + 0x80]
and eax, 0x40000000
cmp eax, 0x40000000
je 0x18004108a
mov eax, dword [rsp + 0x80]
or eax, 0x40000000
mov dword [rsp + 0x80], eax
cmp dword [rsp + 0x84], 0
je 0x1800410a9
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rsp + 0x68], rax
mov rcx, qword [rsp + 0x70]
mov rax, qword [rsp + 0x68]
mov qword [rcx + 0x20], rax
mov rcx, qword [rsp + 0x70]
mov eax, dword [rsp + 0x84]
mov dword [rcx + 0x28], eax
mov rax, qword [rsp + 0x70]
mov dword [rax + 0x2c], 0
mov dword [rsp + 0x60], 0
lea rcx, [0x180070ab0]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rcx, rax
call fcn.180040900
mov qword [rsp + 0x78], rax
cmp qword [rsp + 0x78], 0
jne 0x18004111e
lea rcx, str.NTDLL.DLL
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, [0x180070ac8]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x78], rax
cmp qword [rsp + 0x78], 0
je 0x180041160
lea rax, [rsp + 0x60]
mov qword [rsp + 0x28], rax
mov eax, dword [rsp + 0x80]
mov dword [rsp + 0x20], eax
mov r9, qword [rsp + 0x70]
mov r8, qword [rsp + 0x78]
mov rdx, qword [rsp + 0x5c8]
mov rcx, qword [rsp + 0x5c0]
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov qword [rsp + 0x50], rax
cmp qword [rsp + 0x50], 0
je 0x18004136a
cmp qword [rsp + 0x50], 0xffffffffffffffff
je 0x18004136a
mov dword [rsp + 0x88], 0
mov qword [rsp + 0x90], 0
lea rdi, [rsp + 0x98]
xor eax, eax
mov ecx, 0x4c8
rep stosb byte [rdi], al
mov dword [rsp + 0xc0], 0x100001
lea rdx, [rsp + 0x90]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
jne 0x1800411d2
mov dword [rsp + 0x88], 1
jmp 0x180041264
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0x188], rax
lea rdx, [rsp + 0x90]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_SetThreadContext]
test eax, eax
jne 0x180041203
mov dword [rsp + 0x88], 1
jmp 0x180041264
mov dword [rsp + 0x8c], 0
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov dword [rsp + 0x8c], eax
cmp dword [rsp + 0x8c], 0
jg 0x18004120e
cmp dword [rsp + 0x8c], 0
jge 0x180041241
mov dword [rsp + 0x88], 1
jmp 0x180041264
cmp qword [rsp + 0x5e8], 0
je 0x18004125a
mov rcx, qword [rsp + 0x5e8]
mov eax, dword [rsp + 0x60]
mov dword [rcx], eax
xor eax, eax
test eax, eax
jne 0x180041183
cmp dword [rsp + 0x88], 0
je 0x180041294
xor edx, edx
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x50], 0
jmp 0x180041324
mov qword [rsp + 0x560], 0
lea rdi, [rsp + 0x568]
xor eax, eax
mov ecx, 8
rep stosb byte [rdi], al
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x560], rax
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x568], rax
mov r9d, 0xffffffff
xor r8d, r8d
lea rdx, [rsp + 0x560]
mov ecx, 2
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov rax, qword [rsp + 0x70]
cmp dword [rax + 0x2c], 0
jne 0x180041313
xor edx, edx
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x50], 0
lea rdi, [rsp + 0x560]
xor eax, eax
mov ecx, 0x10
rep stosb byte [rdi], al
cmp dword [rsp + 0x84], 0
je 0x18004136a
cmp qword [rsp + 0x50], 0
je 0x180041356
cmp qword [rsp + 0x50], 0xffffffffffffffff
je 0x180041356
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_SuspendThread]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x18004136a
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x68], 0
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x580], rax
mov rcx, qword [rsp + 0x580]
call fcn.18004f750
mov qword [rsp + 0x70], 0
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x58], 0
mov rdi, qword [rsp + 0x30]
xor eax, eax
mov ecx, 0xc
rep stosb byte [rdi], al
mov r8d, 0x8000
xor edx, edx
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rax, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x590]
xor rcx, rsp
call fcn.18004f770
add rsp, 0x5a8
pop rdi
pop rsi
ret