Function at 0x180008670
Capabilities:
Create thread

Disassembly:
mov dword [rsp + 0x20], r9d
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0xe8
mov byte [rsp + 0x40], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rsp + 0xa8], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rsp + 0x88], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsp + 0x30], 2
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
lea r9, [rsp + 0x70]
mov rcx, qword [rsp + 0xa8]
mov r8, rcx
mov rcx, qword [rsp + 0x88]
mov rdx, rcx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x180008714
mov edx, 0x100000
mov rcx, qword [rsp + 0x70]
call fcn.180006c70
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
movzx eax, byte [0x18004cad8]
test eax, eax
jne 0x180008736
movzx eax, byte [0x18004cad9]
test eax, eax
jne 0x18000872f
call fcn.18000a770
mov byte [0x18004cad8], 1
mov byte [rsp + 0x40], 1
lea rcx, [0x18004cb00]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov dword [rsp + 0x50], 0
jmp 0x18000875d
mov eax, dword [rsp + 0x50]
inc eax
mov dword [rsp + 0x50], eax
mov eax, dword [0x18004caf0]
mov dword [rsp + 0x6c], eax
mov eax, dword [rsp + 0x6c]
cmp dword [rsp + 0x50], eax
jge 0x1800087b1
movsxd rax, dword [rsp + 0x50]
mov rcx, qword [0x18004cae8]
lea rax, [rcx + rax*8]
mov qword [rsp + 0x90], rax
mov rax, qword [rsp + 0x90]
mov rax, qword [rax]
mov rdx, qword [rsp + 0xf0]
mov rcx, qword [rax]
call fcn.180024424
test eax, eax
jne 0x1800087af
mov byte [rsp + 0x40], 0
jmp 0x1800087b1
jmp 0x180008753
lea rcx, [0x18004cb00]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
movzx eax, byte [rsp + 0x40]
test eax, eax
je 0x180008b18
mov r8d, 0x10
xor edx, edx
lea rcx, [rsp + 0x98]
call fcn.180024170
call fcn.180007a30
lea rdx, [rsp + 0x98]
mov rcx, qword [rsp + 0xf0]
call fcn.180007950
call fcn.1800124c0
movzx eax, al
test eax, eax
je 0x180008815
lea rcx, [rsp + 0xb0]
call fcn.180012560
jmp 0x180008841
mov edx, 1
lea rcx, [rsp + 0xb0]
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
xor r9d, r9d
xor r8d, r8d
mov edx, 1
lea rcx, [rsp + 0xb0]
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
mov edx, 0x30
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x60], rax
mov rax, qword [rsp + 0x60]
mov dword [rax], 0x30
mov rax, qword [rsp + 0x60]
lea rcx, [rsp + 0x98]
mov qword [rax + 0x10], rcx
mov rax, qword [rsp + 0x60]
lea rcx, [rsp + 0xb0]
mov qword [rax + 0x20], rcx
mov qword [rsp + 0x80], 0xffffffffffffffff
mov qword [rsp + 0x20], 0
mov r9d, 0x12c
mov r8d, 0x104
mov rdx, qword [rsp + 0x60]
lea rcx, [rsp + 0x80]
call qword [0x18004cab0]
mov edx, eax
lea rcx, [0x180031908]
call fcn.180007b50
mov byte [rsp + 0x40], al
mov rcx, qword [rsp + 0xa0]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_LocalFree]
cmp qword [rsp + 0xd0], 0
je 0x1800088fb
mov rcx, qword [rsp + 0xd0]
call qword [sym.imp.KERNEL32.dll_LocalFree]
movzx eax, byte [rsp + 0x40]
test eax, eax
jne 0x18000890b
xor al, al
jmp 0x180008b1d
movzx eax, byte [rsp + 0x40]
test eax, eax
je 0x180008b18
lea rcx, str.NtCreatePort_succeeded_n
call fcn.180007b70
cmp dword [rsp + 0x100], 0x40
jbe 0x180008939
mov dword [rsp + 0x100], 0x40
mov edx, 0x80
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x48], rax
mov rcx, qword [rsp + 0xf0]
call qword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
cdqe
mov rdx, rax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rcx, qword [rsp + 0x48]
mov qword [rcx], rax
mov rdx, qword [rsp + 0xf0]
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, 0x18
call fcn.180022b4c
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
je 0x1800089dc
mov rax, qword [rsp + 0x58]
mov qword [rax], 0
mov rax, qword [rsp + 0x58]
mov dword [rax + 8], 0
mov rax, qword [rsp + 0x58]
mov dword [rax + 0xc], 0
mov rax, qword [rsp + 0x58]
mov byte [rax + 0x10], 0
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x78], rax
jmp 0x1800089e5
mov qword [rsp + 0x78], 0
mov rax, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x78]
mov qword [rax + 0x78], rcx
mov rax, qword [rsp + 0x48]
mov rcx, qword [rsp + 0xf8]
mov qword [rax + 8], rcx
mov rax, qword [rsp + 0x48]
mov ecx, dword [rsp + 0x100]
mov dword [rax + 0x10], ecx
mov rax, qword [rsp + 0x48]
mov ecx, dword [rsp + 0x108]
mov dword [rax + 0x14], ecx
mov rax, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x80]
mov qword [rax + 0x18], rcx
xor r9d, r9d
mov r8d, 0x7fffffff
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
mov rcx, qword [rsp + 0x48]
mov qword [rcx + 0x58], rax
mov rax, qword [rsp + 0x48]
add rax, 0x30
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
mov r9, qword [rsp + 0x48]
lea r8, [0x180008160]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, qword [rsp + 0x48]
mov qword [rcx + 0x68], rax
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
mov r9, qword [rsp + 0x48]
lea r8, [0x180007d70]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, qword [rsp + 0x48]
mov qword [rcx + 0x70], rax
mov edx, 7
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x68]
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov edx, 1
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
lea rcx, [0x18004cb00]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
lea rdx, [rsp + 0x48]
lea rcx, [0x18004cae8]
call fcn.18000a970
nop
lea rcx, [0x18004cb00]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
movzx eax, byte [rsp + 0x40]
add rsp, 0xe8
ret