Function at 0x405a50
Capabilities:
Delete registry value
Query or enumerate registry value

Disassembly:
sub esp, 0x218
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 4]
test eax, eax
je 0x405baf
mov edi, dword [esp + 0x22c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x1c], 0
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.Device_Parameters
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x228]
and ecx, 3
lea eax, [esp + 0x10]
rep movsb byte es:[edi], byte [esi]
push eax
push 0xf003f
lea ecx, [esp + 0x24]
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405cb2
lea eax, [esp + 0xc]
lea ecx, [esp + 0x120]
push eax
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x18]
push ecx
push edx
push 0
push str.PortName
push eax
mov dword [esp + 0x24], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x405b98
cmp dword [esp + 0xc], 3
jbe 0x405b98
push 3
lea ecx, [esp + 0x124]
push 0x437600
push ecx
call fcn.0040f100
add esp, 0xc
test eax, eax
jne 0x405b81
lea edx, [esp + 0x123]
push edx
call fcn.0040f338
add esp, 4
mov dword [ebp + 0x48], 1
test eax, eax
jle 0x405b98
cmp eax, 0x100
jg 0x405b98
push eax
mov ecx, ebp
call fcn.00405cc0
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
add esp, 0x218
ret 8
push 3
lea eax, [esp + 0x124]
push 0x4375fc
push eax
call fcn.0040f100
add esp, 0xc
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
add esp, 0x218
ret 8
mov edi, dword [esp + 0x22c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x120]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x120], 0
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x228]
and ecx, 3
lea eax, [esp + 0x14]
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
push eax
push 0xf003f
lea ecx, [esp + 0x128]
push 0
push ecx
push edx
call esi
test eax, eax
jne 0x405cb2
lea eax, [esp + 0x10]
lea ecx, [esp + 0x1c]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x1c]
push ecx
push edx
push 0
push str.PortName
push eax
mov dword [esp + 0x28], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x405cab
cmp dword [esp + 0x10], 3
jbe 0x405cab
push 3
lea ecx, [esp + 0x20]
push 0x437600
push ecx
call fcn.0040f100
add esp, 0xc
test eax, eax
jne 0x405cab
push str.HardwareDeviceMapSerialComm
mov ecx, ebp
mov dword [esp + 0x10], eax
call fcn.00405810
lea edx, [esp + 0xc]
push edx
push 0xf003f
push 0
push str.HardwareDeviceMapSerialComm
push reloc.OLEAUT32.dll_SysReAllocString
call esi
test eax, eax
jne 0x405cab
mov ecx, dword [esp + 0xc]
lea eax, [esp + 0x1c]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
mov edx, dword [esp + 0xc]
push edx
call edi
mov eax, dword [esp + 0x14]
push eax
call edi
pop edi
pop esi
pop ebp
add esp, 0x218
ret 8