Function at 0x1058426
Capabilities:
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push ebx
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 4]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push dword [ebp + 8]
mov dword [ebp - 4], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
test eax, eax
jne 0x10584b2
cmp dword [ebp + 0xc], ebx
je 0x10584b2
cmp dword [ebp + 0x10], ebx
je 0x10584b2
xor edi, edi
cmp dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
jbe 0x10585fb
mov eax, dword [ebp - 0x10]
xor ecx, ecx
push 2
inc eax
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov edi, eax
cmp edi, ebx
pop ecx
je 0x10584b2
mov eax, dword [ebp - 0x14]
mov esi, dword [sym.imp.msvcrt.dll_malloc]
add eax, 2
push eax
call esi
cmp eax, ebx
pop ecx
mov dword [ebp - 0xc], eax
jne 0x10584bb
push edi
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0xc
mov eax, dword [ebp - 4]
lea eax, [eax*4 + 4]
push eax
call esi
mov ebx, eax
test ebx, ebx
pop ecx
jne 0x10584e1
push edi
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
push dword [ebp - 0xc]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
jmp 0x10584b1
mov esi, dword [ebp - 4]
lea eax, [esi*4 + 4]
push eax
push 0xff
push ebx
call sub.msvcrt.dll_memset
add esp, 0xc
test esi, esi
jbe 0x10585a5
mov eax, dword [ebp - 0x10]
inc eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x14]
add eax, 2
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0xc]
lea eax, [ebp - 0x18]
push eax
push 0
lea eax, [ebp - 0x20]
push eax
push edi
lea eax, [esi - 1]
push eax
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
jne 0x10585a5
mov eax, dword [ebp + 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x105853b
sub eax, edx
sar eax, 1
push eax
push dword [ebp + 0xc]
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x105859e
cmp dword [ebp - 0x18], 1
je 0x1058567
cmp dword [ebp - 0x18], 2
jne 0x1058579
push dword [ebp + 0x10]
push dword [ebp - 0xc]
call dword [sym.imp.msvcrt.dll__wcsicmp]
test eax, eax
pop ecx
pop ecx
je 0x10585d1
mov eax, dword [ebp + 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x105857f
sub eax, edx
sar eax, 1
lea eax, [edi + eax*2]
push eax
call dword [sym.imp.msvcrt.dll__wtoi]
pop ecx
mov dword [ebp - 8], eax
mov dword [ebx + esi*4], eax
dec esi
jne 0x1058502
push dword [ebp - 0xc]
mov esi, dword [sym.imp.msvcrt.dll_free]
call esi
pop ecx
xor eax, eax
inc eax
cmp dword [ebp - 4], eax
jb 0x10585e8
mov ecx, dword [ebx + eax*4]
cmp ecx, dword [ebp - 8]
je 0x10585c7
inc eax
cmp eax, dword [ebp - 4]
jbe 0x10585b9
cmp eax, dword [ebp - 4]
ja 0x10585e8
inc dword [ebp - 8]
jmp 0x10585b1
push dword [ebp - 0xc]
mov esi, dword [sym.imp.msvcrt.dll_free]
call esi
push ebx
call esi
pop ecx
pop ecx
mov eax, edi
jmp 0x10584b4
push ebx
call esi
cmp dword [ebp - 8], 0x1869f
pop ecx
jg 0x10584ab
xor ebx, ebx
mov eax, dword [ebp + 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x1058601
sub eax, edx
sar eax, 1
add eax, eax
lea ecx, [eax + 6]
cmp dword [ebp - 0x10], ecx
mov dword [ebp - 4], eax
jae 0x1058675
cmp edi, ebx
je 0x105862a
push edi
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
mov eax, dword [ebp - 4]
pop ecx
xor ecx, ecx
push 2
add eax, 6
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov edi, eax
cmp edi, ebx
pop ecx
je 0x10584b2
mov eax, dword [ebp - 4]
push eax
push dword [ebp + 0xc]
push edi
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 4]
shr eax, 1
push 0xa
lea eax, [edi + eax*2]
push eax
push dword [ebp - 8]
call dword [sym.imp.msvcrt.dll__itow]
add esp, 0x18
jmp 0x10585e1
cmp edi, ebx
je 0x10585e1
jmp 0x105864f