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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x607c
call fcn.00417744
push edi
push esi
push ebx
add esp, 0xfffffff4
lea eax, [ebp - 0x6034]
push eax
push 0x20019
push 0
push dword [ebp + 0x18]
push 0x80000002
call sub.ADVAPI32.DLL_RegOpenKeyExA
add esp, 0xc
test eax, eax
jne 0x40d4d8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 8], 0
mov eax, 0x2000
mov dword [ebp - 0x6044], eax
mov dword [ebp - 0x6048], eax
mov dword [ebp - 0x6058], 0
jmp 0x40d14a
add esp, 0xfffffffc
mov eax, dword [ebp + 0x14]
push eax
mov edx, dword [ebp + 0x10]
push edx
push ebx
call fcn.0040c880
add esp, 0x10
test al, al
je 0x40d130
lea esi, [ebp - 0x20]
cmp byte [0x422c00], 0
je 0x40d04c
add esp, 0xfffffff4
push 0x422bf4
call fcn.00420250
add esp, 0x10
jmp 0x40d057
inc dword [0x422bfc]
mov eax, 0x422c04
mov dword [ebp - 0x20], eax
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea eax, [ecx - 1]
add esp, 0xfffffff4
push eax
push ebx
push 0xffffffffffffffff
push 0
push esi
call fcn.00421080
add esp, 0x20
lea eax, [ebp - 0x10]
mov ebx, dword [ebp - 0xc]
cmp ebx, dword [ebp - 8]
je 0x40d0b4
test ebx, ebx
je 0x40d0ad
mov eax, dword [ebp - 0x20]
lea edx, [eax - 0x10]
cmp byte [eax - 4], 0
je 0x40d0a8
add esp, 0xfffffff4
push edx
call fcn.00420250
add esp, 0x10
jmp 0x40d0ab
inc dword [eax - 8]
mov dword [ebx], eax
add dword [ebp - 0xc], 4
jmp 0x40d0c2
add esp, 0xfffffffc
push esi
push ebx
push eax
call fcn.0041d0cc
add esp, 0x10
mov edi, dword [ebp - 0x20]
lea esi, [edi - 0x10]
mov eax, dword [edi - 8]
lea edx, [eax - 1]
mov dword [edi - 8], edx
cmp eax, 1
jne 0x40d130
mov edx, dword [edi - 0xc]
lea eax, [edx + 0x10]
cmp eax, 0x80
jbe 0x40d0f4
add esp, 0xfffffff4
push esi
call sub.msvcrt.dll_free
add esp, 0x10
jmp 0x40d130
lea ebx, [edx + 0x17]
shr ebx, 3
lea ebx, [ebx*4 - 4]
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov eax, dword [ebx + 0x422c0c]
mov dword [edi - 0x10], eax
mov dword [ebx + 0x422c0c], esi
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
inc dword [ebp - 0x6058]
mov dword [ebp - 0x6044], 0x2000
mov dword [ebp - 0x6048], 0x2000
lea eax, [ebp - 0x6040]
push eax
lea eax, [ebp - 0x6044]
push eax
lea eax, [ebp - 0x2020]
push eax
push 0
lea eax, [ebp - 0x6048]
push eax
lea ebx, [ebp - 0x4020]
push ebx
mov eax, dword [ebp - 0x6058]
push eax
push dword [ebp - 0x6034]
call sub.ADVAPI32.DLL_RegEnumKeyExA
cmp eax, 0x103
jne 0x40d010
mov edi, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x10]
cmp ebx, edi
je 0x40d1c5
mov eax, edi
sub eax, ebx
sar eax, 2
xor edx, edx
cmp eax, 1
je 0x40d1ac
inc edx
sar eax, 1
cmp eax, 1
jne 0x40d1a4
add edx, edx
push edx
push 0
push edi
push ebx
call fcn.0041ea84
add esp, 0xfffffff8
push edi
push ebx
call fcn.0041e7a0
add esp, 0x20
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0xc]
sub edx, eax
mov eax, edx
sar eax, 2
lea esi, [eax - 1]
test esi, esi
jl 0x40d3c8
lea esi, [esi]
add esp, 0xfffffff4
lea eax, [ebp - 0x604c]
push eax
push 0x20019
push 0
mov ecx, esi
shl ecx, 2
add ecx, dword [ebp - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx - 0x10]
test eax, eax
jne 0x40d20c
mov eax, 0x40cf96
jmp 0x40d212
mov byte [eax + edx], 0
mov eax, dword [ecx]
push eax
push dword [ebp - 0x6034]
call sub.ADVAPI32.DLL_RegOpenKeyExA
add esp, 0xc
test eax, eax
jne 0x40d3c1
mov dword [ebp - 0x6050], 0x2000
add esp, 0xfffffff8
lea eax, [ebp - 0x6050]
push eax
lea ebx, [ebp - 0x6030]
push ebx
lea eax, [ebp - 0x6054]
push eax
push 0
push 0x40cf97
push dword [ebp - 0x604c]
call sub.ADVAPI32.DLL_RegQueryValueExA
add esp, 8
test eax, eax
jne 0x40d3b0
add esp, 0xfffffff8
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.0040bc70
add esp, 0x10
test al, al
je 0x40d3b0
add esp, 0xfffffff4
add esp, 0xfffffffe
push 0
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0040c6c8
add esp, 0x20
test al, al
je 0x40d3b0
mov edx, dword [ebp - 0xc]
mov dword [ebp - 0x6064], edx
mov esi, dword [ebp - 0x10]
cmp esi, edx
je 0x40d34d
lea esi, [esi]
mov edi, dword [esi]
lea eax, [edi - 0x10]
mov dword [ebp - 0x6068], eax
mov eax, dword [edi - 8]
lea edx, [eax - 1]
mov dword [edi - 8], edx
cmp eax, 1
jne 0x40d33e
mov edx, dword [edi - 0xc]
lea eax, [edx + 0x10]
cmp eax, 0x80
jbe 0x40d2fc
add esp, 0xfffffff4
mov eax, dword [ebp - 0x6068]
push eax
call sub.msvcrt.dll_free
add esp, 0x10
jmp 0x40d33e
lea ebx, [edx + 0x17]
shr ebx, 3
lea ebx, [ebx*4 - 4]
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov eax, dword [ebx + 0x422c0c]
mov dword [edi - 0x10], eax
mov edx, dword [ebp - 0x6068]
mov dword [ebx + 0x422c0c], edx
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
add esi, 4
cmp esi, dword [ebp - 0x6064]
jne 0x40d2c0
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
sub eax, edi
sar eax, 2
je 0x40d3a8
shl eax, 2
cmp eax, 0x80
jbe 0x40d370
add esp, 0xfffffff4
push edi
call sub.msvcrt.dll_free
jmp 0x40d3a8
lea ebx, [eax + 7]
shr ebx, 3
lea ebx, [ebx*4 - 4]
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov eax, dword [ebx + 0x422c0c]
mov dword [edi], eax
mov dword [ebx + 0x422c0c], edi
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_LeaveCriticalSection
mov al, 1
jmp 0x40d4da
add esp, 0xfffffff4
push dword [ebp - 0x604c]
call sub.ADVAPI32.DLL_RegCloseKey
add esp, 0xc
dec esi
jns 0x40d1e0
add esp, 0xfffffff4
push dword [ebp - 0x6034]
call sub.ADVAPI32.DLL_RegCloseKey
add esp, 0xc
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x605c], eax
mov esi, dword [ebp - 0x10]
cmp esi, eax
je 0x40d47d
lea esi, [esi]
mov edi, dword [esi]
lea edx, [edi - 0x10]
mov dword [ebp - 0x6060], edx
mov eax, dword [edi - 8]
lea edx, [eax - 1]
mov dword [edi - 8], edx
cmp eax, 1
jne 0x40d46e
mov edx, dword [edi - 0xc]
lea eax, [edx + 0x10]
cmp eax, 0x80
jbe 0x40d42c
add esp, 0xfffffff4
mov eax, dword [ebp - 0x6060]
push eax
call sub.msvcrt.dll_free
add esp, 0x10
jmp 0x40d46e
lea ebx, [edx + 0x17]
shr ebx, 3
lea ebx, [ebx*4 - 4]
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov eax, dword [ebx + 0x422c0c]
mov dword [edi - 0x10], eax
mov edx, dword [ebp - 0x6060]
mov dword [ebx + 0x422c0c], edx
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
add esi, 4
cmp esi, dword [ebp - 0x605c]
jne 0x40d3f0
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
sub eax, edi
sar eax, 2
je 0x40d4d8
shl eax, 2
cmp eax, 0x80
jbe 0x40d4a0
add esp, 0xfffffff4
push edi
call sub.msvcrt.dll_free
jmp 0x40d4d8
lea ebx, [eax + 7]
shr ebx, 3
lea ebx, [ebx*4 - 4]
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov eax, dword [ebx + 0x422c0c]
mov dword [edi], eax
mov dword [ebx + 0x422c0c], edi
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_LeaveCriticalSection
mov al, 0
lea esp, [ebp - 0x6088]
pop ebx
pop esi
pop edi
leave
ret