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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, edx
mov dword [ebp - 8], 0
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x24], eax
mov eax, dword [eax]
push esi
add eax, 2
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], eax
push edi
mov edi, ecx
test ebx, ebx
je 0x4ae221
mov eax, dword [ebx]
add eax, 2
mov dword [ebp - 0x10], eax
push str.System32_ntdll.dll
push 0x7ffe0030
call sym.ProcessHacker.exe_PhConcatStrings2
push str.System32kernel32.dll
mov esi, eax
push 0x7ffe0030
mov dword [ebp - 0x28], esi
call sym.ProcessHacker.exe_PhConcatStrings2
push 0
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x18]
push eax
push 0
push str.RtlExitUserThread
push dword [esi + 4]
push edi
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov esi, eax
test esi, esi
js 0x4ae35c
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x20]
push 0
push str.SetEnvironmentVariableW
push dword [eax + 4]
push edi
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov esi, eax
test esi, esi
js 0x4ae35c
push 4
push 0x1000
lea eax, [ebp - 0x14]
push eax
push 0
lea eax, [ebp - 8]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov esi, eax
test esi, esi
js 0x4ae35c
mov eax, dword [ebp - 0x24]
push 0
push dword [eax]
push dword [eax + 4]
push dword [ebp - 8]
push edi
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x4ae35c
test ebx, ebx
je 0x4ae303
push 4
push 0x1000
lea eax, [ebp - 0x10]
push eax
push 0
lea eax, [ebp - 0xc]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov esi, eax
test esi, esi
js 0x4ae35c
push 0
push dword [ebx]
push dword [ebx + 4]
push dword [ebp - 0xc]
push edi
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x4ae35c
push 0
lea eax, [ebp - 4]
push eax
push 0
push dword [ebp - 0x18]
push 0
push 0
push 0
push 1
push 0
push edi
call dword [sym.imp.ntdll.dll_RtlCreateUserThread]
mov esi, eax
test esi, esi
js 0x4ae35c
push 0
push dword [ebp - 0xc]
push dword [ebp - 8]
push dword [ebp - 0x1c]
push 0
push dword [ebp - 4]
call dword [sym.imp.ntdll.dll_NtQueueApcThreadEx]
mov esi, eax
test esi, esi
js 0x4ae35c
push 0
push dword [ebp - 4]
call dword [sym.imp.ntdll.dll_NtResumeThread]
push dword [ebp + 0xc]
push 0
push dword [ebp - 4]
call dword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov esi, eax
mov eax, dword [ebp - 4]
test eax, eax
je 0x4ae36a
push eax
call dword [sym.imp.ntdll.dll_NtClose]
cmp dword [ebp - 8], 0
je 0x4ae38b
push 0x8000
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
lea eax, [ebp - 8]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
cmp dword [ebp - 0xc], 0
je 0x4ae3ac
push 0x8000
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 0
push eax
lea eax, [ebp - 0xc]
push eax
push edi
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
mov ecx, dword [ebp - 0x28]
or edi, 0xffffffff
add ecx, 0xfffffff8
mov eax, edi
lock xadd dword [ecx + 4], eax
dec eax
jne 0x4ae3c4
call fcn.004a2a20
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x4ae3db
lea ecx, [eax - 8]
lock xadd dword [ecx + 4], edi
dec edi
jne 0x4ae3db
call fcn.004a2a20
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8