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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0xb8
mov eax, dword [0x62d040]
xor eax, esp
mov dword [esp + 0xb4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 0x18]
push esi
mov esi, dword [ebp + 0xc]
mov dword [esp + 0x20], eax
mov eax, esi
and eax, 0x3000
mov byte [esp + 0x14], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0xb0], eax
push edi
mov edi, dword [ebp + 8]
cmp eax, 0x3000
jne 0x4f96f4
mov eax, 0xc00000f0
pop edi
pop esi
mov ecx, dword [esp + 0xb4]
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14
cmp dword [edi], 0
jne 0x4f971a
cmp dword [edi + 4], 0
jne 0x4f971a
mov eax, 0xc0000030
pop edi
pop esi
mov ecx, dword [esp + 0xb4]
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14
push 0x48
lea eax, [esp + 0x6c]
push 0
push eax
call fcn.005861d0
mov eax, 1
mov dword [esp + 0x74], 0x48
add esp, 0xc
mov word [esp + 0x98], ax
mov eax, dword [edi + 0x10]
mov dword [esp + 0x94], 1
mov dword [esp + 0x70], eax
test esi, 0x40000
je 0x4f998e
cmp dword ds:[esp + 0xb4], 0
sete al
xor edx, edx
test esi, 0x10000
movzx eax, al
cmove edx, eax
mov dword [esp + 0x1c], edx
test esi, 0x20000
je 0x4f97c2
push 0
push 4
lea eax, [esp + 0xbc]
or esi, 0xffffffff
push eax
push 0x18
push 0xffffffffffffffff
call dword [sym.imp.ntdll.dll_NtQueryInformationProcess]
test eax, eax
mov eax, dword [esp + 0x1c]
movzx edx, al
cmovns esi, dword [esp + 0xb4]
xor ecx, ecx
cmp dword [edi + 0x14], esi
mov esi, dword [ebp + 0xc]
cmovne edx, ecx
mov eax, dword [edi + 0x24]
test eax, eax
je 0x4f97d2
cmp eax, 2
jne 0x4f998e
test dl, dl
je 0x4f998e
xor eax, eax
xorps xmm0, xmm0
mov dword [esp + 0x18], eax
movaps xmmword [esp + 0x30], xmm0
cmp dword [edi + 0x28], eax
jne 0x4f97f4
mov dword [edi + 0x28], 1
mov eax, dword [edi + 4]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x4f9829
push eax
call sym.SystemInformer.exe_Ordinal_1322
mov ecx, dword ds:[esp + 0x1c]
add eax, eax
push 0
mov dword [esp + 0x60], eax
lea eax, [esp + 0x60]
push 0
push eax
mov dword [esp + 0x6c], ecx
call sym.SystemInformer.exe_Ordinal_1331
mov dword [esp + 0x18], eax
or esi, 2
cmp dword [edi + 0xc], 0
cmovne esi, dword [ebp + 0xc]
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
mov esi, dword [esp + 0x18]
cmove edx, ecx
test esi, esi
je 0x4f98a2
mov eax, dword ds:[esi + 4]
jmp 0x4f98a4
xor eax, eax
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esp + 0x6c]
push ecx
push dword [edi + 8]
push dword [edi + 0xc]
push edx
push eax
push dword [edi]
push dword [edi + 0x28]
push dword [edi + 0x20]
push dword [edi + 0x18]
push dword [edi + 0x1c]
call dword [sym.imp.ADVAPI32.dll_CreateProcessWithLogonW]
test eax, eax
je 0x4f98d2
xor edi, edi
jmp 0x4f98f4
cmp dword [0x62db64], 0xffffffff
jae 0x4f98e6
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
jmp 0x4f98ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.SystemInformer.exe_Ordinal_1343
mov edi, eax
test esi, esi
je 0x4f990b
lea ecx, [esi - 8]
or edx, 0xffffffff
lock xadd dword [ecx + 4], edx
dec edx
jne 0x4f990b
call fcn.004fe1e0
test edi, edi
js 0x4f9965
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x4f9924
mov eax, dword [esp + 0x38]
mov dword [ecx], eax
mov eax, dword [esp + 0x3c]
mov dword [ecx + 4], eax
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x30]
test edx, edx
je 0x4f9934
mov dword [edx], eax
jmp 0x4f993f
test eax, eax
je 0x4f993f
push eax
call dword [sym.imp.ntdll.dll_NtClose]
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x34]
test edx, edx
je 0x4f9978
mov dword [edx], eax
mov eax, edi
pop edi
pop esi
mov ecx, dword [esp + 0xb4]
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esp + 0x30]
test eax, eax
je 0x4f9974
push eax
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, dword [esp + 0x34]
nop dword [eax + eax]
test eax, eax
je 0x4f9e06
push eax
jmp 0x4f9dfa
test esi, 0x1000
je 0x4f9a4f
push dword [edi + 0x18]
lea eax, [esp + 0x1c]
push 0x1000
push eax
call sym.SystemInformer.exe_Ordinal_1560
test eax, eax
jns 0x4f99cb
lfence
pop edi
pop esi
mov ecx, dword [esp + 0xb4]
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14
mov ecx, dword [0x635a54]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x14]
push ecx
push 0xf01ff
push eax
mov dword [esp + 0xbc], eax
call dword [sym.imp.ntdll.dll_NtOpenProcessToken]
mov dword [esp + 0xb4], eax
cmp eax, 0xc0000022
jne 0x4f9a23
cmp dword [esp + 0x1c], 5
jne 0x4f9a23
mov ecx, dword [esp + 0xb0]
lea eax, [esp + 0x14]
push eax
mov edx, 0xf01ff
call fcn.00524980
mov dword [esp + 0xb4], eax
push dword [esp + 0x18]
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, dword [esp + 0xb4]
test eax, eax
js 0x4f99b0
mov eax, esi
shr eax, 0x11
and eax, 0xffffff01
mov dword [esp + 0x18], eax
jmp 0x4f9bc8
test esi, 0x2000
je 0x4f9afb
lea eax, [esp + 0xb0]
mov dword [esp + 0x64], 0
push eax
push 0xc
lea eax, [esp + 0x64]
xorps xmm0, xmm0
push eax
push 0xe
push dword [edi + 0x18]
movq qword [esp + 0x70], xmm0
push 0
call dword [sym.imp.WINSTA.dll_WinStationQueryInformationW]
test al, al
jne 0x4f9ae3
cmp dword [0x62db64], 0xffffffff
jae 0x4f9abb
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
push eax
call sym.SystemInformer.exe_Ordinal_1343
pop edi
pop esi
mov ecx, dword [esp + 0xb4]
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14
nop dword [eax + eax]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.SystemInformer.exe_Ordinal_1343
pop edi
pop esi
mov ecx, dword [esp + 0xb4]
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esp + 0x64]
mov dword [esp + 0x14], eax
mov eax, esi
shr eax, 0x11
and al, 1
mov byte [esp + 0x18], al
jmp 0x4f9bc8
mov eax, dword ds:[edi + 0x24]
test eax, eax
jne 0x4f9ba1
mov ecx, dword [edi + 0x18]
mov dword [esp + 0xb4], 2
mov al, byte [ecx]
xor al, 0xe
test al, 0x1f
jne 0x4f9b93
push str.NT_AUTHORITY
push ecx
call fcn.00587d2a
add esp, 8
test eax, eax
jne 0x4f9b9a
mov ecx, dword [edi + 0x1c]
mov al, byte [ecx]
xor al, 0xf3
test al, 0x1f
jne 0x4f9b4d
push str.SYSTEM
push ecx
call fcn.00587d2a
add esp, 8
test eax, eax
je 0x4f9b8c
mov ecx, dword [edi + 0x1c]
mov al, byte [ecx]
xor al, 0xc
test al, 0x1f
jne 0x4f9b6f
push str.LOCAL_SERVICE
push ecx
call fcn.00587d2a
add esp, 8
test eax, eax
je 0x4f9b8c
mov ecx, dword [edi + 0x1c]
mov al, byte [ecx]
xor al, 0xe
test al, 0x1f
jne 0x4f9b9a
push str.NETWORK_SERVICE
push ecx
call fcn.00587d2a
add esp, 8
test eax, eax
jne 0x4f9b9a
mov eax, 5
jmp 0x4f9ba1
mov eax, 2
jmp 0x4f9ba1
mov eax, dword [esp + 0xb4]
lea ecx, [esp + 0x14]
push ecx
push 0
push eax
push dword [edi + 0x20]
push dword [edi + 0x18]
push dword [edi + 0x1c]
call dword [sym.imp.ADVAPI32.dll_LogonUserW]
nop dword [eax + eax]
test eax, eax
je 0x4f9a8c
test esi, 0x10000
je 0x4f9c48
lea eax, [esp + 0xb8]
push eax
push 4
lea eax, [esp + 0xb8]
push eax
push 0x13
push dword [esp + 0x24]
call dword [sym.imp.ntdll.dll_NtQueryInformationToken]
test eax, eax
js 0x4f9c48
mov eax, dword [esp + 0xb0]
lea ecx, [esp + 0x5c]
push ecx
push 4
lea ecx, [esp + 0x24]
mov dword [esp + 0xbc], eax
push ecx
push 8
push eax
call dword [sym.imp.ntdll.dll_NtQueryInformationToken]
test eax, eax
js 0x4f9c3a
cmp dword [esp + 0x1c], 1
jne 0x4f9c3a
push dword [esp + 0x14]
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, dword [esp + 0xb4]
jmp 0x4f9ccc
mov eax, dword [esp + 0xb4]
push eax
call dword [sym.imp.ntdll.dll_NtClose]
cmp byte [esp + 0x18], 0
je 0x4f9cd0
lea eax, ds:[esp + 0x1c]
mov dword [esp + 0x30], 0x18
push eax
push 1
push 0
lea eax, [esp + 0x3c]
mov dword [esp + 0x40], 0
push eax
push 0xf01ff
push dword [esp + 0x28]
mov dword [esp + 0x54], 0
mov dword [esp + 0x50], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
call dword [sym.imp.ntdll.dll_NtDuplicateToken]
push dword [esp + 0x14]
mov dword [esp + 0xb4], eax
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, dword ds:[esp + 0xb0]
test eax, eax
js 0x4f99b0
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x14], eax
test esi, 0x20000
je 0x4f9d2e
mov eax, dword [edi + 0x14]
push 4
mov dword [esp + 0xb4], eax
lea eax, [esp + 0xb4]
push eax
push 0xc
push dword [esp + 0x20]
call dword [sym.imp.ntdll.dll_NtSetInformationToken]
mov dword ds:[esp + 0xb0], eax
test eax, eax
jns 0x4f9d2e
lfence
push dword [esp + 0x14]
call dword [sym.imp.ntdll.dll_NtClose]
mov eax, dword [esp + 0xb0]
pop edi
pop esi
mov ecx, dword [esp + 0xb4]
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14
test esi, 0x80000
je 0x4f9d64
push 4
lea eax, [esp + 0xb4]
mov dword [esp + 0xb4], 1
push eax
push 0x1a
push dword [esp + 0x20]
call dword [sym.imp.ntdll.dll_NtSetInformationToken]
mov dword ds:[esp + 0xb0], eax
test eax, eax
js 0x4f9d04
cmp dword [edi + 0xc], 0
jne 0x4f9d9e
call fcn.005213c0
test eax, eax
je 0x4f9d9e
push 0
push dword [esp + 0x18]
lea eax, [esp + 0x28]
push eax
call fcn.005213c0
mov esi, eax
mov ecx, eax
call dword [0x5a9914]
call esi
cmp dword [esp + 0x20], 0
mov esi, dword [ebp + 0xc]
je 0x4f9d9e
or esi, 2
mov edx, dword [esp + 0x24]
mov eax, dword [edi + 0xc]
test eax, eax
mov ecx, dword [esp + 0x20]
push edx
mov edx, dword [esp + 0x2c]
cmovne ecx, eax
push edx
push dword [esp + 0x34]
lea eax, [esp + 0x74]
push dword [esp + 0x20]
push esi
push eax
push dword [edi + 8]
push ecx
push dword [edi + 4]
push dword [edi]
call sym.SystemInformer.exe_Ordinal_1606
mov edi, eax
call fcn.005214e0
test eax, eax
je 0x4f9df6
mov ecx, dword ds:[esp + 0x20]
test ecx, ecx
je 0x4f9df6
push ecx
call fcn.005214e0
mov esi, eax
mov ecx, eax
call dword [0x5a9914]
call esi
push dword [esp + 0x14]
nop word [eax + eax]
call dword [sym.imp.ntdll.dll_NtClose]
mov ecx, dword [esp + 0xbc]
mov eax, edi
pop edi
pop esi
xor ecx, esp
call fcn.00583f9f
mov esp, ebp
pop ebp
ret 0x14