Function at 0x10031520
Capabilities:
Enumerate processes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x254
mov eax, dword [0x10086e84]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ecx + 0xc]
test eax, eax
push esi
lea esi, [ecx + 0xc]
push edi
mov dword [ebp - 0x23c], ecx
je 0x10031552
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi], 0
push 0
mov edi, 1
push 2
mov dword [ebp - 0x244], edi
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x248], esi
je 0x100318d6
push 0x228
lea eax, [ebp - 0x22c]
push 0
push eax
mov dword [ebp - 0x250], edi
call fcn.10042010
add esp, 0xc
lea ecx, [ebp - 0x230]
push ecx
push esi
mov dword [ebp - 0x230], 0x22c
call sub.KERNEL32.dll_Process32FirstW
test eax, eax
je 0x100318b3
push ebx
jmp 0x100315c0
xor ebx, ebx
cmp dword [ebp - 0x250], ebx
je 0x100318b2
mov edx, dword [ebp - 0x228]
push edx
push ebx
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
xor esi, esi
cmp eax, ebx
mov dword [ebp - 0x254], eax
mov dword [ebp - 0x238], ebx
je 0x10031605
lea ecx, [ebp - 0x238]
push ecx
push 0xa
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x234], ebx
je 0x1003166f
mov eax, dword [ebp - 0x238]
mov edi, dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
lea edx, [ebp - 0x234]
push edx
push ebx
push ebx
push 1
push eax
call edi
mov esi, eax
test esi, esi
jne 0x1003166f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x1003166f
mov eax, dword [ebp - 0x234]
test eax, eax
je 0x1003166f
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebx, eax
test ebx, ebx
je 0x1003166f
mov edx, dword [ebp - 0x234]
mov eax, dword [ebp - 0x238]
lea ecx, [ebp - 0x234]
push ecx
push edx
push ebx
push 1
push eax
call edi
mov esi, eax
xor edi, edi
test esi, esi
je 0x1003183b
mov edx, dword [ebp - 0x238]
lea ecx, [ebp - 0x234]
push ecx
push edi
push edi
push 6
push edx
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov esi, eax
test esi, esi
jne 0x100316e3
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x100316db
mov eax, dword [ebp - 0x234]
test eax, eax
je 0x100316db
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
test edi, edi
je 0x100316db
mov ecx, dword [ebp - 0x234]
mov edx, dword [ebp - 0x238]
lea eax, [ebp - 0x234]
push eax
push ecx
push edi
push 6
push edx
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov esi, eax
test esi, esi
je 0x1003183b
test ebx, ebx
je 0x10031837
mov eax, dword [ebx]
test eax, eax
je 0x10031837
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x10031837
mov ecx, dword [ebx]
lea eax, [ebp - 0x240]
push eax
push ecx
mov dword [ebp - 0x240], 0
call sub.ADVAPI32.dll_ConvertSidToStringSidW
mov esi, eax
test esi, esi
je 0x10031826
mov eax, dword [ebp - 0x240]
test eax, eax
je 0x10031837
cmp word [eax], 0
je 0x1003182c
mov edx, dword [ebp - 0x23c]
mov ecx, dword [edx + 8]
push ecx
push eax
call fcn.10042b4e
add esp, 8
test eax, eax
jne 0x10031826
mov eax, dword [ebp - 0x23c]
mov edx, dword [ebp - 0x238]
add eax, 0xc
push eax
push 1
push 2
push 0
push 0x2000000
push edx
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
mov esi, eax
test esi, esi
je 0x10031801
mov eax, dword [ebp - 0x234]
push eax
mov eax, dword [ebp - 0x23c]
mov ecx, dword [eax + 0xc]
push edi
add eax, 0xc
push 6
push ecx
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov esi, eax
test esi, esi
je 0x10031801
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea edx, [ebp - 0x24c]
push edx
push eax
mov dword [ebp - 0x24c], 0
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
mov esi, eax
test esi, esi
je 0x10031801
push 4
lea eax, [ebp - 0x24c]
push eax
mov eax, dword [ebp - 0x23c]
mov ecx, dword [eax + 0xc]
add eax, 0xc
push 0xc
push ecx
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov esi, eax
test esi, esi
je 0x10031801
xor eax, eax
mov dword [ebp - 0x250], eax
mov dword [ebp - 0x244], eax
jmp 0x10031826
mov eax, dword [ebp - 0x23c]
add eax, 0xc
mov eax, dword [eax]
test eax, eax
je 0x10031826
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x23c]
add eax, 0xc
mov dword [eax], 0
mov eax, dword [ebp - 0x240]
test eax, eax
je 0x10031837
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
jne 0x10031855
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1003184f
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x244], eax
test ebx, ebx
je 0x10031860
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
test edi, edi
je 0x1003186b
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x238]
test eax, eax
je 0x10031886
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x238], 0
mov eax, dword [ebp - 0x254]
test eax, eax
je 0x10031897
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x248]
lea edx, [ebp - 0x230]
push edx
push eax
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x100315c0
pop ebx
mov ecx, dword [ebp - 0x248]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x244]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10041ffa
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x100318ea
and eax, 0xffff
or eax, 0x80070000
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.10041ffa
mov esp, ebp
pop ebp
ret