Function at 0x1004f790
Capabilities:
Acquire debug privileges
Enumerate processes
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24c
mov eax, dword [0x1022b584]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
cmp dword [eax - 0xc], ebx
je 0x1004f9c9
push ebx
push 2
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov dword [ebp - 0x248], eax
cmp eax, 0xffffffff
je 0x1004f9c9
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea eax, [ebp - 0x244]
push edi
push eax
push 0x28
call esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1004f827
lea eax, [ebp - 0x10]
push eax
push str.SeDebugPrivilege
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
push ebx
push ebx
push ebx
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 1
push eax
push ebx
push dword [ebp - 0x244]
mov dword [ebp - 8], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push dword [ebp - 0x244]
call edi
push 0x228
lea eax, [ebp - 0x23c]
push 0
push eax
call fcn.1018d4b0
add esp, 0xc
mov dword [ebp - 0x240], 0x22c
lea eax, [ebp - 0x240]
push eax
push dword [ebp - 0x248]
call sub.KERNEL32.dll_Process32FirstW
test eax, eax
je 0x1004f96a
lea eax, [ebp - 0x21c]
push eax
push dword [ebp + 8]
call fcn.1019694f
add esp, 8
test eax, eax
jne 0x1004f94a
mov esi, dword [ebp - 0x238]
lea eax, [ebp - 0x244]
push eax
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x1004f8da
lea eax, [ebp - 0x10]
push eax
push str.SeDebugPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
push 0
push 0
push 0
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 1
push eax
push 0
push dword [ebp - 0x244]
mov dword [ebp - 8], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push dword [ebp - 0x244]
call edi
push esi
push 0
push 0x1f0fff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
xor edi, edi
cmp esi, 0xffffffff
je 0x1004f93b
test esi, esi
je 0x1004f93b
lea eax, [ebp - 0x24c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
cmp dword [ebp - 0x24c], 0x103
jne 0x1004f930
push 1
push esi
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
test eax, eax
je 0x1004f930
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
mov eax, 1
cmove edi, eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
jne 0x1004f93f
test ebx, ebx
je 0x1004f944
mov ebx, 1
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x240]
push eax
push dword [ebp - 0x248]
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x1004f861
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push dword [ebp - 0x248]
call edi
lea eax, [ebp - 0x244]
push eax
push 0x28
call esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x1004f9c7
lea eax, [ebp - 0x10]
push eax
push str.SeDebugPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
push 0
push 0
push 0
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 1
push eax
push 0
push dword [ebp - 0x244]
mov dword [ebp - 8], 0
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push dword [ebp - 0x244]
call edi
pop edi
pop esi
mov eax, dword [ebp + 8]
or ecx, 0xffffffff
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x1004f9e4
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov ecx, dword [ebp - 4]
mov eax, ebx
xor ecx, ebp
pop ebx
call fcn.101799ce
mov esp, ebp
pop ebp
ret