Function at 0x405890
Capabilities:
Create thread

Disassembly:
mov rax, rsp
sub rsp, 0x108
mov qword [rsp + 0x80], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rsi
mov qword [rax - 8], rdi
mov rax, qword [0x006443a8]
xor rax, rsp
mov qword [rsp + 0xf0], rax
mov edi, edx
mov rbx, rcx
mov qword [rsp + 0x78], 7
xor esi, esi
mov qword [rsp + 0x70], rsi
mov word [rsp + 0x60], si
xor r8d, r8d
lea edx, [rsi + 0x25]
lea rcx, [rsp + 0x58]
call fcn.005118a0
lea rcx, [rsp + 0x60]
mov rdx, qword [rsp + 0x78]
cmp rdx, 8
cmovae rcx, qword [rsp + 0x60]
add rdx, rdx
lea r9d, [rsi + 0x4a]
lea r8, str.CProcessRegistrationToken::Initialize
call fcn.00568a50
mov qword [rsp + 0x70], SafeArrayAllocDescriptorEx
lea rax, [rsp + 0x60]
cmp qword [rsp + 0x78], 8
cmovae rax, qword [rsp + 0x60]
mov word [rax + 0x4a], si
mov r8d, 0x80000000
lea rdx, [rsp + 0x58]
lea rcx, [rsp + 0x90]
call fcn.0044a650
nop
cmp qword [rsp + 0x78], 8
jb 0x40595e
mov rcx, qword [rsp + 0x60]
call fcn.00568830
mov qword [rsp + 0x78], 7
mov qword [rsp + 0x70], rsi
mov word [rsp + 0x60], 0
mov dword [rbx + 0x10], edi
mov r8d, edi
xor edx, edx
mov ecx, 0x100000
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov qword [rbx + 0x28], rax
test rax, rax
jne 0x405a6f
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], rsi
mov word [rsp + 0x38], ax
xor r8d, r8d
lea edx, [rax + 0x12]
lea rcx, [rsp + 0x30]
call fcn.005118a0
lea rcx, [rsp + 0x38]
mov rdx, qword [rsp + 0x50]
cmp rdx, 8
cmovae rcx, qword [rsp + 0x38]
add rdx, rdx
mov r9d, SafeArrayAllocDescriptorEx
lea r8, str.Failed_OpenProcess
call fcn.00568a50
mov qword [rsp + 0x48], SafeArrayUnlock
lea rax, [rsp + 0x38]
cmp qword [rsp + 0x50], 8
cmovae rax, qword [rsp + 0x38]
mov word [rax + 0x24], 0
mov r8d, 0x80000000
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0x90]
call fcn.004493c0
nop
cmp qword [rsp + 0x50], 8
jb 0x405a2a
mov rcx, qword [rsp + 0x38]
call fcn.00568830
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x405a3c
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x405a4a
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx eax, ax
or eax, 0x80070000
mov edx, eax
lea rcx, [rsp + 0x90]
call fcn.00445a10
mov ebx, eax
lea rcx, [rsp + 0x90]
call fcn.0044a9c0
mov eax, ebx
jmp 0x405cc3
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rbx + 0x30], rax
test rax, rax
jne 0x405b79
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x28], rsi
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], rsi
mov word [rsp + 0x38], 0
xor r8d, r8d
lea edx, [r8 + 0x12]
lea rcx, [rsp + 0x30]
call fcn.005118a0
lea rcx, [rsp + 0x38]
mov rdx, qword [rsp + 0x50]
cmp rdx, 8
cmovae rcx, qword [rsp + 0x38]
add rdx, rdx
mov r9d, SafeArrayAllocDescriptorEx
lea r8, str.Failed_CreateEvent
call fcn.00568a50
mov qword [rsp + 0x48], SafeArrayUnlock
lea rax, [rsp + 0x38]
cmp qword [rsp + 0x50], 8
cmovae rax, qword [rsp + 0x38]
mov word [rax + 0x24], 0
mov r8d, 0x80000000
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0x90]
call fcn.004493c0
nop
cmp qword [rsp + 0x50], 8
jb 0x405b34
mov rcx, qword [rsp + 0x38]
call fcn.00568830
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x405b46
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x405b54
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx eax, ax
or eax, 0x80070000
mov edx, eax
lea rcx, [rsp + 0x90]
call fcn.00445a10
mov ebx, eax
lea rcx, [rsp + 0x90]
call fcn.0044a9c0
mov eax, ebx
jmp 0x405cc3
lea rax, [rbx + 0x20]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], esi
mov r9, rbx
lea r8, [0x00405700]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov qword [rbx + 0x18], rax
test rax, rax
jne 0x405c9f
mov rcx, qword [rbx + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x30], rsi
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x28], rsi
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], rsi
mov word [rsp + 0x38], 0
xor r8d, r8d
lea edx, [r8 + 0x13]
lea rcx, [rsp + 0x30]
call fcn.005118a0
lea rcx, [rsp + 0x38]
mov rdx, qword [rsp + 0x50]
cmp rdx, 8
cmovae rcx, qword [rsp + 0x38]
add rdx, rdx
mov r9d, SafeArrayAllocDescriptorEx
lea r8, str.Failed_CreateThread
call fcn.00568a50
mov qword [rsp + 0x48], reloc.OLEAUT32.dll_SafeArrayGetLBound
lea rax, [rsp + 0x38]
cmp qword [rsp + 0x50], 8
cmovae rax, qword [rsp + 0x38]
mov word [rax + 0x26], 0
mov r8d, 0x80000000
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0x90]
call fcn.004493c0
nop
cmp qword [rsp + 0x50], 8
jb 0x405c5d
mov rcx, qword [rsp + 0x38]
call fcn.00568830
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x405c6f
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x405c7d
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx eax, ax
or eax, 0x80070000
mov edx, eax
lea rcx, [rsp + 0x90]
call fcn.00445a10
mov ebx, eax
lea rcx, [rsp + 0x90]
call fcn.0044a9c0
mov eax, ebx
jmp 0x405cc3
mov byte [rbx + 0x38], 0
xor edx, edx
lea rcx, [rsp + 0x90]
call fcn.00445a10
mov ebx, eax
lea rcx, [rsp + 0x90]
call fcn.0044a9c0
mov eax, ebx
mov rcx, qword [rsp + 0xf0]
xor rcx, rsp
call fcn.00568fb0
mov rbx, qword [rsp + 0x120]
mov rsi, qword [rsp + 0x128]
mov rdi, qword [rsp + 0x100]
add rsp, 0x108
ret