Function at 0x4caa30
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0xd0
mov edi, dword [ebp + 0x14]
mov eax, dword [ebp + 8]
cmp edi, 1
mov esi, 0
adc esi, 1
mov dword [eax], 0
mov eax, dword [0xad5c20]
push 0x28
call dword [eax]
add esp, 4
test eax, eax
je 0x4cab04
mov dword [esp + 0x18], esi
mov ecx, dword [ebp + 0x10]
mov esi, eax
xor ebx, ebx
test edi, edi
setne bl
pxor xmm0, xmm0
movdqu xmmword [eax + 0x18], xmm0
movdqu xmmword [eax + 8], xmm0
mov dword [eax + 4], 0xffffffff
mov dword [eax], ecx
push 0
call fcn.004be730
add esp, 4
mov dword [esi + 0x24], eax
mov dword [esp + 0x1c], ebx
mov dword [esi + 0x1c], ebx
test eax, eax
je 0x4cab0e
xor eax, eax
test edi, edi
setne al
mov edi, dword [esi]
movzx eax, word [edi + eax*2 + 0x18]
mov ecx, dword [edi + 4]
cmp ecx, 0x17
je 0x4cab18
mov ebx, 9
cmp ecx, 2
jne 0x4cae2e
mov dword [esp + 0x54], 0
mov dword [esp + 0x50], 0
mov word [esp + 0x48], 2
movzx eax, ax
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x4a], ax
mov eax, dword [edi + 8]
mov dword [esp + 0x4c], eax
mov dword [esp + 0x14], 0x10
jmp 0x4cab58
mov ebx, 0xf
jmp 0x4cae80
mov ebx, 0xf
jmp 0x4cae2e
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
mov word [esp + 0x48], 0x17
movzx eax, ax
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x4a], ax
movdqu xmm0, xmmword [edi + 8]
movdqu xmmword [esp + 0x50], xmm0
mov eax, dword [edi + 0x5c]
mov dword [esp + 0x60], eax
mov dword [esp + 0x14], 0x1c
mov eax, dword [ebp + 0x10]
mov eax, dword [eax + 4]
mov edx, dword [ebp + 0xc]
mov ecx, dword [edx + 0xb4]
test ecx, ecx
mov edi, dword [esp + 0x18]
je 0x4cab96
mov ecx, dword [ecx]
test ecx, ecx
je 0x4cab96
push dword [edx + 0xb8]
push 0
push edi
push eax
call ecx
add esp, 0x10
mov dword [esi + 4], eax
mov ebx, 0xb
cmp eax, 0xffffffff
jne 0x4cabb1
jmp 0x4cae2e
push 0
push edi
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 4], eax
mov ebx, 0xb
cmp eax, 0xffffffff
je 0x4cae2e
mov ecx, dword [esi]
mov dword [esp + 0xc], ecx
mov ebx, dword [ecx + 0x208]
mov ecx, dword [ebx + 0xb4]
test ecx, ecx
je 0x4cabd0
cmp dword [ecx], 0
jne 0x4cad2e
mov dword [esp + 0x10], 1
lea ecx, [esp + 0x10]
push ecx
push 0x8004667e
push eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [ebx + 0x1c], 0
jle 0x4cac10
lea eax, [ebx + 0x1c]
push 4
push eax
push 0x1001
push 0xffff
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jne 0x4cae29
cmp dword [ebx + 0x20], 0
jle 0x4cac37
lea eax, [ebx + 0x20]
push 4
push eax
push 0x1002
push 0xffff
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jne 0x4cae29
mov ecx, dword [esp + 0xc]
mov eax, dword [ecx + 4]
cmp eax, 0x17
je 0x4cac7a
cmp eax, 2
jne 0x4cad04
mov eax, dword [ebx + 0x68]
test eax, eax
je 0x4cad04
pxor xmm0, xmm0
movdqa xmmword [esp + 0x20], xmm0
mov word [esp + 0x20], 2
push eax
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x24], eax
mov eax, 0x10
jmp 0x4cacc6
cmp dword [ecx + 0x5c], 0
jne 0x4cace7
movdqu xmm0, xmmword [ebx + 0x6c]
mov eax, dword [0xad5c1c]
movdqu xmm1, xmmword [eax]
pcmpeqb xmm1, xmm0
pmovmskb eax, xmm1
cmp eax, 0xffff
je 0x4cace7
add ebx, 0x6c
pxor xmm0, xmm0
movdqa xmmword [esp + 0x20], xmm0
movdqu xmmword [esp + 0x2c], xmm0
mov word [esp + 0x20], 0x17
movdqu xmm0, xmmword [ebx]
movdqu xmmword [esp + 0x28], xmm0
mov eax, 0x1c
lea ecx, [esp + 0x20]
push eax
push ecx
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x4cae29
mov eax, dword [esp + 0xc]
cmp dword [eax + 4], 0x17
jne 0x4cad04
mov eax, dword [esi + 4]
mov dword [esp + 0x10], 0
push 4
lea ecx, [esp + 0x14]
push ecx
push 0x1b
push 0x29
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
test byte [esi + 0x1c], 1
je 0x4cad2e
mov dword [esp + 0x10], 1
push 4
lea eax, [esp + 0x14]
push eax
push 1
push 6
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jne 0x4cae29
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebx + 0xac]
test eax, eax
je 0x4cad52
push dword [ebx + 0xb0]
push edi
push dword [esi + 4]
call eax
add esp, 0xc
test eax, eax
js 0x4cae29
test byte [esi + 0x1c], 2
jne 0x4cae29
mov eax, dword [esi]
mov ecx, dword [esi + 4]
mov dword [esp + 0xc], ecx
mov edi, dword [eax + 0x208]
nop dword [eax + eax]
mov eax, dword [edi + 0xb4]
test eax, eax
je 0x4cada0
mov eax, dword [eax + 8]
test eax, eax
je 0x4cada0
push dword [edi + 0xb8]
push dword [esp + 0x18]
lea ecx, [esp + 0x50]
push ecx
push dword [esp + 0x18]
call eax
add esp, 0x10
jmp 0x4cadb3
push dword [esp + 0x14]
lea eax, [esp + 0x4c]
push eax
push dword [esp + 0x14]
call dword [sym.imp.WS2_32.dll_connect]
mov ebx, eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp ebx, 0xffffffff
sete cl
lea edx, [eax - 0x2735]
cmp edx, 0xfffffffe
setb dl
test cl, dl
jne 0x4cae8a
cmp ebx, 0xffffffff
jne 0x4cade1
cmp eax, 0x2714
je 0x4cad70
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebx + 0xa4]
test eax, eax
mov edi, 0
je 0x4cae0d
push dword [ebx + 0xa8]
push dword [esp + 0x1c]
push dword [esi + 4]
call eax
add esp, 0xc
test eax, eax
js 0x4caea8
mov eax, dword [esi + 0x1c]
test al, 2
je 0x4cae1a
or eax, 4
mov dword [esi + 0x1c], eax
mov ecx, esi
call fcn.004caf70
test eax, eax
je 0x4cae93
mov ebx, eax
jmp 0x4cae30
mov ebx, 0xb
xor edi, edi
push edi
call fcn.004bea60
add esp, 4
push dword [esi + 0x24]
call fcn.004bebf0
add esp, 4
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
je 0x4cae75
mov edx, dword [ebp + 0xc]
mov ecx, dword [edx + 0xb4]
test ecx, ecx
je 0x4cae6e
mov ecx, dword [ecx + 4]
test ecx, ecx
je 0x4cae6e
push dword [edx + 0xb8]
push eax
call ecx
add esp, 8
jmp 0x4cae75
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [0xad5c18]
push esi
call dword [eax]
add esp, 4
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
xor edi, edi
mov ebx, 0xb
jmp 0x4cae30
mov eax, dword [ebp + 0x10]
mov eax, dword [eax + 0x64]
cmp dword [ebp + 0x14], 0
je 0x4caeaf
push esi
push eax
call fcn.004be7c0
jmp 0x4caeb6
mov ebx, 0xb
jmp 0x4cae30
push esi
push eax
call fcn.004be760
add esp, 8
test eax, eax
mov ecx, dword [ebp + 0xc]
je 0x4caf1a
push eax
push dword [esi + 4]
push dword [ecx + 0x98]
mov edi, eax
call fcn.004be180
add esp, 0xc
mov ebx, 0xf
test eax, eax
je 0x4cae30
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 0x9c]
test eax, eax
je 0x4caf02
push dword [esp + 0x1c]
push 1
push dword [esi + 4]
push dword [ecx + 0xa0]
call eax
add esp, 0x10
cmp dword [ebp + 0x14], 0
je 0x4caf0e
mov eax, dword [ebp + 0x10]
mov dword [eax + 0x68], esi
mov eax, dword [ebp + 8]
mov dword [eax], esi
xor ebx, ebx
jmp 0x4cae80
mov ebx, 0xf
jmp 0x4cae30