Function at 0x10005150
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x1008c224]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0x14]
push esi
push edi
push 0x81032068
mov dword [ebp - 0x28], ebx
mov edi, 1
call fcn.10047840
add esp, 4
mov esi, eax
test ebx, ebx
je 0x10005187
mov dword [ebx], 0
call fcn.10004c30
test eax, eax
je 0x1000531a
cmp esi, 0xffffffff
jne 0x100051ab
push str.SimpleSock:_Couldnt_get_VMCI_socket_family_info.
call sym.vmtools.dll_Warning
add esp, 4
jmp 0x1000531a
mov ecx, dword [ebp + 0xc]
xor eax, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ecx
push eax
push str.SimpleSock:_creating_new_socket__connecting_to__u:_u_n
mov word [ebp - 0x14], si
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], ecx
call sym.vmtools.dll_Debug
movzx eax, word [ebp - 0x14]
add esp, 0xc
push 0
push 1
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x10005210
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call sym.vmtools.dll_Err_Errno2String
push eax
push esi
push str.SimpleSock:_failed_to_create_socket__error__d:__s_n
call sym.vmtools.dll_Warning
add esp, 0x10
jmp 0x1000531a
cmp dword [ebp + 0x10], 0
je 0x100052e1
mov cx, word [ebp - 0x14]
xor eax, eax
mov dword [ebp - 0x24], eax
push 0x8103206c
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov word [ebp - 0x24], cx
call fcn.10047840
add esp, 4
mov dword [ebp - 0x1c], eax
mov ebx, 0x3ff
push 0x10
lea edx, [ebp - 0x24]
push edx
push esi
mov dword [ebp - 0x20], ebx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x100052cf
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
cmp edi, 0x271d
je 0x10005295
cmp edi, 0x2740
jne 0x100052b0
dec ebx
cmp ebx, 1
jge 0x10005245
push esi
push str.SimpleSock:_Failed_to_bind_to_privileged_port_for_socket__d__no_port_available_n
call sym.vmtools.dll_Debug
push esi
mov edi, 3
call fcn.100050f0
add esp, 0xc
jmp 0x1000531a
push esi
push str.SimpleSock:_Couldnt_bind_to_privileged_port_for_socket__d_n
call sym.vmtools.dll_Debug
push esi
mov edi, 4
call fcn.100050f0
add esp, 0xc
jmp 0x1000531a
push edi
call sym.vmtools.dll_Err_Errno2String
push eax
push edi
push str.SimpleSock:_could_not_bind_socket__error__d:__s_n
call sym.vmtools.dll_Warning
push esi
call fcn.100050f0
mov edi, 3
jmp 0x10005317
mov eax, dword [ebp - 0x20]
push esi
push eax
push str.SimpleSock:_Successfully_bound_to_port__d_for_socket__d_n
call sym.vmtools.dll_Debug
add esp, 0xc
push 0x10
lea ecx, [ebp - 0x14]
push ecx
push esi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x10005337
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
push edi
call sym.vmtools.dll_Err_Errno2String
push eax
push edi
push str.SimpleSock:_socket_connect_failed__error__d:__s_n
call sym.vmtools.dll_Debug
push esi
call fcn.100050f0
mov edi, 2
add esp, 0x14
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x10005323
mov dword [eax], edi
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1004e3f2
mov esp, ebp
pop ebp
ret
push esi
push str.SimpleSock:_socket__d_connected_n
call sym.vmtools.dll_Debug
mov ecx, dword [ebp - 4]
add esp, 8
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.1004e3f2
mov esp, ebp
pop ebp
ret