Function at 0x4137b0
Capabilities:
Access peb ldr_data
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5604d0
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
push edi
mov eax, dword [0x640040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, ecx
mov dword [ebp - 4], 0
cmp dword [esi + 8], 0
jne 0x413812
push ecx
mov eax, esp
mov dword [ebp - 0x14], esp
push eax
call fcn.00411080
mov byte [ebp - 4], 1
push dword [ebp + 8]
mov byte [ebp - 4], 0
mov ecx, esi
call fcn.004a9d40
cmp dword [esi + 8], 0
je 0x413ba0
push 0x148
mov ebx, dword [sym.imp.mfc140u.dll_operator]
call ebx
add esp, 4
mov edi, eax
mov dword [ebp + 8], edi
mov byte [ebp - 4], 2
test edi, edi
je 0x41387d
push 0x148
push 0
push edi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 1
push dword [esi + 8]
push ecx
mov ecx, esp
mov dword [ebp - 0x14], esp
push str.PC_port_name
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 3
push ecx
mov ecx, esp
mov dword [ebp - 0x18], esp
push str.PCPortName
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 4
mov byte [ebp - 4], 2
mov ecx, edi
call fcn.004b3310
mov edx, eax
jmp 0x41387f
xor edx, edx
mov byte [ebp - 4], 0
mov eax, 8
mov word [edx + 0x90], ax
mov eax, 0x401d
mov word [edx + 0x28], ax
lea eax, [esi + 0x1adc]
mov dword [edx + 0x30], eax
mov eax, dword [edx + 0x78]
or eax, 0x20
mov dword [edx + 0x78], eax
mov ecx, dword [esi + 8]
add ecx, 0xc
push edx
call dword [sym.imp.mfc140u.dll_Ordinal_2006]
push 0x148
call ebx
add esp, 4
mov edi, eax
mov dword [ebp + 8], edi
mov byte [ebp - 4], 5
test edi, edi
je 0x41391c
push 0x148
push 0
push edi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0
push dword [esi + 8]
push ecx
mov ecx, esp
mov dword [ebp - 0x18], esp
push str.Port_baud_rate
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 6
push ecx
mov ecx, esp
mov dword [ebp - 0x14], esp
push str.Baud
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 7
mov byte [ebp - 4], 5
mov ecx, edi
call fcn.004b3310
mov edi, eax
jmp 0x41391e
xor edi, edi
mov byte [ebp - 4], 0
mov eax, 0x13
mov word [edi + 0x90], ax
push str.baud
mov ecx, edi
call fcn.004b8d60
mov eax, 0x4013
mov word [edi + 0x28], ax
lea eax, [esi + 0x1ae0]
mov dword [edi + 0x30], eax
mov eax, dword [edi + 0x78]
or eax, 0x20
mov dword [edi + 0x78], eax
mov eax, dword [edi + 0x70]
or eax, 0x10
mov dword [edi + 0x70], eax
mov ecx, dword [esi + 8]
add ecx, 0xc
push edi
mov eax, dword [sym.imp.mfc140u.dll_Ordinal_2006]
call eax
push 0x148
call ebx
add esp, 4
mov edi, eax
mov dword [ebp + 8], edi
mov byte [ebp - 4], 8
test edi, edi
je 0x4139d1
push 0x148
push 0
push edi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 1
push dword [esi + 8]
push ecx
mov ecx, esp
mov dword [ebp - 0x18], esp
push str.Port_data_bits
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 9
push ecx
mov ecx, esp
mov dword [ebp - 0x14], esp
push str.DataBits
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 0xa
mov byte [ebp - 4], 8
mov ecx, edi
call fcn.004b3310
mov edi, eax
jmp 0x4139d3
xor edi, edi
mov byte [ebp - 4], 0
mov eax, 0x12
mov word [edi + 0x90], ax
push str.bits
mov ecx, edi
call fcn.004b8d60
mov eax, 0x4012
mov word [edi + 0x28], ax
lea eax, [esi + 0x1ae4]
mov dword [edi + 0x30], eax
mov eax, dword [edi + 0x78]
or eax, 0x20
mov dword [edi + 0x78], eax
mov eax, dword [edi + 0x70]
or eax, 0x10
mov dword [edi + 0x70], eax
mov ecx, dword [esi + 8]
add ecx, 0xc
push edi
mov edi, dword [sym.imp.mfc140u.dll_Ordinal_2006]
call edi
push 0x148
call ebx
add esp, 4
mov dword [ebp + 8], eax
mov byte [ebp - 4], 0xb
test eax, eax
je 0x413a86
push 0x148
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0
push dword [esi + 8]
push ecx
mov ecx, esp
mov dword [ebp - 0x18], esp
push str.Port_parity
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 0xc
push ecx
mov ecx, esp
mov dword [ebp - 0x14], esp
push 0x58ef10
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 0xd
mov byte [ebp - 4], 0xb
mov ecx, dword [ebp + 8]
call fcn.004b3310
mov edx, eax
jmp 0x413a88
xor edx, edx
mov byte [ebp - 4], 0
mov eax, 0x12
mov word [edx + 0x90], ax
mov eax, 0x4012
mov word [edx + 0x28], ax
lea eax, [esi + 0x1ae6]
mov dword [edx + 0x30], eax
mov eax, dword [edx + 0x78]
or eax, 0x20
mov dword [edx + 0x78], eax
mov eax, dword [edx + 0x70]
or eax, 0x10
mov dword [edx + 0x70], eax
mov ecx, dword [esi + 8]
add ecx, 0xc
push edx
call edi
push 0x148
call ebx
add esp, 4
mov edi, eax
mov dword [ebp + 8], edi
mov byte [ebp - 4], 0xe
test edi, edi
je 0x413b2a
push 0x148
push 0
push edi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0
push dword [esi + 8]
push ecx
mov ecx, esp
mov dword [ebp - 0x18], esp
push str.Reinitialize_Port_Connection
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 0xf
push ecx
mov ecx, esp
mov dword [ebp - 0x14], esp
push str.ReInitPort
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__26]
mov byte [ebp - 4], 0x10
mov byte [ebp - 4], 0xe
mov ecx, edi
call fcn.004b3310
mov edx, eax
jmp 0x413b2c
xor edx, edx
mov byte [ebp - 4], 0
mov eax, 0xb
mov word [edx + 0x90], ax
mov eax, 0x400b
mov word [edx + 0x28], ax
lea eax, [esi + 0x18]
mov dword [edx + 0x30], eax
mov eax, dword [edx + 0x78]
or eax, 0x20
mov dword [edx + 0x78], eax
mov ecx, dword [esi + 8]
add ecx, 0xc
push edx
mov eax, dword [sym.imp.mfc140u.dll_Ordinal_2006]
call eax
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov dword [ebp - 4], 0xffffffff
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4