Function at 0x40ee90
Capabilities:
Get hostname

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov word [esi], 0
call sym.Bentley.lictransmit.exe_public:_static_bool___cdecl_Bentley::SelectServer::Client::HostInfo::IsRunningWindowsTerminalServer_void_
test al, al
mov edi, dword [ebp + 0xc]
je 0x40ef37
push str.CLIENTNAME
call dword [sym.imp.MSVCR80.dll__wgetenv]
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40ef37
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40eec6
sub eax, edx
sar eax, 1
cmp eax, edi
jbe 0x40ef11
mov eax, ebx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40eee0
sub eax, edx
sar eax, 1
mov esi, eax
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x28]
push ebx
push esi
push str.GetHostName:_from_CLIENTNAME__Terminal_Server__is_too_long__d_:__s
push eax
call edx
add esp, 0x10
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push ebx
push esi
call dword [sym.imp.MSVCR80.dll_wcsncpy]
mov word [esi + edi*2 - 2], 0
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x38]
push esi
push str.GetHostName:_from_CLIENTNAME__Terminal_Server_:__s
push eax
call edx
add esp, 0x18
cmp word [esi], 0
jne 0x40f0a7
mov ebx, dword [sym.imp.KERNEL32.dll_GetComputerNameExW]
lea eax, [ebp + 8]
push eax
push 0
push 7
mov dword [ebp + 8], 0
call ebx
mov eax, dword [ebp + 8]
add eax, 1
cmp eax, edi
mov dword [ebp + 8], eax
jbe 0x40ef87
call fcn.004044f0
mov edx, dword [ebp + 8]
mov ecx, dword [eax]
push edx
push str.GetHostName:_GetComputerName_is_too_long__d_
push eax
mov eax, dword [ecx + 0x28]
call eax
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [ebp + 8]
push ecx
push esi
push 7
mov dword [ebp + 8], edi
call ebx
cmp eax, 1
jne 0x40efad
call fcn.004044f0
mov edx, dword [eax]
push esi
push str.GetHostName:_GetComputerName:__s
push eax
mov eax, dword [edx + 0x38]
call eax
jmp 0x40efce
call fcn.004044f0
mov ebx, dword [eax]
mov dword [ebp - 4], eax
add ebx, 0x28
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 4]
mov edx, dword [ebx]
push eax
push str.Unable_to_get_host_name_via_GetComputerName__GLE_d_
push ecx
call edx
add esp, 0xc
cmp word [esi], 0
jne 0x40f0a7
push str.COMPUTERNAME
call dword [sym.imp.MSVCR80.dll__wgetenv]
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40f070
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40eff6
sub eax, edx
sar eax, 1
cmp eax, edi
jbe 0x40f041
mov eax, ebx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40f010
sub eax, edx
sar eax, 1
mov esi, eax
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x28]
push ebx
push esi
push str.GetHostName:_from_COMPUTERNAME_is_too_long__d_:__s
push eax
call edx
add esp, 0x10
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push ebx
push esi
call dword [sym.imp.MSVCR80.dll_wcsncpy]
mov word [esi + edi*2 - 2], 0
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x38]
push esi
push str.GetHostName:_from_COMPUTERNAME:__s
push eax
call edx
add esp, 0x18
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push str.Unknown.Hostname
push esi
call dword [sym.imp.MSVCR80.dll_wcsncpy]
add esp, 0xc
mov word [esi + edi*2 - 2], 0
call fcn.004044f0
mov ebx, eax
mov edi, dword [ebx]
add edi, 0x28
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [edi]
push str.Unknown_hostname_in_GetHostName
push ebx
call eax
add esp, 0xc
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret