Function at 0x4010e0
Capabilities:
Acquire debug privileges
Create process on windows
Enumerate processes
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x401dcc
mov eax, dword fs:[0]
push eax
sub esp, 0x200
mov eax, dword [0x403004]
xor eax, esp
mov dword [esp + 0x1f8], eax
push ebx
push esi
push edi
mov eax, dword [0x403004]
xor eax, esp
push eax
lea eax, [esp + 0x210]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push str.Kernel32.dll
mov dword [esp + 0x44], eax
mov dword [esp + 0x3c], ecx
call esi
push str.wtsapi32.dll
mov dword [esp + 0x30], eax
call esi
xor ebx, ebx
push ebx
push 2
mov edi, eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x30], ebx
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov esi, eax
cmp esi, 0xffffffff
je 0x4012dc
lea edx, [esp + 0xdc]
push edx
push esi
mov dword [esp + 0xe4], 0x128
call sub.KERNEL32.dll_Process32First
test eax, eax
je 0x4012dc
jmp 0x401190
lea eax, [esp + 0x100]
push str.winlogon.exe
push eax
call dword [sym.imp.MSVCR80.dll__stricmp]
add esp, 8
test eax, eax
jne 0x4011cb
mov edx, dword [esp + 0xe4]
lea ecx, [esp + 0x14]
push ecx
push edx
mov dword [esp + 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
je 0x4011cb
cmp dword [esp + 0x14], ebx
jne 0x4011df
lea eax, [esp + 0xdc]
push eax
push esi
call sub.KERNEL32.dll_Process32Next
test eax, eax
jne 0x401190
jmp 0x4011ea
mov ecx, dword [esp + 0xe4]
mov dword [esp + 0x44], ecx
lea ecx, [esp + 0xc0]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
push str.winlogon.exe
lea ecx, [esp + 0xc4]
mov dword [esp + 0x21c], 0
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_char_const__]
test edi, edi
je 0x4012c4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40126e
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WTSGetActiveConsoleSessionId
push eax
call esi
push str.WTSQueryUserToken
push edi
mov dword [esp + 0x20], eax
call esi
push str.WTSEnumerateSessionsA
push edi
mov ebx, eax
call esi
push str.WTSFreeMemory
push edi
mov dword [esp + 0x28], eax
call esi
cmp dword [esp + 0x20], 0
mov dword [esp + 0x28], eax
je 0x4012c4
cmp dword [esp + 0x18], 0
je 0x4012c4
test ebx, ebx
je 0x4012c4
test eax, eax
je 0x4012c4
call dword [esp + 0x18]
mov esi, eax
push 0
mov dword [esp + 0x38], esi
mov dword [esp + 0x40], 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea edx, [esp + 0x48]
push edx
push esi
call ebx
test eax, eax
jne 0x40133c
mov dword [esp + 0x18], eax
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x28]
push ecx
push 1
push 0
push 0
call dword [esp + 0x34]
test eax, eax
jne 0x401302
mov edx, dword [esp + 0x2c]
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
push edx
call esi
push edi
call esi
lea ecx, [esp + 0xc0]
mov dword [esp + 0x218], 0xffffffff
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
xor eax, eax
mov ecx, dword [esp + 0x210]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1f8]
xor ecx, esp
call fcn.004015f6
mov esp, ebp
pop ebp
ret
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor edi, edi
cmp dword [esp + 0x18], edi
jbe 0x401333
xor esi, esi
mov ecx, dword [esp + 0x24]
mov edx, dword [esi + ecx]
lea eax, [esp + 0x3c]
push eax
push edx
call ebx
add edi, 1
add esi, 0xc
cmp edi, dword [esp + 0x18]
jb 0x401314
mov esi, dword [esp + 0x34]
mov eax, dword [esp + 0x24]
push eax
call dword [esp + 0x2c]
push 0x44
lea ecx, [esp + 0x78]
push 0
push ecx
mov ebx, 0x30
call sub.MSVCR80.dll_memset
mov edx, dword [esp + 0x50]
add esp, 0xc
xor eax, eax
push edx
push eax
push 0x2000000
mov dword [esp + 0x80], 0x44
mov dword [esp + 0x88], str.winsta0default
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov edi, eax
lea eax, [esp + 0x30]
push eax
push 0x201eb
push edi
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
lea ecx, [esp + 0x4c]
push ecx
push str.SeDebugPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
mov edx, dword [esp + 0x4c]
mov eax, dword [esp + 0x50]
lea ecx, [esp + 0x1c]
push ecx
push 1
push 1
push 0
mov dword [esp + 0x78], edx
mov edx, dword [esp + 0x40]
push 0x2000000
push edx
mov dword [esp + 0x7c], 1
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], 2
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
mov eax, dword [esp + 0x1c]
push 4
push esi
push 0xc
push eax
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov edx, dword [esp + 0x1c]
xor esi, esi
push esi
push esi
push 0x10
lea ecx, [esp + 0x70]
push ecx
push esi
push edx
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0x1c]
push 1
push eax
lea ecx, [esp + 0x1c]
push ecx
mov dword [esp + 0x20], esi
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x40143f
mov ebx, 0x430
jmp 0x401443
mov dword [esp + 0x14], esi
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x54]
push edx
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x78]
push eax
push esi
push ecx
push ebx
mov ebx, dword [esp + 0x54]
push esi
push esi
push esi
mov esi, dword [esp + 0x58]
push esi
push ebx
push edx
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserA]
test eax, eax
jne 0x401487
push esi
push ebx
push str.Create_Failed_AppFile_is__s_Command_is__s_n
call dword [sym.imp.MSVCR80.dll_printf]
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4014b4
push esi
mov esi, dword [sym.imp.MSVCR80.dll_printf]
push ebx
push str.AppFile_is__s_Command_is__s_n
call esi
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Create_process_as_user_error:__d_n
call esi
add esp, 8
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
test edi, edi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x4014cc
push edi
call esi
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4014d7
push eax
call esi
mov eax, dword [esp + 0x48]
test eax, eax
je 0x4014e2
push eax
call esi
mov eax, dword [esp + 0x30]
test eax, eax
je 0x4014ed
push eax
call esi
lea ecx, [esp + 0xc0]
mov dword [esp + 0x218], 0xffffffff
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov eax, 1
jmp 0x4012de