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

Disassembly:
mov r11, rsp
sub rsp, 0x4d8
mov rax, qword [0x0041c058]
xor rax, rsp
mov qword [rsp + 0x490], rax
mov qword [r11 - 0x10], rbp
mov qword [r11 - 0x18], rsi
mov qword [r11 - 0x28], r12
mov qword [r11 - 0x30], r13
mov rsi, r8
mov r12, rcx
mov r13d, edx
mov r8d, edx
lea rdx, str.COM_d
lea rcx, [r11 - 0x438]
mov qword [rsp + 0x48], 0xffffffffffffffff
xor ebp, ebp
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rsp + 0x48]
call sub.MSPORTS.DLL_ComDBOpen
test eax, eax
je 0x403c47
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Couldnt_open_COM_database__0x_X_
mov edx, 0xff
mov r9d, eax
mov rcx, rsi
call fcn.004069c0
jmp 0x40428f
mov rcx, qword [rsp + 0x48]
xor r9d, r9d
lea rax, [rsp + 0x50]
lea rdx, [rsp + 0x78]
lea r8d, [r9 + 0x20]
mov qword [rsp + 0x4b8], rdi
mov qword [rsp + 0x20], rax
call sub.MSPORTS.DLL_ComDBGetCurrentPortUsage
mov eax, r13d
cdq
and edx, 7
add eax, edx
and eax, 7
sub eax, edx
je 0x403c8c
lea ecx, [rax - 1]
mov edi, 1
shl dil, cl
jmp 0x403c8f
mov dil, 0x80
lea eax, [r13 - 1]
cdq
and edx, 7
add eax, edx
sar eax, 3
movsxd rcx, eax
test byte [rsp + rcx + 0x78], dil
je 0x403cbf
lea r8, str.Port_already_in_use
mov edx, 0xff
mov rcx, rsi
call fcn.004069c0
jmp 0x404287
lea rcx, [0x004163c0]
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x4d0], rbx
call qword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
cmp rax, 0xffffffffffffffff
mov rbx, rax
jne 0x403d0a
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Error_getting_port_class_devices__0x_X_
mov edx, 0xff
mov r9d, eax
mov rcx, rsi
call fcn.004069c0
jmp 0x404270
lea r9, [rsp + 0x40]
lea rdx, [rsp + 0x58]
mov r8, r12
mov rcx, rax
call fcn.00403a10
cmp byte [rsp + 0x40], bpl
je 0x40425c
test eax, eax
jne 0x40425c
lea r8d, [rax + 1]
lea rdx, [rsp + 0x58]
xor r9d, r9d
mov rcx, rbx
mov dword [rsp + 0x28], 0xf003f
mov dword [rsp + 0x20], 1
call qword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
cmp rax, 0xffffffffffffffff
mov r12, rax
jne 0x403d82
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Couldnt_open_the_SOL_devices_registry_key__0x_X_
mov edx, 0xff
mov r9d, eax
mov rcx, rsi
call fcn.004069c0
jmp 0x40424b
lea rax, [rsp + 0x290]
mov qword [rsp + 0x30], rbp
lea rdx, [rsp + 0x58]
xor r9d, r9d
xor r8d, r8d
mov rcx, rbx
mov dword [rsp + 0x28], 0x200
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyW]
test eax, eax
jne 0x403dd6
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Couldnt_get_SOL_device_description__0x_X_
mov edx, 0xff
mov r9d, eax
mov rcx, rsi
call fcn.004069c0
jmp 0x40424b
lea r9, [rsp + 0xa0]
lea r8, [rsp + 0x290]
lea rdx, str._s___s_
lea rcx, [rsp + 0x1e0]
call fcn.004042e0
lea rax, [rsp + 0x44]
lea rdx, str.PortName
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0xd0]
xor r9d, r9d
xor r8d, r8d
mov rcx, r12
mov dword [rsp + 0x44], 0x2a
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x403e55
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Couldnt_get_current_SOL_COM_port_number__0x_X_
mov edx, 0xff
mov r9d, eax
mov rcx, rsi
call fcn.004069c0
jmp 0x40424b
mov r8d, dword [rsp + 0x44]
lea rdx, [rsp + 0xa0]
lea rcx, [rsp + 0xd0]
call fcn.00406d50
test eax, eax
jne 0x403e94
lea r9, [rsp + 0xd0]
lea r8, str.SOL_device_is_already_using_port__s._No_COM_port_change_needed
mov edx, 0xff
mov rcx, rsi
call fcn.004069c0
jmp 0x40424b
lea rcx, [rsp + 0xd6]
call fcn.004069f0
lea r8, [rsp + 0x78]
lea rdx, [rsp + 0x58]
mov r9d, 0x14
mov rcx, rbx
mov dword [rsp + 0x78], 8
mov edi, eax
mov dword [rsp + 0x7c], 0x12
mov dword [rsp + 0x88], ebp
mov dword [rsp + 0x80], 2
mov dword [rsp + 0x84], 2
call qword [sym.imp.SETUPAPI.dll_SetupDiSetClassInstallParamsW]
test eax, eax
je 0x40422e
lea r8, [rsp + 0x58]
mov rdx, rbx
mov ecx, 0x12
call qword [sym.imp.SETUPAPI.dll_SetupDiCallClassInstaller]
test eax, eax
je 0x40422e
mov rcx, qword [rsp + 0x48]
mov edx, edi
call sub.MSPORTS.DLL_ComDBReleasePort
mov rcx, qword [rsp + 0x48]
xor r9d, r9d
lea r8d, [r9 + 1]
mov edx, r13d
call sub.MSPORTS.DLL_ComDBClaimPort
xor eax, eax
lea rdi, [rsp + 0x1e0]
mov rcx, 0xffffffffffffffff
lea r9, [rsp + 0x1e0]
lea rdx, [rsp + 0x58]
repne scasw ax, word [rdi]
mov r8d, 0xc
not rcx
lea eax, [rcx + rcx]
mov rcx, rbx
mov dword [rsp + 0x20], eax
call qword [sym.imp.SETUPAPI.dll_SetupDiSetDeviceRegistryPropertyW]
lea rdx, [rsp + 0xd0]
lea rcx, [rsp + 0x100]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
lea r8, [0x0041816c]
lea rcx, [rsp + 0x100]
mov edx, 0x14
call fcn.00406c80
lea rdx, [rsp + 0xa0]
lea rcx, [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
lea r8, [0x0041816c]
lea rcx, [rsp + 0x78]
mov edx, 0x14
call fcn.00406c80
lea r9, [rsp + 0x130]
lea r8, [0x00418150]
lea rdx, [rsp + 0x100]
lea rcx, [0x00418170]
mov word [rsp + 0x130], bp
mov dword [rsp + 0x20], 0x51
call qword [sym.imp.KERNEL32.dll_GetProfileStringW]
cmp word [rsp + 0x130], bp
jne 0x404017
lea r8, str.9600_n_8_1
lea rdx, [rsp + 0x78]
lea rcx, [0x00418170]
call qword [sym.imp.KERNEL32.dll_WriteProfileStringW]
jmp 0x404031
lea r8, [rsp + 0x130]
lea rdx, [rsp + 0x78]
lea rcx, [0x00418170]
call qword [sym.imp.KERNEL32.dll_WriteProfileStringW]
lea rdx, [rsp + 0x100]
lea rcx, [0x00418170]
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_WriteProfileStringW]
xor eax, eax
lea rdi, [rsp + 0xa0]
mov rcx, 0xffffffffffffffff
lea rdx, str.PortName
mov r9d, 1
repne scasw ax, word [rdi]
xor r8d, r8d
not rcx
lea eax, [rcx + rcx]
mov rcx, r12
mov dword [rsp + 0x28], eax
lea rax, [rsp + 0xa0]
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
lea r8, [rsp + 0x78]
lea rdx, [rsp + 0x58]
mov r9d, 0x14
mov rcx, rbx
mov dword [rsp + 0x78], 8
mov dword [rsp + 0x7c], 0x12
mov dword [rsp + 0x88], ebp
mov dword [rsp + 0x80], 1
mov dword [rsp + 0x84], 1
call qword [sym.imp.SETUPAPI.dll_SetupDiSetClassInstallParamsW]
test eax, eax
je 0x4040ea
lea r8, [rsp + 0x58]
mov rdx, rbx
mov ecx, 0x12
call qword [sym.imp.SETUPAPI.dll_SetupDiCallClassInstaller]
lea r8, [rsp + 0x78]
lea rdx, [rsp + 0x58]
mov r9d, 0x14
mov rcx, rbx
mov dword [rsp + 0x78], 8
mov dword [rsp + 0x7c], 0x12
mov dword [rsp + 0x88], ebp
mov dword [rsp + 0x80], 1
mov dword [rsp + 0x84], 2
call qword [sym.imp.SETUPAPI.dll_SetupDiSetClassInstallParamsW]
test eax, eax
je 0x404155
lea r8, [rsp + 0x58]
mov rdx, rbx
mov ecx, 0x12
call qword [sym.imp.SETUPAPI.dll_SetupDiCallClassInstaller]
test eax, eax
je 0x404155
mov ebp, 1
jmp 0x40424b
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Couldnt_enable_SOL_device__0x_X_
mov edx, 0xff
mov r9d, eax
mov rcx, rsi
call fcn.004069c0
lea r8, [rsp + 0x78]
lea rdx, [rsp + 0x58]
mov r9d, 0x14
mov rcx, rbx
mov dword [rsp + 0x78], 8
mov dword [rsp + 0x7c], 0x12
mov dword [rsp + 0x88], ebp
mov dword [rsp + 0x80], 1
mov dword [rsp + 0x84], 1
call qword [sym.imp.SETUPAPI.dll_SetupDiSetClassInstallParamsW]
test eax, eax
je 0x4041cf
lea r8, [rsp + 0x58]
mov rdx, rbx
mov ecx, 0x12
call qword [sym.imp.SETUPAPI.dll_SetupDiCallClassInstaller]
lea r8, [rsp + 0x78]
lea rdx, [rsp + 0x58]
mov r9d, 0x14
mov rcx, rbx
mov dword [rsp + 0x78], 8
mov dword [rsp + 0x7c], 0x12
mov dword [rsp + 0x88], ebp
mov dword [rsp + 0x80], 1
mov dword [rsp + 0x84], 2
call qword [sym.imp.SETUPAPI.dll_SetupDiSetClassInstallParamsW]
test eax, eax
je 0x40424b
lea r8, [rsp + 0x58]
mov rdx, rbx
mov ecx, 0x12
call qword [sym.imp.SETUPAPI.dll_SetupDiCallClassInstaller]
jmp 0x40424b
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Couldnt_disable_SOL_device__0x_X_
mov edx, 0xff
mov r9d, eax
mov rcx, rsi
call fcn.004069c0
cmp r12, 0xffffffffffffffff
je 0x404270
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x404270
lea r8, str.Couldnt_find_a_SOL_device
mov edx, 0xff
mov rcx, rsi
call fcn.004069c0
cmp rbx, 0xffffffffffffffff
je 0x40427f
mov rcx, rbx
call qword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
mov rbx, qword [rsp + 0x4d0]
mov rdi, qword [rsp + 0x4b8]
mov rcx, qword [rsp + 0x48]
mov r13, qword [rsp + 0x4a8]
mov r12, qword [rsp + 0x4b0]
cmp rcx, 0xffffffffffffffff
mov rsi, qword [rsp + 0x4c0]
je 0x4042b7
call sub.MSPORTS.DLL_ComDBClose
mov eax, ebp
mov rbp, qword [rsp + 0x4c8]
mov rcx, qword [rsp + 0x490]
xor rcx, rsp
call fcn.00405a80
add rsp, 0x4d8
ret