Function at 0x405520
Capabilities:
Query or enumerate registry value
Set registry value

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov ebp, ecx
push 0x50
call fcn.0041db86
push 0x14
mov ebx, eax
call fcn.0041db86
mov edi, dword [0x4398e8]
mov edx, eax
or ecx, 0xffffffff
xor eax, eax
add esp, 8
mov dword [esp + 0x10], edx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x437568
mov eax, ecx
mov esi, edi
mov edi, edx
push edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov eax, dword [ebp + 0x328]
lea ecx, [esp + 0x14]
xor esi, esi
push ecx
push 0xf003f
push esi
push eax
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x2c], 0x50
mov dword [esp + 0x28], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, esi
jne 0x405670
mov ecx, dword [ebp + 0x320]
xor eax, eax
cmp ecx, esi
je 0x4055bd
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp + 0x320], esi
mov edx, dword [esp + 0x14]
cmp eax, esi
mov dword [ebp + 0x320], edx
jne 0x405670
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x18]
push eax
mov eax, dword [ebp + 0x320]
lea ecx, [esp + 0x18]
push ebx
push ecx
push esi
push edx
push eax
mov dword [esp + 0x2c], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x405657
push esi
push esi
push str._Not_able_to_get_the_port_settings__defaults_values_will_be_set
call fcn.00424a00
mov edi, str.9600_n_8_1
or ecx, 0xffffffff
xor eax, eax
push ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp + 0x320]
inc eax
push eax
mov eax, dword [esp + 0x14]
push ebx
push 1
push 0
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
je 0x405655
push 0
push 0
push str._Not_able_to_set_the_port_settings
call fcn.00424a00
xor esi, esi
mov eax, dword [ebp + 0x320]
cmp eax, esi
je 0x405677
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp + 0x320], esi
jmp 0x405677
mov byte [ebp + 0x330], 1
push ebx
mov ecx, ebp
call fcn.00405cb0
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0x4375e4
push ebx
mov ecx, ebp
call fcn.00405d10
mov esi, eax
cmp byte [esi], 0
je 0x40569e
mov byte [esi], 0
inc esi
cmp byte [ebx], 0
je 0x4056b2
push ebx
mov ecx, ebp
call fcn.00405d40
mov dword [0x4398ec], eax
jmp 0x4056bc
mov dword [0x4398ec], 0x2580
push 0x4375e4
push esi
mov ecx, ebp
mov edi, esi
call fcn.00405d10
mov esi, eax
cmp byte [esi], 0
je 0x4056d6
mov byte [esi], 0
inc esi
push edi
mov ecx, ebp
call fcn.00405cb0
movsx eax, byte [edi]
add eax, 0xffffff9b
cmp eax, 0xe
ja case.0x4056f1.103
xor edx, edx
mov dl, byte [eax + 0x40583c]
jmp dword [edx*4 + 0x405824]
mov dword [0x4398f4], 1
jmp 0x405732
mov dword [0x4398f4], 2
jmp 0x405732
mov dword [0x4398f4], 3
jmp 0x405732
mov dword [0x4398f4], 4
jmp 0x405732
mov dword [0x4398f4], 0
push 0x4375e4
push esi
mov ecx, ebp
mov edi, esi
call fcn.00405d10
mov esi, eax
cmp byte [esi], 0
je 0x40574c
mov byte [esi], 0
inc esi
push edi
mov ecx, ebp
call fcn.00405cb0
movsx eax, byte [edi]
sub eax, 0x30
cmp eax, 5
jl 0x405764
cmp eax, 8
jle 0x405769
mov eax, 8
push 0x4375e4
push esi
mov ecx, ebp
mov dword [0x4398f0], eax
mov edi, esi
call fcn.00405d10
mov esi, eax
cmp byte [esi], 0
je 0x405788
mov byte [esi], 0
inc esi
push edi
mov ecx, ebp
call fcn.00405cb0
push 0x4375e0
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x4057cc
push 0x4375dc
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jne 0x4057b7
mov eax, 1
jmp 0x4057cc
push 0x4375d8
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
neg eax
sbb eax, eax
and al, 0xfe
add eax, 2
push 0x4375e4
push esi
mov ecx, ebp
mov dword [0x4398f8], eax
call fcn.00405d10
cmp byte [eax], 0
je 0x4057e6
mov byte [eax], 0
push esi
mov ecx, ebp
call fcn.00405cb0
mov al, byte [esi]
cmp al, 0x70
jne 0x4057fb
mov eax, 1
jmp 0x405804
sub al, 0x78
neg al
sbb eax, eax
and eax, 2
push ebx
mov dword [0x4398fc], eax
call fcn.0041dbaf
mov eax, dword [esp + 0x14]
push eax
call fcn.0041dbaf
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret