Function at 0x40dd20
Capabilities:
Connect socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x229c
call fcn.004bf520
mov eax, dword [0x586f0c]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, edx
mov eax, dword [esi + 0xc]
push edi
mov edi, ecx
mov dword [ebp - 0x2290], edi
mov dword [ebp - 0x2294], 0x80
cmp eax, 0xffffffff
jne 0x40dd80
cmp dword [0x58a204], 0
je 0x40dd6b
push str.No_port_number_in_CONNECT_URI._n
call fcn.00401113
add esp, 4
pop edi
mov eax, 0x190
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bf32e
mov esp, ebp
pop ebp
ret
cmp dword [0x58a208], 1
jle 0x40dd9b
push eax
mov eax, dword [esi + 8]
push eax
push str.CONNECT_to__s:_hu._n
call fcn.00401113
add esp, 0xc
mov ecx, dword [0x58a210]
push ecx
movzx ecx, word [esi + 0xc]
lea edx, [ebp - 0x2294]
push edx
mov edx, dword [esi + 8]
lea eax, [ebp - 0x2084]
push eax
push ecx
push edx
call fcn.00401109
add esp, 0x14
test eax, eax
jne 0x40ddf3
cmp dword [0x58a208], eax
je 0x40ddde
mov eax, dword [esi + 8]
push eax
push str.Cant_resolve_name__s._n
call fcn.00401113
add esp, 8
pop edi
mov eax, 0x1f8
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bf32e
mov esp, ebp
pop ebp
ret
movzx ecx, word [ebp - 0x2084]
push ebx
push 6
push 1
push ecx
call fcn.00401217
mov edx, dword [ebp - 0x2294]
add esp, 0xc
mov ebx, eax
push edx
lea eax, [ebp - 0x2084]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40de66
cmp dword [0x58a208], 0
je 0x40de47
lea ecx, [ebp - 0x2084]
push ecx
call fcn.0040121c
push eax
push str.Cant_connect_to__s._n
call fcn.00401113
add esp, 0xc
push ebx
call fcn.004011d1
add esp, 4
pop ebx
pop edi
mov eax, 0x1f8
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bf32e
mov esp, ebp
pop ebp
ret
mov eax, 0xc8
call fcn.0040dab0
push edi
mov edx, eax
call fcn.0040d240
lea edx, [ebp - 0x229c]
push edx
push edi
call fcn.004011bd
mov ecx, dword [ebp - 0x229c]
add esp, 0xc
push 0
push ecx
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jns 0x40dee4
cmp dword [0x58a208], 0
je 0x40dec8
call fcn.004bdedf
mov edx, dword [eax]
push edx
call fcn.004bf45d
push eax
mov eax, dword [ebp - 0x229c]
push eax
push str.Error_sending__u_leftover_bytes:__s._n
call fcn.00401113
add esp, 0x10
push ebx
call fcn.004011d1
add esp, 4
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bf32e
mov esp, ebp
pop ebp
ret
mov edi, dword [edi]
mov dword [ebp - 0x2298], ebx
cmp edi, ebx
jl 0x40def6
mov dword [ebp - 0x2298], edi
mov dword [ebp - 0x2184], edi
mov dword [ebp - 0x2188], 1
xor eax, eax
jmp 0x40df10
cmp dword [ebp + eax*4 - 0x2184], ebx
je 0x40df1f
inc eax
cmp eax, 1
jb 0x40df10
cmp eax, 1
jne 0x40df34
mov dword [ebp - 0x2180], ebx
mov dword [ebp - 0x2188], 2
call fcn.004bdedf
mov dword [eax], 0
nop
call sub.WS2_32.dll_WSAGetLastError
test eax, eax
je 0x40df59
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
jne 0x40e098
mov edx, dword [ebp - 0x2298]
push 0
push 0
mov ecx, 0x41
lea esi, [ebp - 0x2188]
lea edi, [ebp - 0x228c]
rep movsd dword es:[edi], dword [esi]
push 0
lea ecx, [ebp - 0x228c]
push ecx
inc edx
push edx
call fcn.00416360
lea eax, [ebp - 0x2004]
push 0x2000
push eax
call fcn.004010f5
mov edi, dword [ebp - 0x2290]
mov edx, dword [edi]
add esp, 0x1c
lea ecx, [ebp - 0x228c]
push ecx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40e024
push 0x2000
lea eax, [ebp - 0x2004]
push eax
push edi
call fcn.004010c3
mov esi, eax
add esp, 0xc
cmp esi, 0xffffffff
jne 0x40dfe0
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x40dfb3
jmp 0x40e098
test esi, esi
jle 0x40e098
jmp 0x40dff0
push 0
push esi
lea ecx, [ebp - 0x2004]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x40e017
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x40dff0
jmp 0x40e098
push edi
call fcn.0040107d
add esp, 4
test eax, eax
jne 0x40dfb3
lea edx, [ebp - 0x228c]
push edx
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40df40
lea esp, [esp]
push 0
push 0x2000
lea eax, [ebp - 0x2004]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40e06a
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x40e040
jmp 0x40e098
test esi, esi
jle 0x40e098
mov edi, edi
push esi
lea ecx, [ebp - 0x2004]
push ecx
mov edx, edi
push edx
call fcn.004010ff
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40df40
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x40e070
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 4]
pop ebx
pop edi
xor ecx, ebp
xor eax, eax
pop esi
call fcn.004bf32e
mov esp, ebp
pop ebp
ret