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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x8c
mov eax, dword [0x1002a4d0]
xor eax, esp
mov dword [esp + 0x88], eax
push ebx
push esi
push edi
lea eax, [esp + 0x38]
mov dword [esp + 0x10], edx
push eax
lea eax, [esp + 0x44]
mov dword [esp + 0x18], ecx
push eax
xor ebx, ebx
push 1
push ebx
push ebx
mov edi, ebx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x4c], ebx
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsW]
mov cl, bl
cmp dword [esp + 0x38], ebx
jbe 0x100079f1
mov edx, dword [esp + 0x40]
mov eax, ebx
imul eax, eax, 0xc
cmp dword [eax + edx + 8], ebx
je 0x100079e8
inc cl
movsx eax, cl
cmp eax, dword [esp + 0x38]
jb 0x100079d2
jmp 0x100079f1
movsx eax, cl
imul eax, eax, 0xc
mov edi, dword [eax + edx]
push str.Wtsapi32.dll
mov dword [esp + 0x40], ebx
mov esi, ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
je 0x10007a75
push str.WTSQueryUserToken
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x10007a75
lea ecx, [esp + 0x18]
push ecx
push edi
call eax
test eax, eax
jne 0x10007a8c
lea edx, [esp + 0x38]
mov dword [esp + 0x38], ebx
mov ecx, edi
call fcn.10007848
test eax, eax
je 0x10007a75
cmp dword [esp + 0x38], ebx
je 0x10007a75
push dword [esp + 0x38]
push ebx
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
test esi, esi
je 0x10007a75
lea eax, [esp + 0x18]
push eax
push 0xf00ff
push esi
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x10007a8c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x94]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.100099f1
mov esp, ebp
pop ebp
ret
cmp dword [esp + 0x18], ebx
je 0x10007a75
lea eax, [esp + 0x3c]
push eax
push 4
lea eax, [esp + 0x2c]
push eax
push 0x13
push dword [esp + 0x28]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov ebx, 0x2000000
test eax, eax
jne 0x10007ae1
lea eax, [esp + 0x40]
push eax
push str.SeDebugPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
lea eax, [esp + 0x1c]
push eax
push 1
push 1
push 0
push ebx
push dword [esp + 0x2c]
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
mov eax, dword [esp + 0x1c]
jmp 0x10007ae9
mov eax, dword [esp + 0x24]
mov dword [esp + 0x1c], eax
and dword [esp + 0x20], 0
push 1
push eax
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x10007b07
mov ebx, 0x2000400
jmp 0x10007b0c
and dword [esp + 0x20], 0
push 0x44
pop edi
push edi
lea eax, [esp + 0x4c]
push 0
push eax
call fcn.1000dc70
mov eax, dword [esp + 0x1c]
add esp, 0xc
mov dword [esp + 0x48], edi
mov dword [esp + 0x74], 1
cmp byte [eax], 0
je 0x10007b39
push 5
pop eax
jmp 0x10007b3b
xor eax, eax
mov word [esp + 0x78], ax
lea edi, [esp + 0x28]
xor eax, eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov edi, dword [esp + 0x14]
push edi
call fcn.10007485
pop ecx
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x4c]
push eax
xor eax, eax
push eax
push dword [esp + 0x2c]
push ebx
push eax
push eax
push eax
push edi
push eax
push dword [esp + 0x44]
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
cmp dword [esp + 0x28], 0
mov ebx, eax
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x10007b91
push dword [esp + 0x2c]
call edi
push dword [esp + 0x28]
call edi
cmp dword [esp + 0x1c], 0
je 0x10007b9e
push dword [esp + 0x1c]
call edi
test esi, esi
je 0x10007ba5
push esi
call edi
cmp dword [esp + 0x18], 0
je 0x10007bb2
push dword [esp + 0x18]
call edi
cmp dword [esp + 0x20], 0
je 0x10007bc3
push dword [esp + 0x20]
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
mov eax, ebx
jmp 0x10007a77