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

Disassembly:
sub esp, 0xd58
mov eax, dword [0x6aae14]
xor eax, esp
mov dword [esp + 0xd54], eax
push ebx
push esi
mov esi, dword [esp + 0xd64]
push edi
mov edi, dword [esp + 0xd6c]
xor ebx, ebx
push 0x40f
lea eax, [esp + 0x135]
push ebx
push eax
mov dword [esp + 0x34], edi
mov byte [esp + 0x13c], bl
call fcn.005dfd60
push 0x40f
lea ecx, [esp + 0x551]
push ebx
push ecx
mov byte [esp + 0x558], bl
call fcn.005dfd60
push 0x40f
lea edx, [esp + 0x96d]
push ebx
push edx
mov byte [esp + 0x974], bl
call fcn.005dfd60
push 0x103
lea eax, [esp + 0x55]
push ebx
push eax
mov dword [esp + 0x4c], ebx
mov byte [esp + 0x5c], bl
call fcn.005dfd60
add esp, 0x30
cmp esi, ebx
je 0x516632
cmp byte [esi], bl
je 0x516632
cmp edi, ebx
je 0x5163ba
mov byte [edi], bl
push esi
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x5c
push esi
call fcn.005e0940
add esp, 8
test eax, eax
je 0x5163ec
lea edx, [esp + 0x2c]
push edx
mov dword [esp + 0x1c], 1
call fcn.004ebde0
add esp, 4
jmp 0x5163f0
mov dword [esp + 0x18], ebx
push ebp
lea eax, [esp + 0x544]
push 0x66d7e8
push eax
call fcn.005dfb23
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
add esp, 8
lea ecx, [esp + 0x14]
push ecx
push 9
push ebx
lea edx, [esp + 0x550]
push edx
push connect
call edi
mov ebp, dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, eax
push esi
call ebp
cmp esi, ebx
jne 0x516615
mov ecx, dword [esp + 0x14]
push 0x410
lea eax, [esp + 0x138]
push eax
push ebx
push ecx
mov dword [esp + 0x20], ebx
mov byte [esp + 0x144], bl
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
jne 0x5165c7
jmp 0x516470
lea edx, [esp + 0x134]
push edx
lea eax, [esp + 0x958]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [esp + 0x954]
push ecx
lea edx, [esp + 0x548]
push 0x64e038
push edx
mov byte [esp + 0x140], bl
call fcn.005dfb23
add esp, 0xc
lea eax, [esp + 0x18]
push eax
push 1
push ebx
lea ecx, [esp + 0x550]
push ecx
push connect
call edi
mov esi, eax
push esi
call ebp
cmp esi, ebx
je 0x51650b
lea edx, [esp + 0x954]
push edx
lea eax, [esp + 0x548]
push 0x64e020
push eax
call fcn.005dfb23
add esp, 0xc
lea ecx, [esp + 0x18]
push ecx
push 1
push ebx
lea edx, [esp + 0x550]
push edx
push connect
call edi
mov esi, eax
push esi
call ebp
cmp esi, ebx
jne 0x516597
lea eax, [esp + 0x24]
push eax
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x138]
push ecx
lea edx, [esp + 0x30]
push edx
push ebx
push ebx
push eax
mov dword [esp + 0x3c], 0x410
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov ecx, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ecx
call esi
mov eax, dword [esp + 0x28]
cmp eax, 1
je 0x51654d
cmp eax, 2
jne 0x516597
cmp byte [esp + 0x134], bl
je 0x516597
cmp dword [esp + 0x1c], ebx
je 0x51657c
push ebx
push 1
lea edx, [esp + 0x13c]
push edx
call fcn.005127a0
lea eax, [esp + 0x134]
push eax
call fcn.004ebde0
add esp, 4
push ebx
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x13c]
push edx
call fcn.004f5880
add esp, 0xc
cmp eax, 0xffffffff
jne 0x5165ef
inc dword [esp + 0x10]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
push 0x410
lea eax, [esp + 0x138]
push eax
push ecx
push edx
mov byte [esp + 0x144], bl
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
je 0x516470
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x20]
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xd54]
xor ecx, esp
call fcn.005dfbbe
add esp, 0xd58
ret
mov eax, dword [esp + 0x2c]
cmp eax, ebx
je 0x516606
lea ecx, [esp + 0x954]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov edx, dword [esp + 0x14]
push edx
call esi
mov dword [esp + 0x20], 1
mov eax, dword [esp + 0x20]
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xd54]
xor ecx, esp
call fcn.005dfbbe
add esp, 0xd58
ret
mov ecx, dword [esp + 0xd60]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.005dfbbe
add esp, 0xd58
ret