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

Disassembly:
sub esp, 0x46c
mov eax, dword [0x565fd0]
xor eax, esp
mov dword [esp + 0x468], eax
mov eax, dword [esp + 0x470]
push ebp
push esi
mov ebp, 1
push edi
mov dword [esp + 0x34], eax
mov dword [esp + 0x24], ebp
inc ebp
push ebp
push str.SYSTEMControlSet0_02dControlClass4D36E96D_E325_11CE_BFC1_08002BE10318
lea edx, [esp + 0x370]
mov dword [esp + 0x38], ebp
call fcn.00406b60
add esp, 8
lea ecx, [esp + 0x10]
push ecx
push 0x20019
push 0
lea edx, [esp + 0x374]
push edx
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405e5d
mov ecx, dword [esp + 0x10]
push 0x104
lea eax, [esp + 0x264]
push eax
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
mov dword [esp + 0x20], 1
test eax, eax
jne 0x405e52
mov ecx, dword [esp + 0x10]
xor eax, eax
lea edx, [esp + 0x14]
push edx
push 0x20019
push eax
mov dword [esp + 0x159], eax
mov dword [esp + 0x15d], eax
mov dword [esp + 0x161], eax
mov dword [esp + 0x165], eax
mov word [esp + 0x169], ax
mov byte [esp + 0x16b], al
lea eax, [esp + 0x26c]
push eax
push ecx
mov byte [esp + 0x160], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405e52
mov edi, 0x100
push edi
push eax
lea edx, [esp + 0x168]
push edx
call fcn.004fb1b0
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
add esp, 0xc
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x164]
push ecx
lea edx, [esp + 0x30]
push edx
push 0
push str.MatchingDeviceId
push eax
mov dword [esp + 0x30], edi
call esi
test eax, eax
jne 0x405e1d
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x160]
call fcn.00405120
test eax, eax
je 0x405e1d
push edi
lea ecx, [esp + 0x164]
push 0
push ecx
call fcn.004fb1b0
add esp, 0xc
lea edx, [esp + 0x18]
push edx
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x164]
push eax
lea ecx, [esp + 0x30]
push ecx
push 0
push str.AttachedTo
push edx
mov dword [esp + 0x30], edi
call esi
test eax, eax
jne 0x405e1d
lea eax, [esp + 0x160]
push eax
push str.._s
lea edx, [esp + 0x154]
call fcn.00406b80
add esp, 8
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
lea ecx, [esp + 0x164]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x2c], eax
cmp eax, 0xffffffff
je 0x405e1d
cmp byte [esp + 0x160], 0
je 0x405e0e
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov edi, dword [ebx]
mov dword [esp + 0x1c], 0
mov ebp, eax
lea esp, [esp]
mov esi, dword [ebx + 0x14]
mov eax, dword [ebx]
test edi, edi
je 0x405d2d
cmp edi, eax
je 0x405d32
call fcn.004fa47b
cmp ebp, esi
je 0x405dab
test edi, edi
jne 0x405d75
call fcn.004fa47b
xor eax, eax
cmp ebp, dword [eax + 0x14]
jne 0x405d4b
call fcn.004fa47b
lea ecx, [esp + 0x160]
lea eax, [ebp + 8]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x405d79
test dl, dl
je 0x405d71
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x405d79
add eax, 2
add ecx, 2
test dl, dl
jne 0x405d55
xor eax, eax
jmp 0x405d7e
mov eax, dword [edi]
jmp 0x405d41
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x405d8a
mov dword [esp + 0x1c], 1
test edi, edi
jne 0x405da7
call fcn.004fa47b
xor eax, eax
cmp ebp, dword [eax + 0x14]
jne 0x405d9f
call fcn.004fa47b
mov ebp, dword [ebp]
jmp 0x405d20
mov eax, dword [edi]
jmp 0x405d95
cmp dword [esp + 0x1c], 0
jne 0x405e0e
lea eax, [esp + 0x160]
push eax
lea ecx, [esp + 0x3c]
push 0xa
push ecx
call fcn.004f9a4a
add esp, 0xc
lea edx, [esp + 0x14c]
push edx
lea eax, [esp + 0x46]
push 0x104
push eax
call fcn.004f9a4a
mov esi, dword [ebx + 0x14]
mov edx, dword [esi + 4]
add esp, 0xc
lea ecx, [esp + 0x38]
push ecx
push edx
push esi
call fcn.00406a20
mov ecx, ebx
mov edi, eax
call fcn.00406a60
mov dword [esi + 4], edi
mov eax, dword [edi + 4]
mov dword [eax], edi
mov dword [esp + 0x24], 0
mov ecx, dword [esp + 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [esp + 0x30]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
push 0x104
lea eax, [esp + 0x264]
push eax
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
inc esi
mov dword [esp + 0x20], esi
test eax, eax
je 0x405bb6
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp ebp, 5
jl 0x405b4b
mov ecx, dword [esp + 0x474]
mov eax, dword [esp + 0x24]
pop edi
pop esi
pop ebp
xor ecx, esp
call fcn.004f96cd
add esp, 0x46c
ret 4