Function at 0x404640
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 0x40465c
mov esi, str.SystemCurrentControlSetServicesClassPorts
jmp 0x404667
mov esi, str.SystemCurrentControlSetControlClass4D36E978_E325_11CE_BFC1_08002BE10318
push esi
call fcn.00405dc0
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 0x40497d
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 0x404968
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 0x40493f
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.DriverDesc
push eax
mov dword [esp + 0x28], ebp
call esi
test eax, eax
jne 0x40473d
cmp dword [esp + 0x10], 4
jbe 0x40473d
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.00405d90
push 0x19
lea edx, [esp + 0x2c]
push str.usb_to_serial_port_driver
push edx
mov dword [esp + 0x1c], ebp
call fcn.00410430
add esp, 0xc
test eax, eax
je 0x4048fc
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 0x404814
cmp dword [esp + 0x10], 4
jbe 0x404814
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.00405d90
push 7
lea edx, [esp + 0x2c]
push str.moschip
push edx
call fcn.00410430
add esp, 0xc
test eax, eax
je 0x4048fc
mov esi, str.mosuport.inf
lea eax, [esp + 0x28]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4047c7
cmp cl, bl
je 0x4047c3
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4047c7
add eax, 2
add esi, 2
cmp cl, bl
jne 0x4047a3
xor eax, eax
jmp 0x4047cc
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x4048fc
mov esi, str.mosuport.inf
lea eax, [esp + 0x28]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x404801
cmp cl, bl
je 0x4047fd
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x404801
add eax, 2
add esi, 2
cmp cl, bl
jne 0x4047dd
xor eax, eax
jmp 0x404806
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x4048fc
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 0x40488a
cmp dword [esp + 0x10], 4
jbe 0x40488a
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x24]
call fcn.00405d90
push 0x21
lea edx, [esp + 0x2c]
push str.moschipcompound_serial_interface
push edx
mov dword [esp + 0x1c], ebp
call fcn.00410430
add esp, 0xc
test eax, eax
jne 0x40486e
mov edi, 1
push 0x1c
lea eax, [esp + 0x2c]
push str.moschipusb_serial_interface
push eax
call fcn.00410430
add esp, 0xc
test eax, eax
je 0x4048fc
cmp edi, ebx
jne 0x404901
lea ecx, [esp + 0x10]
lea edx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x1c]
push edx
push eax
push ebx
push str.MatchingDeviceId
push ecx
mov dword [esp + 0x28], ebp
call esi
test eax, eax
jne 0x404901
cmp dword [esp + 0x10], 4
jbe 0x404901
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x28]
push edx
call fcn.00405d90
push 0x23
lea eax, [esp + 0x2c]
push str.moschipcompound_parallel_interface
push eax
mov dword [esp + 0x1c], ebp
call fcn.00410430
add esp, 0xc
test eax, eax
jne 0x4048e4
mov edi, 1
push 0x1c
lea ecx, [esp + 0x2c]
push str.moschipusb_serial_interface
push ecx
call fcn.00410430
add esp, 0xc
test eax, eax
jne 0x404901
mov edi, 1
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp edi, ebx
mov dword [esp + 0x14], ebx
je 0x40493f
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x12c]
push eax
push ecx
mov ecx, dword [esp + 0x28]
call fcn.00405f20
test eax, eax
je 0x40493f
mov eax, dword [esp + 0x1c]
sub eax, 2
mov dword [esp + 0x1c], eax
jns 0x40493f
mov dword [esp + 0x1c], ebx
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x12c]
mov eax, ecx
push ebp
push edx
push eax
mov eax, dword [esp + 0x30]
inc ecx
push eax
mov dword [esp + 0x2c], ecx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
je 0x4046b2
pop edi
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
pop esi
pop ebx
add esp, 0x220
ret
cmp eax, 2
je 0x4049c1
push ebx
lea edx, [esp + 0x14]
push ebx
push edx
push 0x400
push eax
push ebx
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
cmp dword [0x43acf0], ebx
je 0x4049b6
mov eax, dword [esp + 0x10]
push 0x40
push str.Registry_Error
push eax
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop esi
pop ebx
add esp, 0x220
ret