Function at 0x180036e30
Capabilities:
Create thread

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0x108
mov byte [rsp + 0x40], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rsp + 0xb0], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rsp + 0x98], 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 + 0x78]
mov rcx, qword [rsp + 0xb0]
mov r8, rcx
mov rcx, qword [rsp + 0x98]
mov rdx, rcx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x180036ed4
mov edx, 0x100000
mov rcx, qword [rsp + 0x78]
call fcn.180039cc0
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
movzx eax, byte [0x1800a51a0]
test eax, eax
jne 0x180036ef6
movzx eax, byte [0x1800a51a1]
test eax, eax
jne 0x180036eef
call fcn.180038850
mov byte [0x1800a51a0], 1
mov byte [rsp + 0x40], 1
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov dword [rsp + 0x50], 0
jmp 0x180036f1d
mov eax, dword [rsp + 0x50]
inc eax
mov dword [rsp + 0x50], eax
mov eax, dword [0x1800a51b8]
mov dword [rsp + 0x70], eax
mov eax, dword [rsp + 0x70]
cmp dword [rsp + 0x50], eax
jge 0x180036f71
movsxd rax, dword [rsp + 0x50]
mov rcx, qword [0x1800a51b0]
lea rax, [rcx + rax*8]
mov qword [rsp + 0xb8], rax
mov rax, qword [rsp + 0xb8]
mov rax, qword [rax]
mov rdx, qword [rsp + 0x110]
mov rcx, qword [rax]
call fcn.180057434
test eax, eax
jne 0x180036f6f
mov byte [rsp + 0x40], 0
jmp 0x180036f71
jmp 0x180036f13
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
movzx eax, byte [rsp + 0x40]
test eax, eax
je 0x180037333
mov r8d, 0x10
xor edx, edx
lea rcx, [rsp + 0xa0]
call fcn.180056c20
call fcn.1800386d0
lea rdx, [rsp + 0xa0]
mov rcx, qword [rsp + 0x110]
call fcn.180038770
cmp qword [rsp + 0x138], 0
jne 0x180037006
mov ecx, 0x10
call fcn.1800419a0
test rax, rax
je 0x180036fde
mov dword [rsp + 0x60], 1
jmp 0x180036fe6
mov dword [rsp + 0x60], 0
xor r9d, r9d
movzx r8d, byte [rsp + 0x60]
lea rdx, [rsp + 0xc0]
lea rcx, [rsp + 0xe8]
call fcn.18004b360
jmp 0x180037012
mov qword [rsp + 0xe0], 0
mov edx, 0x30
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0x68]
mov dword [rax], 0x30
mov rax, qword [rsp + 0x68]
lea rcx, [rsp + 0xa0]
mov qword [rax + 0x10], rcx
cmp qword [rsp + 0x138], 0
je 0x180037060
mov rax, qword [rsp + 0x138]
mov qword [rsp + 0x88], rax
jmp 0x180037070
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x88], rax
mov rax, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x88]
mov qword [rax + 0x20], rcx
mov qword [rsp + 0x90], 0xffffffffffffffff
mov qword [rsp + 0x20], 0
mov r9d, 0x12c
mov r8d, 0x104
mov rdx, qword [rsp + 0x68]
lea rcx, [rsp + 0x90]
call qword [0x1800a5170]
mov edx, eax
lea rcx, [0x18007aeb0]
call fcn.180036cb0
mov byte [rsp + 0x40], al
mov rcx, qword [rsp + 0xa8]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_LocalFree]
cmp qword [rsp + 0xe0], 0
je 0x1800370f9
mov rcx, qword [rsp + 0xe0]
call qword [sym.imp.KERNEL32.dll_LocalFree]
movzx eax, byte [rsp + 0x40]
test eax, eax
jne 0x180037109
xor al, al
jmp 0x180037338
movzx eax, byte [rsp + 0x40]
test eax, eax
je 0x180037333
lea rcx, str.NtCreatePort_succeeded_n
call fcn.180038890
cmp dword [rsp + 0x128], 0x40
jbe 0x180037137
mov dword [rsp + 0x128], 0x40
mov edx, 0x88
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x48], rax
mov rcx, qword [rsp + 0x110]
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 + 0x110]
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, 0x18
call fcn.180053930
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
je 0x1800371dd
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 + 0x80], rax
jmp 0x1800371e9
mov qword [rsp + 0x80], 0
mov rax, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x80]
mov qword [rax + 0x80], rcx
mov rax, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x118]
mov qword [rax + 8], rcx
mov rax, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x120]
mov qword [rax + 0x10], rcx
mov rax, qword [rsp + 0x48]
mov ecx, dword [rsp + 0x128]
mov dword [rax + 0x18], ecx
mov rax, qword [rsp + 0x48]
mov ecx, dword [rsp + 0x130]
mov dword [rax + 0x1c], ecx
mov rax, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x90]
mov qword [rax + 0x20], 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 + 0x60], rax
mov rax, qword [rsp + 0x48]
add rax, 0x38
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rax, [rsp + 0x74]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
mov r9, qword [rsp + 0x48]
lea r8, [0x180038cc0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, qword [rsp + 0x48]
mov qword [rcx + 0x70], rax
lea rax, [rsp + 0x74]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
mov r9, qword [rsp + 0x48]
lea r8, [0x1800388b0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, qword [rsp + 0x48]
mov qword [rcx + 0x78], rax
mov edx, 7
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov edx, 1
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x78]
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
lea rdx, [rsp + 0x48]
lea rcx, [0x1800a51b0]
call fcn.18003a250
nop
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
movzx eax, byte [rsp + 0x40]
add rsp, 0x108
ret