Function at 0x40b6b0
Capabilities:
Access peb ldr_data
Get number of processors
Query or enumerate registry value

Disassembly:
push 0xffffffffffffffff
push 0x41c812
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x144
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
lea ecx, [esp + 0x10]
mov dword [esp + 0x1c], ebx
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0xc]
mov dword [esp + 0x158], ebx
call sub.MFC42.DLL_CString::CString_2
mov byte [esp + 0x158], 1
call sub.MFC42.DLL_AfxGetModuleState
mov esi, dword [eax + 4]
lea eax, [edi + 0x22c]
push str.ScHardware
lea ecx, [esp + 0x30]
push eax
push ecx
mov dword [esp + 0x30], esi
call fcn.0040f690
add esp, 0xc
mov eax, dword [eax + 4]
mov byte [esp + 0x158], 2
cmp eax, ebx
jne 0x40b730
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::operator_1
push 1
lea ecx, [esp + 0x30]
mov byte [esp + 0x15c], 1
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x20]
push edx
push 0x20019
push ebx
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, ebx
jne 0x40b9dd
push ebp
xor ebp, ebp
add esi, 0x578
mov dword [esp + 0x1c], esi
push ebp
lea ecx, [esp + 0x58]
push str.Channel_dComPort
push ecx
mov byte [esp + 0x60], bl
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea edx, [esp + 0x2c]
lea eax, [esp + 0xd4]
lea ecx, [esp + 0x40]
push edx
push eax
mov eax, dword [esp + 0x2c]
push ecx
lea edx, [esp + 0x60]
push ebx
push edx
push eax
mov dword [esp + 0x44], 0x80
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
cmp eax, ebx
jne 0x40b996
mov esi, dword [esp + 0xd4]
and esi, 0xff
jbe 0x40b8d8
cmp esi, 0x64
jae 0x40b8d8
mov edx, dword [esp + 0x28]
lea ecx, [esi + esi*2]
lea eax, [edx + ecx*4]
mov ecx, dword [edx + ecx*4 + 0xc8]
cmp ecx, ebx
je 0x40b83a
cmp dword [eax + 0xd0], 1
jne 0x40b83a
push esi
lea eax, [esp + 0xd8]
push 0x4248e4
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x28]
add esp, 0xc
lea edx, [esi + esi*2 + 0x33]
mov dword [ecx + edx*4], 1
push esi
mov dword [eax], esi
call fcn.00406610
jmp 0x40b970
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString_2
push 0x67
lea ecx, [esp + 0x1c]
mov byte [esp + 0x160], 3
call sub.MFC42.DLL_CString::LoadStringA
lea ecx, [esp + 0x44]
push ebp
push ecx
mov ecx, dword [edi + 0x148]
call fcn.0040ba60
mov eax, dword [eax + 4]
mov byte [esp + 0x15c], 4
cmp eax, ebx
jne 0x40b87b
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov edx, dword [esp + 0x18]
push esi
push eax
push esi
lea eax, [esp + 0x1c]
push edx
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0x14
lea ecx, [esp + 0x44]
mov byte [esp + 0x15c], 3
push 1
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov eax, dword [edi + 0x270]
cmp eax, ebx
jne 0x40b8b3
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov ecx, dword [esp + 0x10]
push 0x30
push eax
push ecx
mov ecx, edi
call sub.MFC42.DLL_CWnd::MessageBoxA
lea ecx, [esp + 0x18]
mov byte [esp + 0x15c], 1
call sub.MFC42.DLL_CString::CString
jmp 0x40b970
cmp esi, ebx
je 0x40b970
mov ecx, dword [edi + 0x148]
lea edx, [esp + 0x30]
push ebp
push edx
call fcn.0040ba60
mov eax, dword [eax + 4]
mov byte [esp + 0x15c], 5
cmp eax, ebx
jne 0x40b905
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
push esi
lea eax, [esp + 0x18]
push str.Registry_indicates_illegal_port_number_COM_d_is_assigned_to_trunk__s._Please_assign_an_other_port.
push eax
call sub.MFC42.DLL_CString::Format
mov eax, dword [esp + 0x44]
add esp, 0x10
cmp eax, ebx
mov byte [esp + 0x15c], 1
je 0x40b946
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x40b93d
cmp al, 0xff
je 0x40b93d
dec al
mov byte [ecx], al
jmp 0x40b946
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov eax, dword [edi + 0x270]
mov dword [esp + 0x34], ebx
cmp eax, ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
jne 0x40b961
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov ecx, dword [esp + 0x10]
push 0x30
push eax
push ecx
mov ecx, edi
call sub.MFC42.DLL_CWnd::MessageBoxA
mov ecx, dword [esp + 0x1c]
inc ebp
add ecx, 4
cmp ebp, 4
mov dword [esp + 0x1c], ecx
jl 0x40b77e
mov ecx, dword [esp + 0x24]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
jmp 0x40ba1a
push ebp
lea edx, [esp + 0x14]
push str.Unable_to_read_registry_value_Channel_dComPort._COM_ports_can_not_be_assigned.
push edx
call sub.MFC42.DLL_CString::Format
mov eax, dword [edi + 0x270]
add esp, 0xc
cmp eax, ebx
jne 0x40b9b8
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push 0x30
push eax
mov eax, dword [esp + 0x18]
mov ecx, edi
push eax
call sub.MFC42.DLL_CWnd::MessageBoxA
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x20], 1
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
jmp 0x40ba1a
mov edx, dword [esp + 0x10]
lea eax, [esp + 0xc]
push edx
push str.Unable_to_open_registry_key__s._COM_ports_can_not_be_assigned._Please_install_Insight.
push eax
call sub.MFC42.DLL_CString::Format
mov eax, dword [edi + 0x270]
add esp, 0xc
cmp eax, ebx
jne 0x40ba03
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov ecx, dword [esp + 0xc]
push 0x30
push eax
push ecx
mov ecx, edi
call sub.MFC42.DLL_CWnd::MessageBoxA
mov dword [esp + 0x1c], 1
lea ecx, [esp + 0xc]
mov byte [esp + 0x158], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x10]
mov dword [esp + 0x158], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x150]
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x150
ret