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

Disassembly:
sub esp, 0x218
push ebx
push ebp
mov ebp, ecx
xor ebx, ebx
push esi
push edi
cmp dword [ebp + 4], ebx
je 0x40615f
mov edi, dword [esp + 0x230]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x20]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x20], bl
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 + 0x20]
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 + 0x22c]
and ecx, 3
lea eax, [esp + 0x14]
rep movsb byte es:[edi], byte [esi]
push eax
push 0xf003f
lea ecx, [esp + 0x28]
push ebx
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4062c0
lea eax, [esp + 0x10]
lea ecx, [esp + 0x124]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x1c]
push ecx
push edx
push ebx
push str.PortName
push eax
mov dword [esp + 0x28], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x406147
cmp dword [esp + 0x10], 3
jbe 0x406147
push 3
lea ecx, [esp + 0x128]
push 0x438904
push ecx
call fcn.00410430
add esp, 0xc
test eax, eax
jne 0x406130
lea edx, [esp + 0x127]
push edx
call fcn.00410668
add esp, 4
cmp eax, ebx
mov dword [ebp + 0x4c], 1
jle 0x406147
cmp eax, 0x100
jg 0x406147
push eax
mov ecx, ebp
call fcn.004062d0
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x218
ret 8
push 3
lea eax, [esp + 0x128]
push 0x438900
push eax
call fcn.00410430
add esp, 0xc
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x218
ret 8
mov edi, dword [esp + 0x230]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x124]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x124], bl
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 + 0x22c]
and ecx, 3
lea eax, [esp + 0x18]
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
push eax
push 0xf003f
lea ecx, [esp + 0x12c]
push ebx
push ecx
push edx
call esi
test eax, eax
jne 0x4062c0
lea eax, [esp + 0x14]
lea ecx, [esp + 0x20]
push eax
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x20]
push ecx
push edx
push ebx
push str.PortName
push eax
mov dword [esp + 0x2c], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x4062b9
cmp dword [esp + 0x14], 3
jbe 0x4062b9
push 3
lea ecx, [esp + 0x24]
push 0x438904
push ecx
call fcn.00410430
add esp, 0xc
test eax, eax
jne 0x40625f
push str.HardwareDeviceMapSerialComm
mov ecx, ebp
mov dword [esp + 0x14], ebx
call fcn.00405dc0
lea edx, [esp + 0x10]
push edx
push 0xf003f
push ebx
push str.HardwareDeviceMapSerialComm
push reloc.OLEAUT32.dll_SysReAllocString
call esi
test eax, eax
jne 0x4062b9
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x20]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
mov edx, dword [esp + 0x10]
push edx
jmp 0x4062b7
push 3
lea eax, [esp + 0x24]
push 0x438900
push eax
call fcn.00410430
add esp, 0xc
test eax, eax
jne 0x4062b9
push str.HardwareDeviceMapParallel
mov ecx, ebp
mov dword [esp + 0x14], ebx
call fcn.00405dc0
lea ecx, [esp + 0x10]
push ecx
push 0xf003f
push ebx
push str.HardwareDeviceMapParallel
push reloc.OLEAUT32.dll_SysReAllocString
call esi
test eax, eax
jne 0x4062b9
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x20]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
mov ecx, dword [esp + 0x10]
push ecx
call edi
mov edx, dword [esp + 0x18]
push edx
call edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x218
ret 8