Function at 0x401f40
Capabilities:
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40c6c8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x138
push ebx
push esi
push edi
lea eax, [ebp - 0x18]
mov dword [ebp - 0x10], esp
xor ebx, ebx
push eax
push 0x20019
push ebx
push str.Enum
push 0x80000002
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x401fab
push str.Could_not_read_from_HKLMEnum
lea ecx, [ebp - 0x3c]
call fcn.0040bfa2
lea ecx, [ebp - 0x3c]
push 0x40ea18
push ecx
call sub.MSVCRT.dll__CxxThrowException
xor ecx, ecx
mov dword [ebp - 0x14], 0x80
mov eax, ecx
inc ecx
push ebx
push ebx
mov dword [ebp - 0x28], ecx
push ebx
lea edx, [ebp - 0x14]
push ebx
lea ecx, [ebp - 0xc4]
push edx
mov edx, dword [ebp - 0x18]
push ecx
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x40221c
mov edx, dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
push eax
push 0x20019
lea ecx, [ebp - 0xc4]
push ebx
push ecx
push edx
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x40202e
push str.Could_not_read_from_HKLMEnum_
lea ecx, [ebp + 8]
call fcn.0040bfa2
lea ecx, [ebp - 0xc4]
lea edx, [ebp - 0x34]
push ecx
push eax
push edx
mov byte [ebp - 4], 1
call sub.MFC42.DLL_operator
lea eax, [ebp - 0x34]
push 0x40ea18
push eax
call sub.MSVCRT.dll__CxxThrowException
mov esi, str.USBPORTS
lea eax, [ebp - 0xc4]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40205d
cmp cl, bl
je 0x402059
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40205d
add eax, 2
add esi, 2
cmp cl, bl
jne 0x402039
xor eax, eax
jmp 0x402062
sbb eax, eax
sbb eax, 0xffffffff
xor ecx, ecx
cmp eax, ebx
sete cl
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x14], 0x80
xor edi, edi
push ebx
push ebx
push ebx
lea edx, [ebp - 0x14]
push ebx
lea ecx, [ebp - 0x144]
mov eax, edi
push edx
mov edx, dword [ebp - 0x1c]
push ecx
push eax
push edx
inc edi
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x402203
mov esi, str.PNP0500
lea eax, [ebp - 0x144]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4020c9
cmp cl, bl
je 0x4020c5
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4020c9
add eax, 2
add esi, 2
cmp cl, bl
jne 0x4020a5
xor eax, eax
jmp 0x4020ce
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x402113
mov esi, str.PNP0501
lea eax, [ebp - 0x144]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x402101
cmp cl, bl
je 0x4020fd
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x402101
add eax, 2
add esi, 2
cmp cl, bl
jne 0x4020dd
xor eax, eax
jmp 0x402106
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x402113
cmp dword [ebp - 0x20], ebx
je 0x4021ab
mov edx, dword [ebp - 0x1c]
lea eax, [ebp - 0x24]
push eax
push 0x20019
lea ecx, [ebp - 0x144]
push ebx
push ecx
push edx
mov dword [ebp - 0x24], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x40218d
push str.Could_not_read_from_HKLMEnum_
lea ecx, [ebp + 8]
call fcn.0040bfa2
lea ecx, [ebp - 0xc4]
lea edx, [ebp - 0x28]
push ecx
push eax
push edx
mov byte [ebp - 4], 2
call sub.MFC42.DLL_operator
push 0x410144
push eax
lea eax, [ebp - 0x20]
mov byte [ebp - 4], 3
push eax
call sub.MFC42.DLL_operator
lea ecx, [ebp - 0x144]
lea edx, [ebp - 0x2c]
push ecx
push eax
push edx
mov byte [ebp - 4], 4
call sub.MFC42.DLL_operator
lea eax, [ebp - 0x2c]
push 0x40ea18
push eax
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x24]
push ecx
push edx
push eax
call fcn.00402240
mov ecx, dword [ebp - 0x24]
add esp, 0xc
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x14], 0x80
jmp 0x402075
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x14], 0x80
jmp 0x401fb4
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret