Function at 0x4d5120
Capabilities:
Create thread
Inject apc
Inject thread
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
xor eax, eax
mov dword [ebp - 0x34], edx
mov dword [ebp - 4], eax
mov dword [ebp - 0x18], eax
mov eax, dword [edx]
add eax, 2
mov dword [ebp - 0x30], ecx
push ebx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 8], 0
push esi
push edi
test eax, eax
je 0x4d5178
mov eax, dword [eax]
add eax, 2
mov dword [ebp - 0x14], eax
lea eax, ds:[ebp - 0x3c]
push eax
call sym.ProcessHacker.exe_PhGetSystemRoot
mov ebx, dword [ebp - 0x3c]
push dword [0x5cd4f8]
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 - 0x28], edi
push ebx
mov ebx, dword [ebp - 0x38]
mov dword [edi + 4], ecx
mov dword [edi], esi
mov word [ecx + esi], ax
push ebx
push dword [edi + 4]
call fcn.00537fe0
mov edi, dword [edi + 4]
mov ecx, 9
mov eax, dword [ebp - 0x3c]
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 [0x5cd4f8]
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 - 0x2c], edi
mov dword [edi], esi
mov dword [edi + 4], ecx
mov word [ecx + esi], ax
mov esi, dword [ebp - 0x3c]
push esi
push ebx
push dword [edi + 4]
call fcn.00537fe0
mov edi, dword [edi + 4]
lea eax, [ebp - 0x20]
mov ebx, dword [ebp - 0x30]
add esp, 0xc
add edi, esi
mov ecx, 0xb
mov esi, str.System32kernel32.dll
rep movsd dword es:[edi], dword [esi]
push 0
push eax
mov eax, dword [ebp - 0x28]
push 0
push str.RtlExitUserThread
push dword [eax + 4]
push ebx
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov esi, eax
test esi, esi
js 0x4d5389
push 0
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x2c]
push 0
push str.SetEnvironmentVariableW
lfence
push dword [eax + 4]
push ebx
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov esi, eax
test esi, esi
js 0x4d5389
push 4
push 0x1000
lea eax, [ebp - 0x1c]
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 0x4d5389
mov eax, dword [ebp - 0x34]
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 0x4d5389
mov edi, dword [ebp + 8]
test edi, edi
je 0x4d52fb
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 0x4d5389
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 0x4d5389
cmp dword [0x5c7aa8], 0x3e
jb 0x4d531d
lea edx, [ebp - 0x18]
mov ecx, ebx
lfence
call fcn.004dc5a0
mov esi, eax
test esi, esi
js 0x4d5384
mov eax, dword [ebp - 0x18]
mov dword [ebp - 4], eax
push 0
lea eax, [ebp - 8]
push eax
push 0
lfence
push dword [ebp - 0x20]
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 0x4d537f
push 0
push dword [ebp - 0x10]
push dword [ebp - 0xc]
push dword [ebp - 0x24]
push dword [ebp - 8]
call dword [sym.imp.ntdll.dll_NtQueueApcThread]
mov esi, eax
test esi, esi
js 0x4d537f
push 0
push dword [ebp - 8]
call dword [sym.imp.ntdll.dll_NtResumeThread]
mov esi, eax
test esi, esi
js 0x4d537f
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]
jmp 0x4d538b
mov edi, dword [ebp - 0x18]
jmp 0x4d538b
xor edi, edi
mov eax, dword [ebp - 8]
test eax, eax
je 0x4d5399
push eax
call dword [sym.imp.ntdll.dll_NtClose]
test edi, edi
je 0x4d53cd
xor eax, eax
mov dword [ebp - 0x44], edi
push eax
push eax
mov dword [ebp - 0x3c], eax
mov byte [ebp - 0x3c], al
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x44]
push 0x10
push eax
push 0x2c
mov dword [ebp - 0x40], 3
call dword [sym.imp.ntdll.dll_NtPowerInformation]
push edi
call dword [sym.imp.ntdll.dll_NtClose]
cmp dword [ebp - 0xc], 0
je 0x4d53ee
push 0x8000
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
lea eax, [ebp - 0xc]
push eax
push ebx
call dword [sym.imp.ntdll.dll_NtFreeVirtualMemory]
cmp dword [ebp - 0x10], 0
je 0x4d540f
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]
mov ecx, dword ds:[ebp - 0x28]
or edi, 0xffffffff
add ecx, 0xfffffff8
mov eax, edi
lock xadd dword [ecx + 4], eax
dec eax
jne 0x4d5428
call fcn.004c1f60
mov ecx, dword [ebp - 0x2c]
add ecx, 0xfffffff8
lock xadd dword [ecx + 4], edi
dec edi
jne 0x4d543b
call fcn.004c1f60
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8