Function at 0x1400d5190
Capabilities:
Create thread
Get windows directory from kuser_shared_data
Inject apc
Inject thread
Resume thread

Disassembly:
mov rax, rsp
mov qword [rax + 0x20], r9
mov qword [rax + 0x10], rdx
push rbp
push rbx
push rsi
push r14
lea rbp, [rax - 0x5f]
sub rsp, 0xa8
xor esi, esi
mov qword [rax + 8], rdi
mov qword [rax - 0x28], r12
xor edi, edi
mov qword [rax - 0x38], r15
mov r12, r8
mov rax, qword [rdx]
mov r15, rcx
add rax, 2
mov qword [rbp - 0x11], rsi
mov qword [rbp - 9], rsi
mov qword [rbp - 1], rsi
mov qword [rbp + 0x17], rsi
mov qword [rbp + 7], rsi
mov qword [rbp - 0x19], rsi
mov qword [rbp + 0xf], rax
test r8, r8
je 0x1400d51f4
mov rax, qword [r8]
add rax, 2
mov qword [rbp - 1], rax
mov r9d, 8
mov qword [rsp + 0x20], rsi
lea r8, [rbp + 0x1f]
lea edx, [r9 + 0x12]
call qword [sym.imp.ntdll.dll_NtQueryInformationProcess]
mov ebx, eax
test eax, eax
js 0x1400d521d
cmp qword [rbp + 0x1f], rsi
setne r14b
jmp 0x1400d5222
movzx r14d, byte [rbp + 0x6f]
mov byte [rbp + 0x77], r14b
test eax, eax
js 0x1400d5436
lea rax, str.System32_ntdll.dll
mov qword [rsp + 0x98], r13
test r14b, r14b
lea rdx, str.SysWow64_ntdll.dll
mov ecx, 0x7ffe0030
cmove rdx, rax
call sym.ProcessHacker.exe_PhConcatStrings2
mov r13, rax
lea rdx, str.SysWow64kernel32.dll
lea rax, str.System32kernel32.dll
test r14b, r14b
mov ecx, 0x7ffe0030
cmove rdx, rax
call sym.ProcessHacker.exe_PhConcatStrings2
mov rdx, qword [r13 + 8]
lea r8, str.RtlExitUserThread
mov r14, rax
mov qword [rsp + 0x28], rsi
lea rax, [rbp + 0x17]
xor r9d, r9d
mov rcx, r15
mov qword [rsp + 0x20], rax
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov ebx, eax
mov rsi, r14
mov rdi, r13
test eax, eax
js 0x1400d542e
mov rdx, qword [r14 + 8]
lea rax, [rbp + 7]
mov qword [rsp + 0x28], 0
lea r8, str.SetEnvironmentVariableW
xor r9d, r9d
mov qword [rsp + 0x20], rax
mov rcx, r15
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov ebx, eax
test eax, eax
js 0x1400d542e
mov dword [rsp + 0x28], 4
lea r9, [rbp + 0xf]
xor r8d, r8d
mov dword [rsp + 0x20], 0x1000
lea rdx, [rbp - 0x11]
mov rcx, r15
call qword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov ebx, eax
test eax, eax
js 0x1400d542e
mov r8, qword [rbp + 0x6f]
mov rcx, r15
mov rdx, qword [rbp - 0x11]
mov qword [rsp + 0x20], 0
mov r9, qword [r8]
mov r8, qword [r8 + 8]
call qword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov ebx, eax
test eax, eax
js 0x1400d542e
test r12, r12
je 0x1400d5395
mov dword [rsp + 0x28], 4
lea r9, [rbp - 1]
xor r8d, r8d
mov dword [rsp + 0x20], 0x1000
lea rdx, [rbp - 9]
mov rcx, r15
call qword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov ebx, eax
test eax, eax
js 0x1400d542e
mov r9, qword [r12]
mov rcx, r15
mov r8, qword [r12 + 8]
mov rdx, qword [rbp - 9]
mov qword [rsp + 0x20], 0
call qword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov ebx, eax
test eax, eax
js 0x1400d542e
xor r12d, r12d
lea rax, [rbp - 0x19]
mov qword [rsp + 0x48], r12
xor r9d, r9d
mov qword [rsp + 0x40], rax
mov r8b, 1
mov rax, qword [rbp + 0x17]
xor edx, edx
mov qword [rsp + 0x38], r12
mov rcx, r15
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x20], r12
call qword [sym.imp.ntdll.dll_RtlCreateUserThread]
mov rsi, r14
mov rdi, r13
mov ebx, eax
test eax, eax
js 0x1400d542e
mov r9, qword [rbp - 9]
mov r8, qword [rbp - 0x11]
mov rdx, qword [rbp + 7]
mov rcx, qword [rbp - 0x19]
mov qword [rsp + 0x20], r12
cmp byte [rbp + 0x77], r12b
je 0x1400d53fe
call qword [sym.imp.ntdll.dll_RtlQueueApcWow64Thread]
jmp 0x1400d5404
call qword [sym.imp.ntdll.dll_NtQueueApcThread]
mov ebx, eax
test eax, eax
js 0x1400d542e
mov rcx, qword [rbp - 0x19]
xor edx, edx
call qword [sym.imp.ntdll.dll_NtResumeThread]
mov r8, qword [rbp + 0x7f]
xor edx, edx
mov rcx, qword [rbp - 0x19]
call qword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov rsi, r14
mov rdi, r13
mov ebx, eax
mov r13, qword [rsp + 0x98]
mov rcx, qword [rbp - 0x19]
mov r12, qword [rsp + 0xa0]
test rcx, rcx
je 0x1400d544d
call qword [sym.imp.ntdll.dll_NtClose]
cmp qword [rbp - 0x11], 0
je 0x1400d5473
mov r9d, 0x8000
mov qword [rbp + 0xf], 0
lea r8, [rbp + 0xf]
mov rcx, r15
lea rdx, [rbp - 0x11]
call qword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
cmp qword [rbp - 9], 0
je 0x1400d5499
mov r9d, 0x8000
mov qword [rbp - 1], 0
lea r8, [rbp - 1]
mov rcx, r15
lea rdx, [rbp - 9]
call qword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
mov r15, qword [rsp + 0x90]
or r14d, 0xffffffff
test rdi, rdi
je 0x1400d54c0
lea rcx, [rdi - 0x10]
mov eax, r14d
lock xadd dword [rcx + 8], eax
cmp eax, 1
jne 0x1400d54c0
call fcn.1400c8bc0
mov rdi, qword [rsp + 0xd0]
test rsi, rsi
je 0x1400d54e2
lea rcx, [rsi - 0x10]
lock xadd dword [rcx + 8], r14d
cmp r14d, 1
jne 0x1400d54e2
call fcn.1400c8bc0
mov eax, ebx
add rsp, 0xa8
pop r14
pop rsi
pop rbx
pop rbp
ret