Function at 0x4788f0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd4
mov eax, dword [0x4ff94c]
xor eax, ebp
mov dword [ebp - 4], eax
mov edx, dword [0x50ded8]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor ebx, ebx
push edx
mov dword [ebp - 0xb8], esi
mov dword [ebp - 0xd4], eax
mov dword [ebp - 0xcc], ecx
mov dword [ebp - 0xc0], ebx
mov dword [ebp - 0xbc], ebx
call fcn.00408090
mov eax, dword [0x50ded8]
push ebx
push ebx
push eax
call fcn.004370d0
lea edx, [ebp - 0xa4]
add esp, 0x10
mov dword [0x50ea4c], 2
mov eax, esi
sub edx, esi
mov edi, 1
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, edi
test cl, cl
jne 0x478964
lea edx, [ebp - 0xa4]
cmp byte [ebp - 0xa4], bl
je 0x4789d5
lea ecx, [ecx]
mov al, byte [edx]
cmp al, 0x2f
je 0x478990
cmp al, 0x5c
je 0x478990
cmp al, 0x3a
jne 0x4789b3
jmp 0x478994
cmp al, 0x3a
jne 0x4789bb
mov cl, byte [edx + 1]
lea eax, [edx + 1]
test cl, cl
je 0x4789ae
mov edi, edi
cmp cl, 0x3a
je 0x4789b3
mov cl, byte [eax + edi]
add eax, edi
test cl, cl
jne 0x4789a0
cmp byte [eax], 0x3a
jne 0x4789bb
add edx, edi
cmp byte [edx], bl
jne 0x478980
jmp 0x4789d5
mov byte [edx], bl
add edx, edi
cmp byte [edx], bl
je 0x4789c9
mov dword [ebp - 0xcc], edx
lea esi, [ebp - 0xa4]
mov dword [ebp - 0xb8], esi
xor eax, eax
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xb0], eax
mov dword [ebp - 0xac], eax
mov dword [ebp - 0xa8], eax
cmp dword [0x514ebc], ebx
je 0x478a25
mov ecx, dword [0x524178]
push ecx
push str._Already_connected_to__s_n
mov edx, dword [0x50ded8]
push edx
call fcn.0043dba0
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b7f56
mov esp, ebp
pop ebp
ret
mov al, byte [esi]
cmp al, 0x40
je 0x478aff
cmp al, 0x21
je 0x478aff
push esi
call sub.WSOCK32.dll_inet_addr
mov ebx, eax
mov dword [ebp - 0xc8], ebx
cmp ebx, 0xffffffff
je 0x478a7f
mov eax, 2
mov edx, 0x50c9c0
mov word [ebp - 0xb4], ax
mov dword [ebp - 0xb0], ebx
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, edi
test cl, cl
jne 0x478a65
mov dword [0x524178], 0x50c9c0
jmp 0x478bae
mov ecx, dword [ebp - 0xb8]
push ecx
call sub.WSOCK32.dll_gethostbyname
mov esi, eax
mov dword [ebp - 0xc0], esi
test esi, esi
je 0x478ae2
mov dx, word [esi + 8]
mov word [ebp - 0xb4], dx
movsx eax, word [esi + 0xa]
mov ecx, dword [esi + 0xc]
mov edx, dword [ecx]
push eax
push edx
lea eax, [ebp - 0xb0]
push eax
call sub.MSVCR100.dll_memcpy
mov ecx, dword [esi]
push 0x40
push ecx
push 0x50c9c0
call dword [sym.imp.MSVCR100.dll_strncpy]
add esp, 0x18
mov byte [0x50c9ff], 0
mov dword [0x524178], 0x50c9c0
jmp 0x478bae
mov edx, dword [ebp - 0xb8]
mov eax, dword [0x50ded8]
push edx
push str.Unknown_host_name__s_n
mov dword [0x50ea4c], edi
push eax
jmp 0x478a0a
mov ebx, dword [ebp - 0xb8]
mov esi, dword [sym.imp.MSVCR100.dll_strrchr]
push 0x3a
push ebx
call esi
add esp, 8
mov dword [0x524178], eax
test eax, eax
jne 0x478b24
push 0x40
push ebx
call esi
add esp, 8
mov esi, dword [ebp - 0xb8]
lea ecx, [ebp - 0xd0]
push ecx
lea edx, [ebp - 0xbc]
push edx
add eax, edi
push esi
mov dword [0x524178], eax
mov dword [ebp - 0xbc], 0
call fcn.00478730
mov ebx, eax
add esp, 0xc
mov dword [ebp - 0xc8], ebx
test ebx, ebx
jne 0x478b8c
mov eax, dword [ebp - 0xbc]
mov ecx, dword [0x50ded8]
push eax
push str.Bad_source_route_:__s_n
push ecx
call fcn.0043dba0
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b7f56
mov esp, ebp
pop ebp
ret
cmp ebx, 0xffffffff
jne 0x478b9c
push esi
push str.Bad_source_route_option:__s_n
jmp 0x478a03
mov eax, 2
mov dword [ebp - 0xb0], ebx
mov word [ebp - 0xb4], ax
mov esi, dword [ebp - 0xcc]
test esi, esi
je 0x478d48
cmp byte [esi], 0x2d
jne 0x478bcb
add esi, edi
mov dword [0x515060], edi
jmp 0x478bd5
mov dword [0x515060], 0
push esi
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
mov word [ebp - 0xb2], ax
test ax, ax
jne 0x478d30
push 0x4e3c20
push esi
call sub.WSOCK32.dll_getservbyname
test eax, eax
je 0x478c0e
mov cx, word [eax + 8]
mov word [ebp - 0xb2], cx
jmp 0x478dc9
mov ecx, str.http
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x478c35
test dl, dl
je 0x478c31
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x478c35
add eax, 2
add ecx, 2
test dl, dl
jne 0x478c15
xor eax, eax
jmp 0x478c3a
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x478c51
push 0x50
call sub.WSOCK32.dll_htons
mov word [ebp - 0xb2], ax
jmp 0x478dc9
mov ecx, str.https
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x478c78
test dl, dl
je 0x478c74
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x478c78
add eax, 2
add ecx, 2
test dl, dl
jne 0x478c58
xor eax, eax
jmp 0x478c7d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x478c97
push 0x1bb
call sub.WSOCK32.dll_htons
mov word [ebp - 0xb2], ax
jmp 0x478dc9
mov ecx, str.ssl_telnet
mov eax, esi
mov edi, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x478cc0
test dl, dl
je 0x478cbc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x478cc0
add eax, 2
add ecx, 2
test dl, dl
jne 0x478ca0
xor eax, eax
jmp 0x478cc5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x478cdf
push 0x97
call sub.WSOCK32.dll_htons
mov word [ebp - 0xb2], ax
jmp 0x478dc9
mov ecx, str.telnets
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x478d06
test dl, dl
je 0x478d02
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x478d06
add eax, 2
add ecx, 2
test dl, dl
jne 0x478ce6
xor eax, eax
jmp 0x478d0b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x478d25
push 0x3e0
call sub.WSOCK32.dll_htons
mov word [ebp - 0xb2], ax
jmp 0x478dc9
push esi
push str._s:_bad_port_number_n
jmp 0x478a03
mov eax, dword [ebp - 0xb2]
push eax
call sub.WSOCK32.dll_htons
mov word [ebp - 0xb2], ax
jmp 0x478dc9
cmp dword [0x4fac14], 0x3e6
push 0x4e3c20
jne 0x478d8f
push str.protelnet
call sub.WSOCK32.dll_getservbyname
test eax, eax
jne 0x478d82
mov ecx, 0x1b57
push ecx
mov word [ebp - 0xb2], cx
call sub.WSOCK32.dll_htons
mov word [ebp - 0xb2], ax
jmp 0x478dc3
mov dx, word [eax + 8]
mov word [ebp - 0xb2], dx
jmp 0x478dc3
push 0x4d1210
call sub.WSOCK32.dll_getservbyname
test eax, eax
jne 0x478db8
mov eax, 0x17
push eax
mov word [ebp - 0xb2], ax
call sub.WSOCK32.dll_htons
mov word [ebp - 0xb2], ax
jmp 0x478dc3
mov cx, word [eax + 8]
mov word [ebp - 0xb2], cx
mov dword [0x515060], edi
mov edx, dword [ebp - 0xb0]
mov ecx, 6
mov esi, str.Attempting_connection_to
lea edi, [ebp - 0x54]
rep movsd dword es:[edi], dword [esi]
push edx
movsw word es:[edi], word [esi]
call sub.WSOCK32.dll_inet_ntoa
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x478de8
lea edi, [ebp - 0x54]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x478df5
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp ebx, 0xffffffff
jne 0x478e81
lea eax, [ebp - 0x54]
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x478e16
mov cx, word [0x4dd70c]
mov dl, byte [0x4dd70e]
mov word [eax], cx
mov byte [eax + 2], dl
mov eax, dword [ebp - 0xb8]
mov ecx, eax
lea esp, [esp]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x478e40
lea edi, [ebp - 0x54]
sub eax, ecx
mov esi, ecx
dec edi
nop
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x478e50
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x54]
dec edi
lea ebx, [ebx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x478e70
mov ax, word [0x4dc510]
mov word [edi], ax
mov edx, dword [0x50ded8]
lea ecx, [ebp - 0x54]
push ecx
push edx
call fcn.0043dba0
mov eax, dword [0x50ded8]
push str...._n_n
push eax
call fcn.0043dba0
mov ecx, dword [0x50ded8]
push ecx
call fcn.00455d80
mov edx, dword [0x50f02c]
mov edi, dword [sym.imp.USER32.dll_UpdateWindow]
add esp, 0x14
push edx
call edi
mov eax, dword [0x50eae4]
test eax, eax
je 0x478ed8
lea ecx, [ebp - 0x54]
push ecx
push 0x80b2
push eax
call dword [sym.imp.USER32.dll_SetDlgItemTextW]
mov ebx, dword [ebp - 0xd0]
mov esi, 4
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov dword [0x517900], eax
test eax, eax
js 0x479102
push esi
lea edx, [ebp - 0xc4]
push edx
push 1
push 6
push eax
mov dword [ebp - 0xc4], 1
call sub.WSOCK32.dll_setsockopt
mov ecx, dword [0x517900]
push esi
lea eax, [ebp - 0xc4]
push eax
push 8
push 0xffff
push ecx
mov dword [ebp - 0xc4], 1
call sub.WSOCK32.dll_setsockopt
cmp dword [ebp - 0xbc], 0
je 0x478f7a
mov edx, dword [ebp - 0xbc]
mov eax, dword [0x517900]
push ebx
push edx
push 1
push 0
push eax
call sub.WSOCK32.dll_setsockopt
test eax, eax
jns 0x478f7a
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [0x50ded8]
push eax
push str.setsockopt__OP_OPTIONS__error__d_n
push ecx
call fcn.0043dba0
add esp, 0xc
cmp dword [0x50d154], 0
je 0x478fb8
mov edx, dword [0x517900]
push 1
push 1
push 0xffff
push edx
call fcn.0047a290
add esp, 0x10
test eax, eax
jns 0x478fb8
call sub.WSOCK32.dll_WSAGetLastError
push eax
mov eax, dword [0x50ded8]
push str.setsockopt__SO_DEBUG__error__d_n
push eax
call fcn.0043dba0
add esp, 0xc
mov edx, dword [0x517900]
push 0x10
lea ecx, [ebp - 0xb4]
push ecx
push edx
call sub.WSOCK32.dll_connect
test eax, eax
jns 0x47906c
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x478a12
mov eax, dword [ebp - 0xc0]
test eax, eax
je 0x479119
mov eax, dword [eax + 0xc]
cmp dword [eax + 4], 0
je 0x479119
mov ecx, dword [ebp - 0xb0]
push ecx
call sub.WSOCK32.dll_inet_ntoa
push eax
call sub.WSOCK32.dll_WSAGetLastError
mov edx, dword [0x50ded8]
push eax
push str.Error__d_connecting_to_address__s
push edx
call fcn.0043dba0
mov eax, dword [0x50ded8]
push eax
call fcn.00455d80
mov ecx, dword [0x50f02c]
add esp, 0x14
push ecx
call edi
mov ecx, dword [ebp - 0xc0]
add dword [ecx + 0xc], esi
movsx edx, word [ecx + 0xa]
mov eax, dword [ecx + 0xc]
mov eax, dword [eax]
push edx
push eax
lea ecx, [ebp - 0xb0]
push ecx
call sub.MSVCR100.dll_memcpy
mov edx, dword [0x517900]
push edx
call fcn.00479d70
add esp, 0x10
jmp 0x4790d3
push 0
call fcn.00479a70
add esp, 4
test eax, eax
je 0x479151
mov eax, dword [0x517900]
mov ecx, dword [0x524140]
push eax
push ecx
call fcn.004a6ba0
add esp, 8
cmp dword [0x50ccd0], 0
je 0x4790cd
mov edx, dword [0x524140]
push edx
call fcn.004a6c80
add esp, 4
test eax, eax
jle 0x47918f
mov eax, dword [0x524140]
push 1
push eax
call fcn.004794d0
add esp, 8
mov dword [0x50ccd4], 1
inc dword [0x514ebc]
cmp dword [0x514ebc], 0
je 0x478ee3
cmp dword [ebp - 0xc8], 0xffffffff
push 0x5120ec
push 0x4fabe8
jne 0x479221
mov eax, dword [ebp - 0xb8]
jmp 0x47922d
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [0x50ded8]
push eax
push str.socket_error__d_n
push ecx
jmp 0x478a0a
call sub.WSOCK32.dll_WSAGetLastError
mov edx, dword [0x50ded8]
push eax
push str.Unable_to_connect_to_remote_host__error_d__n
push edx
call fcn.0043dba0
mov eax, dword [0x50ded8]
push eax
call fcn.00455d80
add esp, 0x10
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b7f56
mov esp, ebp
pop ebp
ret
mov eax, dword [0x50ccc0]
mov dword [0x50ea4c], 3
test eax, eax
je 0x47916d
push eax
call fcn.00496800
add esp, 4
mov ecx, dword [0x50ded8]
push str._n_nSSL_initialization_failed__n
push ecx
call fcn.0043dba0
mov edx, dword [0x50ded8]
push edx
call fcn.00455d80
jmp 0x478a0f
mov eax, dword [0x50ccc0]
mov dword [0x50ea4c], esi
test eax, eax
je 0x4791a7
push eax
call fcn.00496800
add esp, 4
mov eax, dword [0x50ded8]
push str._n_nSSL_connection_error__n
push eax
call fcn.0043dba0
mov eax, dword [0x524140]
add esp, 8
cmp dword [eax + 0x50], 0
je 0x4791ef
mov ecx, dword [eax + 0x50]
cmp dword [ecx + 0x244], 0x30
jne 0x4791ef
mov edx, dword [0x50ded8]
push str.Certificate_is_not_valid._n
push edx
mov dword [0x50ea4c], 5
call fcn.0043dba0
add esp, 8
mov eax, dword [0x50ded8]
push eax
call fcn.00455d80
mov ecx, dword [0x524140]
push ecx
call fcn.004a79c0
mov edx, dword [0x524140]
push edx
call fcn.004a7840
mov dword [0x524140], 0
jmp 0x478a0f
mov ecx, dword [ebp - 0xb0]
push ecx
call sub.WSOCK32.dll_inet_ntoa
push eax
push str._s____s__s
push 0x50ecf8
call dword [sym.imp.MSVCR100.dll_sprintf]
mov edx, dword [ebp - 0xd4]
add esp, 0x14
push edx
mov dword [0x50ea4c], 0
call fcn.0047c400
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.004b7f56
mov esp, ebp
pop ebp
ret