Function at 0x401790
Capabilities:
Acquire debug privileges
Create process on windows
Enumerate processes

Disassembly:
sub esp, 0x6c8
mov eax, dword [0x539050]
xor eax, esp
mov dword [esp + 0x6c4], eax
mov eax, dword [esp + 0x6cc]
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x2c], eax
xor ebp, ebp
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
push ebp
push 2
mov esi, eax
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov edi, eax
cmp edi, 0xffffffff
je 0x401ab2
lea ecx, [esp + 0xa0]
push ecx
push edi
mov dword [esp + 0xa8], 0x22c
call sub.KERNEL32.dll_Process32FirstW
test eax, eax
je 0x401ab2
mov ebx, dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
jmp 0x401800
lea edx, [esp + 0xc4]
push str.winlogon.exe
push edx
call fcn.00404f68
add esp, 8
test eax, eax
jne 0x401836
mov ecx, dword [esp + 0xa8]
lea eax, [esp + 0x20]
push eax
push ecx
mov dword [esp + 0x28], ebp
call ebx
test eax, eax
je 0x401836
cmp dword [esp + 0x20], esi
je 0x40184a
lea edx, [esp + 0xa0]
push edx
push edi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x401800
jmp 0x401851
mov ebp, dword [esp + 0xa8]
push 0x1fe
xor ebx, ebx
lea ecx, [esp + 0x2d6]
xor eax, eax
push ebx
push ecx
mov word [esp + 0x2dc], ax
call fcn.00406000
mov eax, str.winsta0default
add esp, 0xc
mov dword [esp + 0x18], ebx
lea ecx, [eax + 1]
nop
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x401880
push 0xffffffffffffffff
sub eax, ecx
push str.winsta0default
inc eax
push eax
lea edx, [esp + 0x2dc]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.004052ac
add esp, 0x14
lea ecx, [esp + 0x28]
push ecx
push esi
call sub.WTSAPI32.dll_WTSQueryUserToken
push 0x44
lea edx, [esp + 0x5c]
push ebx
push edx
call fcn.00406000
add esp, 0xc
push ebp
lea eax, [esp + 0x2d4]
mov dword [esp + 0x64], eax
xor eax, eax
push ebx
push 0x2000000
mov dword [esp + 0x64], 0x44
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
call dword [sym.imp.KERNEL32.dll_OpenProcess]
lea ecx, [esp + 0x24]
push ecx
mov edi, eax
push 0x201eb
push edi
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x401924
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Process_token_open_Error:__ld
call fcn.00403270
add esp, 8
jmp 0x401ab2
lea edx, [esp + 0x30]
push edx
push str.SeDebugPrivilege
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x401952
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Lookup_Privilege_value_Error:__ld
call fcn.00403270
add esp, 8
jmp 0x401ab2
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
lea edx, [esp + 0x14]
push edx
push 1
push 1
push ebx
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x34]
push 0x2000000
push eax
mov dword [esp + 0x60], 1
mov dword [esp + 0x68], ecx
mov dword [esp + 0x6c], 2
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
mov ecx, dword [esp + 0x14]
push 4
push esi
push 0xc
push ecx
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov eax, dword [esp + 0x14]
push ebx
push ebx
push 0x10
lea edx, [esp + 0x54]
push edx
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x4019cd
call ebp
push eax
push str.Adjust_Privilege_value_Error:__ld
call fcn.00403270
add esp, 8
call ebp
cmp eax, 0x514
jne 0x4019e5
mov eax, str.Token_does_not_have_the_provilege
call fcn.00403250
jmp 0x401ab2
mov ecx, dword [esp + 0x14]
push 1
push ecx
lea edx, [esp + 0x24]
push edx
mov dword [esp + 0x28], ebx
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x401a94
push 0x1fe
lea ecx, [esp + 0x4d6]
xor eax, eax
push ebx
push ecx
mov word [esp + 0x4dc], ax
call fcn.00406000
mov eax, str.cmd.exe
add esp, 0xc
lea edx, [eax + 1]
jmp 0x401a30
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401a30
sub eax, edx
push 0xffffffffffffffff
push str.cmd.exe
inc eax
push eax
lea edx, [esp + 0x4dc]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.004052ac
mov eax, dword [esp + 0x30]
add esp, 0x14
lea ecx, [esp + 0x38]
push ecx
mov ecx, dword [esp + 0x30]
lea edx, [esp + 0x5c]
push edx
mov edx, dword [esp + 0x1c]
push ebx
push eax
push 0x430
push ebx
push ebx
push ebx
push ecx
push ebx
push edx
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov esi, eax
call ebp
cmp esi, ebx
jne 0x401a94
mov eax, str.create_process_as_user_error
call fcn.00403250
jmp 0x401ab2
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call esi
mov eax, dword [esp + 0x28]
push eax
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
mov edx, dword [esp + 0x24]
push edx
call esi
mov ecx, dword [esp + 0x6d4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
mov eax, 1
call fcn.004047dd
add esp, 0x6c8
ret