Function at 0x4f52a0
Capabilities:
Create process on windows
Impersonate user

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x8c
mov eax, dword [0x62a040]
xor eax, esp
mov dword [esp + 0x88], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x14]
push edi
mov edi, dword [ebp + 8]
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x18]
push 0x40
mov dword [esp + 0x34], eax
lea eax, [esp + 0x48]
push 0
push eax
mov dword [esp + 0x20], 0
mov dword [esp + 0x4c], 0x44
call fcn.0057e450
mov edx, ebx
mov byte [esp + 0x1c], 0
and edx, 0x3000
add esp, 0xc
cmp edx, 0x3000
jne 0x4f532b
mov eax, 0xc00000f0
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
cmp dword [edi], 0
jne 0x4f5352
cmp dword [edi + 4], 0
jne 0x4f5352
mov eax, 0xc0000030
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
mov dword [esp + 0x6c], 1
mov eax, 1
mov word [esp + 0x70], ax
mov eax, dword [edi + 0x10]
mov dword [esp + 0x48], eax
test ebx, 0x40000
je 0x4f5576
test edx, edx
sete al
xor edx, edx
test ebx, 0x10000
movzx eax, al
cmove edx, eax
mov dword [esp + 0x88], edx
test ebx, 0x20000
je 0x4f53ce
push 0
push 4
lea eax, [esp + 0x94]
or esi, 0xffffffff
push eax
push 0x18
push 0xffffffffffffffff
call dword [sym.imp.ntdll.dll_NtQueryInformationProcess]
test eax, eax
mov eax, dword [esp + 0x88]
movzx edx, al
cmovns esi, dword [esp + 0x8c]
xor ecx, ecx
cmp dword [edi + 0x14], esi
cmovne edx, ecx
mov eax, dword [edi + 0x24]
test eax, eax
je 0x4f53de
cmp eax, 2
jne 0x4f5576
mov edi, edi
test dl, dl
je 0x4f5576
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov eax, dword [edi + 4]
test eax, eax
je 0x4f540f
push eax
call sym.SystemInformer.exe_PhCreateString
mov dword [esp + 0x10], eax
mov esi, ebx
or esi, 2
cmp dword [edi + 0xc], 0
cmovne esi, ebx
mov ebx, dword [esp + 0x10]
mov ecx, esi
mov eax, esi
shr ecx, 5
and ecx, 1
mov edx, ecx
or edx, 2
test al, 0x40
cmove edx, ecx
mov ecx, edx
or ecx, 4
test al, 4
cmove ecx, edx
mov edx, ecx
or edx, 0x10
test al, 0x10
cmove edx, ecx
mov ecx, edx
or ecx, 0x400
test al, 2
cmove ecx, edx
mov edx, ecx
or edx, 0x80000
test al, 0x80
cmove edx, ecx
mov ecx, edx
or ecx, 0x1000000
test al, 8
cmove ecx, edx
mov edx, ecx
or edx, 0x4000000
test esi, 0x100
cmove edx, ecx
test ebx, ebx
je 0x4f5489
mov eax, dword [ebx + 4]
jmp 0x4f548b
xor eax, eax
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x44]
push ecx
push dword [edi + 8]
push dword [edi + 0xc]
push edx
push eax
push dword [edi]
push 1
push dword [edi + 0x20]
push dword [edi + 0x18]
push dword [edi + 0x1c]
call dword [sym.imp.ADVAPI32.dll_CreateProcessWithLogonW]
test eax, eax
je 0x4f54b8
xor esi, esi
jmp 0x4f54c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.SystemInformer.exe_PhDosErrorToNtStatus
mov esi, eax
test ebx, ebx
je 0x4f54de
lea ecx, [ebx - 8]
or edx, 0xffffffff
lock xadd dword [ecx + 4], edx
dec edx
jne 0x4f54de
call fcn.004f9e40
mov edi, edi
test esi, esi
js 0x4f553f
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x4f54f9
mov eax, dword [esp + 0x20]
mov dword [ecx], eax
mov eax, dword [esp + 0x24]
mov dword [ecx + 4], eax
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x18]
test edx, edx
je 0x4f5509
mov dword [edx], eax
jmp 0x4f5514
test eax, eax
je 0x4f5514
push eax
call dword [sym.imp.ntdll.dll_NtClose]
mov edx, dword ds:[esp + 0x30]
mov eax, dword [esp + 0x1c]
test edx, edx
je 0x4f5552
mov dword [edx], eax
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4f554e
push eax
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4f555d
push eax
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
jmp 0x4f5580
test ebx, 0x1000
je 0x4f5656
push dword [edi + 0x18]
lea eax, [esp + 0x14]
push 0x1000
push eax
call sym.SystemInformer.exe_PhOpenProcess
mov edi, edi
test eax, eax
jns 0x4f55be
lfence
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
mov ecx, dword [0x632e50]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x88], ecx
lea ecx, [esp + 0xc]
push ecx
push 0xf01ff
push eax
mov dword [esp + 0x98], eax
call dword [sym.imp.ntdll.dll_NtOpenProcessToken]
mov esi, eax
cmp esi, 0xc0000022
jne 0x4f5613
cmp dword [esp + 0x88], 5
jne 0x4f5613
mov ecx, dword [esp + 0x8c]
lea eax, [esp + 0xc]
push eax
mov edx, 0xf01ff
call fcn.00520dc0
mov esi, eax
push dword [esp + 0x10]
call dword [sym.imp.ntdll.dll_NtClose]
lea ecx, [ecx]
test esi, esi
jns 0x4f5643
lfence
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
mov eax, ebx
shr eax, 0x11
and eax, 0xffffff01
mov dword [esp + 0x10], eax
jmp 0x4f577a
test ebx, 0x2000
je 0x4f56c7
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
lea eax, [esp + 0x88]
push eax
push 0xc
lea eax, [esp + 0x20]
push eax
push 0xe
push dword [edi + 0x18]
push 0
call dword [sym.imp.WINSTA.dll_WinStationQueryInformationW]
test al, al
jne 0x4f56af
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.SystemInformer.exe_PhDosErrorToNtStatus
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esp + 0x20]
mov dword [esp + 0xc], eax
mov eax, ebx
shr eax, 0x11
and al, 1
mov byte [esp + 0x10], al
jmp 0x4f577a
mov esi, dword [edi + 0x24]
test esi, esi
jne 0x4f575b
mov ecx, dword ds:[edi + 0x18]
mov esi, 2
mov al, byte [ecx]
xor al, 0xe
test al, 0x1f
jne 0x4f575b
push str.NT_AUTHORITY
push ecx
call fcn.0057ff9e
add esp, 8
test eax, eax
jne 0x4f575b
mov ecx, dword ds:[edi + 0x1c]
mov al, byte [ecx]
xor al, 0xf3
test al, 0x1f
jne 0x4f5716
push str.SYSTEM
push ecx
call fcn.0057ff9e
add esp, 8
test eax, eax
je 0x4f5756
mov ecx, dword ds:[edi + 0x1c]
mov al, byte [ecx]
xor al, 0xc
test al, 0x1f
jne 0x4f5739
push str.LOCAL_SERVICE
push ecx
call fcn.0057ff9e
add esp, 8
test eax, eax
je 0x4f5756
mov ecx, dword [edi + 0x1c]
mov al, byte ds:[ecx]
xor al, 0xe
test al, 0x1f
jne 0x4f575b
push str.NETWORK_SERVICE
push ecx
call fcn.0057ff9e
add esp, 8
test eax, eax
jne 0x4f575b
mov esi, 5
lea eax, [esp + 0xc]
push eax
push 0
push esi
push dword [edi + 0x20]
push dword [edi + 0x18]
push dword [edi + 0x1c]
call dword [sym.imp.ADVAPI32.dll_LogonUserW]
test eax, eax
je 0x4f568c
lea ebx, [ebx]
test ebx, 0x10000
je 0x4f57f6
lea eax, [esp + 0x90]
push eax
push 4
lea eax, [esp + 0x90]
push eax
push 0x13
push dword [esp + 0x1c]
call dword [sym.imp.ntdll.dll_NtQueryInformationToken]
test eax, eax
js 0x4f57f6
mov esi, dword [esp + 0x88]
lea eax, [esp + 0x3c]
push eax
push 4
lea eax, [esp + 0x94]
push eax
push 8
push esi
call dword [sym.imp.ntdll.dll_NtQueryInformationToken]
test eax, eax
js 0x4f57ef
cmp dword [esp + 0x8c], 1
jne 0x4f57ef
push dword ds:[esp + 0xc]
call dword [sym.imp.ntdll.dll_NtClose]
mov dword [esp + 0xc], esi
jmp 0x4f5879
push esi
call dword [sym.imp.ntdll.dll_NtClose]
cmp byte ds:[esp + 0x10], 0
je 0x4f5879
lea eax, [esp + 0x88]
mov dword [esp + 0x18], 0x18
push eax
push 1
push 0
lea eax, [esp + 0x24]
mov dword [esp + 0x28], 0
push eax
push 0xf01ff
push dword [esp + 0x20]
mov dword [esp + 0x3c], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
call dword [sym.imp.ntdll.dll_NtDuplicateToken]
push dword ds:[esp + 0xc]
mov esi, eax
call dword [sym.imp.ntdll.dll_NtClose]
test esi, esi
js 0x4f5624
mov eax, dword [esp + 0x88]
mov dword [esp + 0xc], eax
lea esp, [esp]
test ebx, 0x20000
je 0x4f58d4
mov eax, dword [edi + 0x14]
push 4
mov dword [esp + 0x8c], eax
lea eax, [esp + 0x8c]
push eax
push 0xc
push dword [esp + 0x18]
call dword [sym.imp.ntdll.dll_NtSetInformationToken]
mov esi, eax
test esi, esi
jns 0x4f58d4
lfence
push dword [esp + 0xc]
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x88]
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14
test ebx, 0x80000
je 0x4f5904
push 4
lea eax, [esp + 0x8c]
mov dword [esp + 0x8c], 1
push eax
push 0x1a
push dword [esp + 0x18]
call dword [sym.imp.ntdll.dll_NtSetInformationToken]
mov esi, eax
test esi, esi
js 0x4f58ae
cmp dword [edi + 0xc], 0
jne 0x4f593b
call fcn.0051e0e0
test eax, eax
je 0x4f593b
push 0
push dword [esp + 0x10]
lea eax, [esp + 0x1c]
push eax
call fcn.0051e0e0
mov esi, eax
mov ecx, eax
call dword [0x5a08ec]
call esi
cmp dword [esp + 0x14], 0
je 0x4f593b
or ebx, 2
mov edx, dword [esp + 0x30]
mov eax, dword [edi + 0xc]
test eax, eax
mov ecx, dword [esp + 0x14]
push edx
mov edx, dword [esp + 0x38]
cmovne ecx, eax
push edx
push dword [esp + 0x40]
lea eax, [esp + 0x4c]
push dword [esp + 0x18]
push ebx
push eax
push dword [edi + 8]
push ecx
push dword [edi + 4]
push dword [edi]
call sym.SystemInformer.exe_PhCreateProcessWin32Ex
mov edi, eax
call fcn.0051e200
test eax, eax
je 0x4f5996
mov ecx, dword ds:[esp + 0x14]
test ecx, ecx
je 0x4f5996
push ecx
call fcn.0051e200
mov esi, eax
mov ecx, eax
call dword [0x5a08ec]
call esi
push dword ds:[esp + 0xc]
call dword [sym.imp.ntdll.dll_NtClose]
mov ecx, dword [esp + 0x94]
mov eax, edi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0057c26f
mov esp, ebp
pop ebp
ret 0x14