Function at 0x509220
Capabilities:
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x562836
mov eax, dword fs:[0]
push eax
sub esp, 0x574
mov eax, dword [0x5b228c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x558], eax
mov dword [ebp - 0x578], 0
mov dword [ebp - 0x574], 0
mov dword [ebp - 0x570], 0
push 8
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionNetworkCards
push reloc.OLEAUT32.dll_SysReAllocString
lea ecx, [ebp - 0x578]
mov dword [ebp - 4], 0
call fcn.00508340
mov edi, dword [ebp - 0x578]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x509595
push 0x64
lea eax, [ebp - 0x74]
push 0
push eax
call fcn.0050b0c0
push 0x64
lea eax, [ebp - 0xd8]
push 0
push eax
call fcn.0050b0c0
add esp, 0x18
xor ebx, ebx
nop dword [eax]
lea eax, [ebp - 0x580]
mov dword [ebp - 0x568], 0x104
push eax
push 0
push 0
push 0
lea eax, [ebp - 0x568]
push eax
lea eax, [ebp - 0x54c]
push eax
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x50952f
mov dword [ebp - 0x564], eax
mov dword [ebp - 0x55c], eax
mov dword [ebp - 0x550], eax
lea eax, [ebp - 0x550]
push eax
push 1
push 0
lea eax, [ebp - 0x54c]
mov byte [ebp - 4], 1
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [ebp - 0x560], 0
test eax, eax
jne 0x509521
mov edi, dword [ebp - 0x550]
lea eax, [ebp - 0x550]
push eax
lea eax, [ebp - 0x344]
mov dword [ebp - 0x564], edi
push eax
lea eax, [ebp - 0x56c]
mov dword [ebp - 0x550], 0x208
push eax
push 0
push str.ServiceName
push edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x5094fa
mov eax, dword [ebp - 0x56c]
cmp eax, 1
je 0x50939b
cmp eax, 2
jne 0x5094fa
mov eax, dword [ebp - 0x550]
test eax, eax
je 0x5093bf
test al, 1
jne 0x5094fa
shr eax, 1
cmp word [ebp + eax*2 - 0x346], 0
je 0x5093c8
jmp 0x5094fa
xor eax, eax
mov word [ebp - 0x344], ax
lea eax, [ebp - 0x550]
mov dword [ebp - 0x554], 0
push eax
lea eax, [ebp - 0x554]
mov dword [ebp - 0x550], 0
push eax
lea eax, [ebp - 0x344]
push eax
call fcn.00509a50
add esp, 0xc
test eax, eax
je 0x50940a
cmp dword [ebp - 0x554], 0
je 0x5094fa
push 0x64
lea eax, [ebp - 0x13c]
push 0
push eax
call fcn.0050b0c0
lea eax, [ebp - 0x550]
push eax
push 0x64
lea eax, [ebp - 0x13c]
push eax
lea eax, [ebp - 0x344]
push eax
call fcn.005095c0
add esp, 0x1c
test eax, eax
je 0x5094fa
cmp dword [ebp - 0x550], 0
je 0x50949f
cmp byte [ebp - 0xd8], 0
je 0x50946f
lea eax, [ebp - 0xd8]
push eax
lea eax, [ebp - 0x13c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jns 0x5094fa
lea ecx, [ebp - 0xd8]
mov edx, 0x64
lea esi, [ebp - 0x13c]
mov eax, ecx
sub esi, eax
lea eax, [edx + 0x7fffff9a]
test eax, eax
je 0x5094e9
mov al, byte [esi + ecx]
test al, al
je 0x5094e9
mov byte [ecx], al
inc ecx
sub edx, 1
jne 0x509484
jmp 0x5094e9
cmp byte [ebp - 0x74], 0
je 0x5094ba
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x13c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jns 0x5094fa
lea ecx, [ebp - 0x74]
mov edx, 0x64
lea esi, [ebp - 0x13c]
mov eax, ecx
sub esi, eax
nop dword [eax]
lea eax, [edx + 0x7fffff9a]
test eax, eax
je 0x5094e9
mov al, byte [esi + ecx]
test al, al
je 0x5094e9
mov byte [ecx], al
inc ecx
sub edx, 1
jne 0x5094d0
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ecx - 1]
test edx, edx
cmovne eax, ecx
mov byte [eax], 0
mov byte [ebp - 4], 0
test edi, edi
je 0x50950f
push edi
call esi
mov dword [ebp - 0x564], 0
mov edi, dword [ebp - 0x578]
mov dword [ebp - 0x560], 0
jmp 0x509525
mov byte [ebp - 4], 0
inc ebx
cmp ebx, 0x64
jl 0x5092d0
cmp byte [ebp - 0x74], 0
je 0x509560
lea edx, [ebp - 0x74]
lea esi, [edx + 1]
nop dword [eax + eax]
mov al, byte [edx]
inc edx
test al, al
jne 0x509540
mov ecx, dword [ebp - 0x558]
lea eax, [ebp - 0x74]
sub edx, esi
push edx
push eax
call fcn.004156c0
mov esi, 1
jmp 0x509597
cmp byte [ebp - 0xd8], 0
je 0x509595
lea ecx, [ebp - 0xd8]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x509572
sub ecx, edx
lea eax, [ebp - 0xd8]
push ecx
mov ecx, dword [ebp - 0x558]
push eax
call fcn.004156c0
mov esi, 1
jmp 0x509597
xor esi, esi
test edi, edi
je 0x5095a2
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00460f8d
mov esp, ebp
pop ebp
ret