Function at 0x40e780
Capabilities:
Check os version
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [sym.Bentley.lictransmit.exe_int_Bentley::SelectServer::Client::HostInfo::m_runningTS]
sub esp, 0x144
cmp eax, 0xffffffff
push ebx
push esi
push edi
je 0x40e7ac
xor ecx, ecx
test eax, eax
setne cl
mov al, cl
lea esp, [ebp - 0x150]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x9c
xor edi, edi
lea edx, [ebp - 0xa8]
push edi
push edx
call sub.MSVCR80.dll_memset
add esp, 0xc
lea eax, [ebp - 0xa8]
push eax
mov dword [ebp - 0xa8], 0x9c
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [ebp - 0x98], 2
mov dword [sym.Bentley.lictransmit.exe_int_Bentley::SelectServer::Client::HostInfo::m_runningTS], edi
je 0x40e813
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x38]
push str.Not_NT_so_no_terminal_server
push eax
call edx
add esp, 8
mov dword [sym.Bentley.lictransmit.exe_int_Bentley::SelectServer::Client::HostInfo::m_runningTS], edi
xor al, al
lea esp, [ebp - 0x150]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xa4]
cmp eax, 4
jne 0x40e924
mov dword [ebp - 4], edi
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x38]
push str.Checking_for_terminal_server_on_NT4
push eax
call edx
add esp, 8
lea eax, [ebp - 4]
push eax
push edi
push edi
push str.SystemCurrentControlSetControlProductOptions
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40e9f1
mov eax, dword [ebp - 4]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea ecx, [ebp - 0xc]
push ecx
push edi
lea edx, [ebp - 8]
push edx
push edi
push str.ProductSuite
push eax
mov dword [ebp - 8], edi
mov dword [ebp - 0xc], edi
call esi
test eax, eax
jne 0x40e90d
mov eax, dword [ebp - 0xc]
cmp eax, edi
je 0x40e90d
call fcn.0041b450
mov ebx, esp
cmp ebx, edi
je 0x40e90d
mov eax, dword [ebp - 4]
lea ecx, [ebp - 0xc]
push ecx
push ebx
lea edx, [ebp - 8]
push edx
push edi
push str.ProductSuite
push eax
call esi
test eax, eax
jne 0x40e90d
cmp dword [ebp - 8], 7
jne 0x40e90d
cmp byte [ebx], al
je 0x40e90d
lea ebx, [ebx]
mov edi, str.Terminal_Server
mov esi, ebx
mov ecx, 0x10
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40e8ee
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40e8d7
sub eax, edx
cmp byte [ebx + eax + 1], cl
lea ebx, [ebx + eax + 1]
jne 0x40e8c0
jmp 0x40e90d
mov dword [sym.Bentley.lictransmit.exe_int_Bentley::SelectServer::Client::HostInfo::m_runningTS], 1
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x38]
push str.Running_terminal_server_on_NT4
push eax
call edx
add esp, 8
mov eax, dword [ebp - 4]
test eax, eax
je 0x40e9f1
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40e9f1
cmp eax, 5
jb 0x40e9f1
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x38]
push str.Checking_for_terminal_server_on_2K
push eax
call edx
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
add esp, 8
push str.ntdll.dll
call esi
cmp eax, edi
je 0x40e9f1
push str.VerSetConditionMask
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, edi
je 0x40e9f1
push 6
push 0x40
push edi
push edi
call eax
push str.KERNEL32.DLL
mov ebx, eax
mov edi, edx
call esi
test eax, eax
je 0x40e9f1
push str.VerifyVersionInfoA
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40e9f1
push 0x9c
lea eax, [ebp - 0x144]
push 0
push eax
call sub.MSVCR80.dll_memset
add esp, 0xc
push edi
push ebx
push 0x40
lea ecx, [ebp - 0x144]
push ecx
mov dword [ebp - 0x144], 0x9c
mov word [ebp - 0xac], 0x10
call esi
neg eax
sbb eax, eax
neg eax
mov dword [sym.Bentley.lictransmit.exe_int_Bentley::SelectServer::Client::HostInfo::m_runningTS], eax
call fcn.004044f0
mov ecx, dword [sym.Bentley.lictransmit.exe_int_Bentley::SelectServer::Client::HostInfo::m_runningTS]
mov edx, dword [eax]
mov edx, dword [edx + 0x38]
push ecx
push str.Running_terminal_server_on_2K___d
push eax
call edx
add esp, 0xc
xor eax, eax
cmp dword [sym.Bentley.lictransmit.exe_int_Bentley::SelectServer::Client::HostInfo::m_runningTS], eax
setne al
lea esp, [ebp - 0x150]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret