Function at 0x40d1f6
Capabilities:
Acquire debug privileges
Enumerate services
Query service configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x328
push ebx
push esi
push edi
push 0x3f
xor ebx, ebx
pop ecx
and byte [ebp - 0x228], bl
xor eax, eax
lea edi, [ebp - 0x227]
and byte [ebp - 0x128], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x3f
xor eax, eax
pop ecx
lea edi, [ebp - 0x127]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 1
push str.SeDebugPrivilege
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x1c], ebx
stosb byte es:[edi], al
call fcn.00413886
pop ecx
pop ecx
push 0xf003f
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, dword [sym.imp.KERNEL32.DLL_LocalAlloc]
mov esi, 0x10000
push esi
push 0x40
mov dword [ebp - 0x10], eax
call edi
lea ecx, [ebp - 0x1c]
mov dword [ebp - 8], eax
push ecx
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x28]
push ecx
push esi
push eax
push 3
push 0x30
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
push 0x104
push 0x40
call edi
mov byte [eax], 0x6f
cmp dword [ebp - 0x18], ebx
mov dword [ebp - 0xc], eax
mov dword [ebp - 4], 1
mov dword [ebp - 0x14], ebx
jbe 0x40d561
mov ebx, dword [ebp - 8]
mov esi, dword [sym.imp.KERNEL32.DLL_lstrlenA]
and dword [ebp - 0x24], 0
push 0xf01ff
push dword [ebx]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x40d54d
mov edi, 0x1000
push edi
push 0x40
call dword [sym.imp.KERNEL32.DLL_LocalAlloc]
lea ecx, [ebp - 0x24]
mov dword [ebp - 8], eax
push ecx
push edi
push eax
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
cmp dword [ebx + 0xc], 1
push 0x100
lea eax, [ebp - 0x228]
push 0
push eax
je 0x40d31e
call sub.MSVCRT.dll_memset
mov edi, dword [sym.imp.KERNEL32.DLL_lstrcatA]
add esp, 0xc
lea eax, [ebp - 0x228]
push 0x48aeb0
push eax
call edi
jmp 0x40d33e
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x228]
push 0x48aea8
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcatA]
mov edi, dword [sym.imp.KERNEL32.DLL_lstrcatA]
mov eax, dword [ebp - 8]
cmp dword [eax + 4], 2
jne 0x40d36b
push 0x100
lea eax, [ebp - 0x128]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x128]
push 0x48aea0
push eax
call edi
mov eax, dword [ebp - 8]
cmp dword [eax + 4], 3
jne 0x40d398
push 0x100
lea eax, [ebp - 0x128]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x128]
push 0x48ae98
push eax
call edi
mov eax, dword [ebp - 8]
cmp dword [eax + 4], 4
jne 0x40d3c5
push 0x100
lea eax, [ebp - 0x128]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x128]
push 0x48ae90
push eax
call edi
and byte [ebp - 0x328], 0
push 0x3f
pop ecx
xor eax, eax
lea edi, [ebp - 0x327]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [ebp - 8]
push dword [edi + 0xc]
call esi
test eax, eax
jle 0x40d400
push dword [edi + 0xc]
call esi
push eax
lea eax, [ebp - 0x328]
push dword [edi + 0xc]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebx + 4]
call esi
mov edi, eax
lea eax, [ebp - 0x328]
push eax
call esi
add edi, eax
lea eax, [ebp - 0x128]
push eax
call esi
add edi, eax
lea eax, [ebp - 0x228]
push eax
call esi
push dword [ebx]
add edi, eax
call esi
mov ecx, dword [ebp - 4]
lea eax, [edi + eax + 6]
mov edi, dword [ebp - 0xc]
add ecx, eax
push edi
mov dword [ebp - 8], ecx
call dword [sym.imp.KERNEL32.DLL_LocalSize]
cmp eax, dword [ebp - 8]
jae 0x40d458
push 0x42
push dword [ebp - 8]
push edi
call dword [sym.imp.KERNEL32.DLL_LocalReAlloc]
mov dword [ebp - 0xc], eax
mov edi, eax
push dword [ebx + 4]
call esi
test eax, eax
jle 0x40d479
push dword [ebx + 4]
call esi
inc eax
push eax
mov eax, dword [ebp - 4]
push dword [ebx + 4]
add eax, edi
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebx + 4]
call esi
mov ecx, dword [ebp - 4]
push dword [ebx]
lea eax, [ecx + eax + 1]
mov dword [ebp - 4], eax
call esi
test eax, eax
jle 0x40d4a6
push dword [ebx]
call esi
inc eax
push eax
mov eax, dword [ebp - 4]
push dword [ebx]
add eax, edi
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebx]
call esi
mov ecx, dword [ebp - 4]
lea eax, [ecx + eax + 1]
mov dword [ebp - 4], eax
lea eax, [ebp - 0x328]
push eax
call esi
inc eax
push eax
lea eax, [ebp - 0x328]
push eax
mov eax, dword [ebp - 4]
add eax, edi
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x328]
push eax
call esi
mov ecx, dword [ebp - 4]
lea eax, [ecx + eax + 1]
mov dword [ebp - 4], eax
lea eax, [ebp - 0x228]
push eax
call esi
inc eax
push eax
lea eax, [ebp - 0x228]
push eax
mov eax, dword [ebp - 4]
add eax, edi
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x228]
push eax
call esi
mov ecx, dword [ebp - 4]
lea eax, [ecx + eax + 1]
mov dword [ebp - 4], eax
lea eax, [ebp - 0x128]
push eax
call esi
inc eax
push eax
lea eax, [ebp - 0x128]
push eax
mov eax, dword [ebp - 4]
add eax, edi
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x128]
push eax
call esi
mov ecx, dword [ebp - 4]
lea eax, [ecx + eax + 1]
mov dword [ebp - 4], eax
inc dword [ebp - 0x14]
add ebx, 0x24
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x18]
jb 0x40d2ad
xor ebx, ebx
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push 0x42
push dword [ebp - 4]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_LocalReAlloc]
push ebx
push str.SeDebugPrivilege
mov esi, eax
call fcn.00413886
pop ecx
mov eax, esi
pop ecx
pop edi
pop esi
pop ebx
leave
ret