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

Disassembly:
sub esp, 0x220
mov eax, dword [ecx + 4]
push ebx
xor ebx, ebx
push esi
cmp eax, ebx
mov dword [esp + 0x18], ecx
jne 0x40448c
mov esi, str.SystemCurrentControlSetServicesClassPorts
jmp 0x404497
mov esi, str.SystemCurrentControlSetControlClass4D36E978_E325_11CE_BFC1_08002BE10318
push esi
call fcn.00405810
lea eax, [esp + 0x1c]
push eax
push 0xf003f
push ebx
push esi
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, ebx
jne 0x40476f
mov edx, dword [esp + 0x1c]
push ebp
mov ebp, 0x104
lea ecx, [esp + 0x128]
push ebp
push ecx
push ebx
push edx
mov dword [esp + 0x28], 1
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
jne 0x40475a
push edi
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x14]
push eax
push 0xf003f
lea ecx, [esp + 0x134]
push ebx
push ecx
push edx
mov dword [esp + 0x28], ebx
xor edi, edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x404731
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea eax, [esp + 0x10]
lea ecx, [esp + 0x28]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x1c]
push ecx
push edx
push ebx
push str.ProviderName
push eax
mov dword [esp + 0x28], ebp
call esi
test eax, eax
jne 0x40456d
cmp dword [esp + 0x10], 4
jbe 0x40456d
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.004057e0
push 7
lea edx, [esp + 0x2c]
push str.moschip
push edx
mov dword [esp + 0x1c], ebp
call fcn.0040f100
add esp, 0xc
test eax, eax
je 0x4046ee
lea eax, [esp + 0x10]
lea ecx, [esp + 0x28]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x1c]
push ecx
push edx
push ebx
push str.DriverDesc
push eax
mov dword [esp + 0x28], ebp
call esi
test eax, eax
jne 0x4045c6
cmp dword [esp + 0x10], 4
jbe 0x4045c6
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.004057e0
push 7
lea edx, [esp + 0x2c]
push str.moschip
push edx
mov dword [esp + 0x1c], ebp
call fcn.0040f100
add esp, 0xc
test eax, eax
je 0x4046ee
lea eax, [esp + 0x10]
lea ecx, [esp + 0x28]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x1c]
push ecx
push edx
push ebx
push str.InfPath
push eax
mov dword [esp + 0x28], ebp
call esi
test eax, eax
jne 0x404699
cmp dword [esp + 0x10], 4
jbe 0x404699
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.004057e0
push 7
lea edx, [esp + 0x2c]
push str.moschip
push edx
call fcn.0040f100
add esp, 0xc
test eax, eax
je 0x4046ee
mov esi, str.mos24ser.inf
lea eax, [esp + 0x28]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x404650
cmp cl, bl
je 0x40464c
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x404650
add eax, 2
add esi, 2
cmp cl, bl
jne 0x40462c
xor eax, eax
jmp 0x404655
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x4046ee
mov esi, str.mos24ser.inf
lea eax, [esp + 0x28]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40468a
cmp cl, bl
je 0x404686
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40468a
add eax, 2
add esi, 2
cmp cl, bl
jne 0x404666
xor eax, eax
jmp 0x40468f
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x4046ee
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea eax, [esp + 0x10]
lea ecx, [esp + 0x28]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x1c]
push ecx
push edx
push ebx
push str.MatchingDeviceId
push eax
mov dword [esp + 0x28], ebp
call esi
test eax, eax
jne 0x4046f3
cmp dword [esp + 0x10], 4
jbe 0x4046f3
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.004057e0
push 0x1d
lea edx, [esp + 0x2c]
push str.moschipquad_serial_interface
push edx
mov dword [esp + 0x1c], ebp
call fcn.0040f100
add esp, 0xc
test eax, eax
jne 0x4046f3
mov edi, 1
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp edi, ebx
mov dword [esp + 0x14], ebx
je 0x404731
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x12c]
push ecx
mov ecx, dword [esp + 0x24]
push edx
call fcn.00405970
test eax, eax
je 0x404731
mov eax, dword [esp + 0x1c]
sub eax, 2
mov dword [esp + 0x1c], eax
jns 0x404731
mov dword [esp + 0x1c], ebx
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
mov eax, ecx
inc ecx
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x12c]
push ebp
push ecx
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
je 0x4044e2
pop edi
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
pop esi
pop ebx
add esp, 0x220
ret
cmp eax, 2
je 0x4047b3
push ebx
lea ecx, [esp + 0x14]
push ebx
push ecx
push 0x400
push eax
push ebx
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
cmp dword [0x4397d0], ebx
je 0x4047a8
mov edx, dword [esp + 0x10]
push 0x40
push str.Registry_Error
push edx
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop esi
pop ebx
add esp, 0x220
ret