Function at 0x4c4840
Capabilities:
Create thread
Inject apc
Inject thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, edx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x2c], eax
push ebx
push esi
mov eax, dword [eax]
add eax, 2
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 8], 0
push edi
test eax, eax
je 0x4c4892
mov eax, dword [eax]
add eax, 2
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x34]
push eax
call sym.ProcessHacker.exe_PhGetSystemRoot
mov ebx, dword [ebp - 0x34]
push dword [0x5b1d70]
lea esi, [ebx + 0x26]
lea eax, [esi + 0xa]
push eax
call sym.ProcessHacker.exe_PhCreateObject
mov edi, eax
xor eax, eax
lea ecx, [edi + 8]
mov dword [ebp - 4], edi
push ebx
mov ebx, dword [ebp - 0x30]
mov dword [edi + 4], ecx
mov dword [edi], esi
mov word [ecx + esi], ax
push ebx
push dword [edi + 4]
call fcn.00521a30
mov edi, dword [edi + 4]
mov ecx, 9
mov eax, dword [ebp - 0x34]
mov esi, str.System32_ntdll.dll
add edi, eax
add esp, 0xc
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
push dword [0x5b1d70]
lea esi, [eax + 0x2c]
lea eax, [esi + 0xa]
push eax
call sym.ProcessHacker.exe_PhCreateObject
mov edi, eax
xor eax, eax
lea ecx, [edi + 8]
mov dword [ebp - 0x24], edi
mov dword [edi], esi
mov dword [edi + 4], ecx
mov word [ecx + esi], ax
mov esi, dword [ebp - 0x34]
push esi
push ebx
push dword [edi + 4]
call fcn.00521a30
mov edi, dword [edi + 4]
lea eax, [ebp - 0x1c]
mov ebx, dword [ebp - 0x28]
add esp, 0xc
add edi, esi
mov ecx, 0xb
mov esi, str.System32kernel32.dll
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp - 4]
push 0
push eax
push 0
push str.RtlExitUserThread
push dword [edi + 4]
push ebx
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov esi, eax
test esi, esi
js 0x4c4a72
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x24]
push 0
push str.SetEnvironmentVariableW
lfence
push dword [eax + 4]
push ebx
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov esi, eax
test esi, esi
js 0x4c4a72
push 4
push 0x1000
lea eax, [ebp - 0x18]
push eax
push 0
lea eax, [ebp - 0xc]
push eax
push ebx
lfence
call dword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov esi, eax
test esi, esi
js 0x4c4a72
mov eax, dword [ebp - 0x2c]
push 0
lfence
push dword [eax]
push dword [eax + 4]
push dword [ebp - 0xc]
push ebx
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x4c4a72
mov edi, dword [ebp + 8]
test edi, edi
je 0x4c4a0f
push 4
push 0x1000
lea eax, [ebp - 0x14]
push eax
push 0
lea eax, [ebp - 0x10]
push eax
push ebx
lfence
call dword [sym.imp.ntdll.dll_NtAllocateVirtualMemory]
mov esi, eax
test esi, esi
js 0x4c4a6f
push 0
lfence
push dword [edi]
push dword [edi + 4]
push dword [ebp - 0x10]
push ebx
call dword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
mov esi, eax
test esi, esi
js 0x4c4a6f
push 0
lea eax, [ebp - 8]
push eax
push 0
lfence
push dword [ebp - 0x1c]
push 0
push 0
push 0
push 1
push 0
push ebx
call dword [sym.imp.ntdll.dll_RtlCreateUserThread]
mov esi, eax
test esi, esi
js 0x4c4a6f
push 0
push dword [ebp - 0x10]
push dword [ebp - 0xc]
push dword [ebp - 0x20]
push dword [ebp - 8]
call dword [sym.imp.ntdll.dll_NtQueueApcThread]
mov esi, eax
test esi, esi
js 0x4c4a6f
push 0
push dword [ebp - 8]
call dword [sym.imp.ntdll.dll_NtAlertResumeThread]
mov esi, eax
test esi, esi
js 0x4c4a6f
push dword [ebp + 0xc]
push 0
push dword [ebp - 8]
call dword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov esi, eax
mov edi, dword [ebp - 4]
mov eax, dword [ebp - 8]
test eax, eax
je 0x4c4a86
push eax
call dword [sym.imp.ntdll.dll_NtClose]
cmp dword [ebp - 0xc], 0
je 0x4c4aa7
push 0x8000
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0
push eax
lea eax, [ebp - 0xc]
push eax
push ebx
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
cmp dword [ebp - 0x10], 0
je 0x4c4ac8
push 0x8000
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
lea eax, [ebp - 0x10]
push eax
push ebx
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
lea ecx, [edi - 8]
or edi, 0xffffffff
mov eax, edi
lock xadd dword [ecx + 4], eax
dec eax
jne 0x4c4add
call fcn.004b3960
mov ecx, dword [ebp - 0x24]
add ecx, 0xfffffff8
lock xadd dword [ecx + 4], edi
dec edi
jne 0x4c4af0
call fcn.004b3960
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8