Function at 0x406610
Capabilities:
Get process heap force flags

Disassembly:
push 0xffffffffffffffff
push 0x41bda1
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x18
push ebx
push ebp
push esi
push edi
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString_2
xor ebx, ebx
lea ecx, [esp + 0x14]
mov dword [esp + 0x30], ebx
call sub.MFC42.DLL_CString::CString_2
mov al, byte [esp + 0x38]
push ebx
lea ecx, [esp + 0x1c]
mov byte [esp + 0x34], 1
mov byte [esp + 0x1c], al
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 ecx, str.Assign_COM_Ports_to_Dedicated_Trunks
mov byte [esp + 0x30], 2
shr ecx, 0x10
test cx, cx
je 0x406682
lea edx, [esp + 0x18]
push str.Assign_COM_Ports_to_Dedicated_Trunks
push edx
call fcn.00406f40
add esp, 8
jmp 0x40669f
xor eax, eax
cmp eax, str.Assign_COM_Ports_to_Dedicated_Trunks
je 0x40669f
xor ecx, ecx
mov edx, str.Assign_COM_Ports_to_Dedicated_Trunks
mov cx, dx
push ecx
lea ecx, [esp + 0x1c]
call fcn.00406aa0
mov eax, dword [esp + 0x38]
xor edi, edi
cmp eax, 0xa
mov byte [esp + 0x30], 3
push eax
jae 0x4066bc
lea eax, [esp + 0x14]
push str.COM_d
push eax
jmp 0x4066c6
lea ecx, [esp + 0x14]
push str..COM_d
push ecx
call sub.MFC42.DLL_CString::Format
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 0xc
mov edx, dword [esp + 0x10]
push ebx
push 0x40000080
push 3
push ebx
push ebx
push 0xc0000000
push edx
call esi
cmp eax, 0xffffffff
jne 0x4067a7
mov eax, edi
inc edi
cmp eax, 0x14
jg 0x40670a
push 0xc8
call ebp
jmp 0x4066da
mov ecx, dword [esp + 0x38]
lea edx, [esp + 0x14]
push ecx
push str.Port_COM_d_might_be_under_control_of_an_other_application.
push edx
call sub.MFC42.DLL_CString::Format
mov eax, dword [esp + 0x28]
mov esi, 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]
add esp, 0xc
cmp eax, ebx
je 0x406731
mov esi, eax
call sub.MFC42.DLL_AfxGetThread
cmp eax, ebx
je 0x406743
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
jmp 0x406745
xor eax, eax
mov ecx, dword [esp + 0x14]
push 0x30
push esi
push ecx
mov ecx, eax
call sub.MFC42.DLL_CWnd::MessageBoxA
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x406779
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x406770
cmp al, 0xff
je 0x406770
dec al
mov byte [ecx], al
jmp 0x406779
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x14]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov byte [esp + 0x30], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x10]
mov dword [esp + 0x30], 0xffffffff
call sub.MFC42.DLL_CString::CString
xor eax, eax
jmp 0x406802
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x4067d3
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x4067ca
cmp al, 0xff
je 0x4067ca
dec al
mov byte [ecx], al
jmp 0x4067d3
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x14]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov byte [esp + 0x30], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x10]
mov dword [esp + 0x30], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, 1
mov ecx, dword [esp + 0x28]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x24
ret 4