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

Disassembly:
sub esp, 0x22c
push ebx
push ebp
push esi
push edi
push 1
push str.SeDebugPrivilege
call fcn.00419b70
mov esi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
add esp, 8
xor edi, edi
push 0x104
push 0x40
mov dword [esp + 0x1c], edi
mov dword [esp + 0x30], edi
call esi
mov ebx, eax
push 4
push edi
push edi
mov dword [esp + 0x24], ebx
mov byte [ebx], 0x75
mov dword [esp + 0x1c], 1
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebp, eax
lea eax, [esp + 0x28]
lea ecx, [esp + 0x24]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x18]
push ecx
push edx
push eax
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
push 3
push 0x30
push ebp
mov dword [esp + 0x50], ebp
call edi
mov ecx, dword [esp + 0x14]
push ecx
push 0x40
call esi
mov esi, eax
lea edx, [esp + 0x28]
lea eax, [esp + 0x24]
push edx
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x18]
push eax
push ecx
push edx
push esi
push 3
push 0x30
push ebp
mov dword [esp + 0x54], esi
call edi
mov eax, dword [esp + 0x24]
mov dword [esp + 0x2c], 0
test eax, eax
jbe 0x41856a
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [esp + 0x1c], esi
mov eax, dword [esi]
push 1
push eax
push ebp
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov edi, eax
test edi, edi
mov dword [esp + 0x38], edi
je 0x418546
lea ecx, [esp + 0x14]
mov dword [esp + 0x14], 0
push ecx
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
mov edx, dword [esp + 0x14]
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, dword [esp + 0x14]
mov ebp, eax
lea eax, [esp + 0x14]
push eax
push ecx
push ebp
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
lea edx, [esp + 0x14]
mov dword [esp + 0x14], 0
push edx
push 0
push 0
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfig2A]
mov eax, dword [esp + 0x14]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x14]
push ecx
push edx
push eax
push 1
push edi
mov dword [esp + 0x34], eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfig2A]
mov eax, dword [ebp + 4]
cmp eax, 2
jne 0x4182d1
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x3c]
push 0x50dbac
rep stosd dword es:[edi], eax
lea eax, [esp + 0x40]
push eax
jmp 0x41830b
cmp eax, 3
jne 0x4182ef
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x3c]
push 0x50dba4
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x40]
push ecx
jmp 0x41830b
cmp eax, 4
jne 0x418311
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x3c]
lea edx, [esp + 0x3c]
push 0x50db9c
push edx
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov eax, dword [esi + 0xc]
mov ecx, 0x40
cmp eax, 1
je 0x41833e
xor eax, eax
lea edi, [esp + 0x13c]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x13c]
push 0x50db94
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
jmp 0x418349
xor eax, eax
lea edi, [esp + 0x13c]
rep stosd dword es:[edi], eax
mov ecx, dword [esi]
push ecx
call ebx
mov edx, dword [ebp + 0xc]
mov edi, eax
push edx
call ebx
add edi, eax
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
push ecx
call ebx
lea edx, [esp + 0x13c]
add edi, eax
push edx
call ebx
add edi, eax
lea eax, [esp + 0x3c]
push eax
call ebx
mov ecx, dword [esi + 4]
add edi, eax
push ecx
call ebx
mov edx, dword [esp + 0x10]
lea eax, [edi + eax + 6]
lea edi, [eax + edx]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LocalSize]
cmp eax, edi
jae 0x4183aa
mov ecx, dword [esp + 0x18]
push 0x42
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_LocalReAlloc]
mov dword [esp + 0x18], eax
mov edx, dword [esi + 4]
push edx
call ebx
test eax, eax
jle 0x4183dd
mov eax, dword [esi + 4]
push eax
call ebx
mov edx, dword [esp + 0x10]
mov esi, dword [esi + 4]
mov ecx, eax
mov eax, dword [esp + 0x18]
inc ecx
lea edi, [edx + eax]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x1c]
mov eax, dword [esi + 4]
push eax
call ebx
mov ecx, dword [esp + 0x10]
mov edi, dword [esp + 0x20]
lea edx, [ecx + eax + 1]
mov eax, dword [edi]
push eax
mov dword [esp + 0x14], edx
call ebx
test eax, eax
jle 0x418427
mov ecx, dword [edi]
push ecx
call ebx
mov edx, dword [esp + 0x18]
mov esi, dword [edi]
mov ecx, eax
mov eax, dword [esp + 0x10]
inc ecx
lea edi, [eax + edx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
mov eax, dword [edi]
push eax
call ebx
mov ecx, dword [esp + 0x10]
mov edx, dword [esi]
push edx
lea edi, [ecx + eax + 1]
mov dword [esp + 0x14], edi
call ebx
test eax, eax
jle 0x418467
mov eax, dword [esi]
push eax
call ebx
mov edx, dword [esp + 0x18]
mov esi, dword [esi]
mov ecx, eax
add edi, edx
inc ecx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x10]
mov esi, dword [esp + 0x1c]
mov ecx, dword [esi]
push ecx
call ebx
lea edx, [esp + 0x3c]
lea edi, [edi + eax + 1]
push edx
mov dword [esp + 0x14], edi
call ebx
mov ecx, eax
mov eax, dword [esp + 0x18]
inc ecx
lea esi, [esp + 0x3c]
mov edx, ecx
add edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x3c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call ebx
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x13c]
push edx
lea edi, [ecx + eax + 1]
mov dword [esp + 0x14], edi
call ebx
mov ecx, eax
mov eax, dword [esp + 0x18]
inc ecx
lea esi, [esp + 0x13c]
mov edx, ecx
add edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x13c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call ebx
mov ecx, dword [esp + 0x10]
mov edx, dword [ebp + 0xc]
push edx
lea edi, [ecx + eax + 1]
mov dword [esp + 0x14], edi
call ebx
test eax, eax
jle 0x418515
mov eax, dword [ebp + 0xc]
push eax
call ebx
mov edx, dword [esp + 0x18]
mov esi, dword [ebp + 0xc]
mov ecx, eax
add edi, edx
inc ecx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x10]
mov ecx, dword [ebp + 0xc]
push ecx
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
lea edx, [edi + eax + 1]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x10], edx
push eax
call esi
push ebp
call esi
mov ecx, dword [esp + 0x38]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ebp, dword [esp + 0x30]
mov esi, dword [esp + 0x1c]
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x24]
inc eax
add esi, 0x24
cmp eax, ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], esi
jb 0x41821e
mov esi, dword [esp + 0x34]
mov ebx, dword [esp + 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push ebp
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [esp + 0x10]
push 0x42
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_LocalReAlloc]
push 0
push str.SeDebugPrivilege
mov esi, eax
call fcn.00419b70
add esp, 8
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x22c
ret