Function at 0x401820
Capabilities:
Query or enumerate registry key

Disassembly:
sub esp, 0x824
push ebx
lea eax, [esp + 4]
push ebp
mov ebp, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
xor ebx, ebx
push eax
push 0x20019
push ebx
push str.SYSTEMCurrentControlSetEnumUSB
push 0x80000002
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], ebx
call ebp
test eax, eax
je 0x401875
cmp dword [0x40cb74], ebx
je 0x401a8f
push str.RegOpenKeyEx_SYSTEMCurrentControlSetEnumUSB__Error__r_n
call fcn.00402fb0
add esp, 4
pop ebp
pop ebx
add esp, 0x824
ret
push esi
push ebx
push ebx
mov edx, dword [esp + 0x14]
push ebx
push ebx
push ebx
push ebx
lea ecx, [esp + 0x34]
push ebx
push ecx
push ebx
push ebx
push ebx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
test eax, eax
jne 0x401a7f
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x401a7f
xor esi, esi
cmp eax, ebx
mov dword [esp + 0x20], esi
jbe 0x401a7f
push edi
mov edx, dword [esp + 0x10]
push ebx
push ebx
push ebx
lea eax, [esp + 0x38]
push ebx
lea ecx, [esp + 0x444]
push eax
push ecx
push esi
push edx
mov dword [esp + 0x4c], 0x200
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x401a6d
mov ecx, 0x80
lea edi, [esp + 0x234]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x434]
lea ecx, [esp + 0x234]
push eax
push str.SYSTEMCurrentControlSetEnumUSB_s
push ecx
mov dword [esp + 0x20], ebx
call fcn.00402e00
add esp, 0xc
lea edx, [esp + 0x18]
lea eax, [esp + 0x234]
push edx
push 0x20019
push ebx
push eax
push 0x80000002
call ebp
test eax, eax
jne 0x401a6d
push ebx
push ebx
mov edx, dword [esp + 0x20]
push ebx
push ebx
push ebx
push ebx
lea ecx, [esp + 0x2c]
push ebx
push ecx
push ebx
push ebx
push ebx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
test eax, eax
jne 0x401a5e
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x401a5e
mov dword [esp + 0x28], ebx
jbe 0x401a5e
xor eax, eax
push ebx
push ebx
push ebx
lea ecx, [esp + 0x3c]
push ebx
lea edx, [esp + 0x644]
push ecx
push edx
push eax
mov eax, dword [esp + 0x34]
push eax
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x50], 0x200
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x401a40
mov ecx, 0x80
lea edi, [esp + 0x34]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x634]
lea edx, [esp + 0x234]
push ecx
push edx
lea eax, [esp + 0x3c]
push str._s_s
push eax
call fcn.00402e00
add esp, 0x10
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x34]
push ecx
push 0x2001b
push ebx
push edx
push 0x80000002
call ebp
mov esi, eax
mov eax, dword [0x40cb74]
cmp eax, ebx
je 0x4019fe
lea eax, [esp + 0x34]
push esi
push eax
push str.RegOpenKeyEx__s____X_r_n
call fcn.00402fb0
add esp, 0xc
cmp esi, ebx
jne 0x401a40
cmp dword [0x40cb74], ebx
je 0x401a1c
lea ecx, [esp + 0x34]
push ecx
push str.HWKeyCreateReg__s__r_n
call fcn.00402fb0
add esp, 8
mov edx, dword [esp + 0x838]
mov eax, dword [esp + 0x1c]
push edx
push eax
call fcn.00401aa0
mov eax, dword [esp + 0x24]
add esp, 8
cmp eax, ebx
je 0x401a40
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x14]
inc eax
mov dword [esp + 0x28], eax
and eax, 0xffff
cmp eax, ecx
jb 0x40196b
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x401a6d
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x20]
inc esi
cmp esi, eax
mov dword [esp + 0x24], esi
jb 0x4018b3
pop edi
mov eax, dword [esp + 0xc]
pop esi
cmp eax, ebx
je 0x401a8f
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
pop ebx
add esp, 0x824
ret