Function at 0x1004f4c0
Capabilities:
Connect socket
Set socket configuration

Disassembly:
sub esp, 0x4c
mov eax, dword [0x10087040]
xor eax, esp
mov dword [esp + 0x48], eax
mov ecx, dword [esp + 0x58]
mov edx, 2
push ebx
mov ebx, dword [esp + 0x54]
push ebp
mov ebp, dword [esp + 0x5c]
push esi
mov esi, ecx
neg esi
mov eax, dword [ebp + 4]
sbb esi, esi
add esi, 2
mov dword [esp + 0xc], esi
push edi
lea edi, [edx + 0x15]
sub eax, 2
je 0x1004f566
sub eax, 0x15
je 0x1004f516
pop edi
pop esi
pop ebp
lea eax, [edx + 7]
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.10052757
add esp, 0x4c
ret
mov dword [esp + 0x18], 0x1c
xorps xmm0, xmm0
movlpd qword [esp + 0x24], xmm0
movlpd qword [esp + 0x2c], xmm0
mov dword [esp + 0x34], 0
mov word [esp + 0x20], di
test ecx, ecx
je 0x1004f544
movzx eax, word [ebp + 0x1a]
jmp 0x1004f548
movzx eax, word [ebp + 0x18]
push eax
call dword [sym.imp.WS2_32.dll_htons]
movups xmm0, xmmword [ebp + 8]
mov word [esp + 0x22], ax
mov eax, dword [ebp + 0x5c]
movups xmmword [esp + 0x28], xmm0
mov dword [esp + 0x38], eax
jmp 0x1004f59d
mov dword [esp + 0x18], 0x10
xorps xmm0, xmm0
movlpd qword [esp + 0x28], xmm0
mov word [esp + 0x20], dx
test ecx, ecx
je 0x1004f586
movzx eax, word [ebp + 0x1a]
jmp 0x1004f58a
movzx eax, word [ebp + 0x18]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x22], ax
mov eax, dword [ebp + 8]
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 0xb4]
mov ecx, dword [ebp + 4]
test eax, eax
je 0x1004f5c1
mov eax, dword [eax]
test eax, eax
je 0x1004f5c1
push dword [ebx + 0xb8]
push 0
push esi
push ecx
call eax
add esp, 0x10
jmp 0x1004f5cb
push 0
push esi
push ecx
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x1004f7c8
mov edi, dword [ebp + 0x74]
mov eax, dword [edi + 0xb4]
test eax, eax
je 0x1004f5ec
cmp dword [eax], 0
jne 0x1004f6d6
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 1
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [edi + 0x1c], 0
lea eax, [edi + 0x1c]
jle 0x1004f62b
push 4
push eax
push 0x1001
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x1004f7ab
cmp dword [edi + 0x20], 0
lea eax, [edi + 0x20]
jle 0x1004f651
push 4
push eax
push 0x1002
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x1004f7ab
mov eax, dword [ebp + 4]
cmp eax, 2
jne 0x1004f683
cmp dword [edi + 0x68], 0
je 0x1004f6b6
xorps xmm0, xmm0
movups xmmword [esp + 0x3c], xmm0
mov word [esp + 0x3c], ax
push dword [edi + 0x68]
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x40], eax
mov eax, 0x10
jmp 0x1004f796
cmp eax, 0x17
jne 0x1004f6b6
cmp dword [ebp + 0x5c], 0
jne 0x1004f6b6
lea eax, [edi + 0x6c]
mov edx, 0x10058d08
mov dword [esp + 0x14], eax
mov ecx, eax
mov edi, 0xc
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x1004f765
add ecx, 4
add edx, 4
sub edi, 4
jae 0x1004f6a1
cmp dword [ebp + 4], 0x17
jne 0x1004f6d6
push 4
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0
push eax
push 0x1b
push 0x29
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp dword [esp + 0x68], 0
je 0x1004f70f
mov eax, dword [ebx + 0xb4]
mov dword [esp + 0x1c], 1
test eax, eax
je 0x1004f6f4
cmp dword [eax], 0
jne 0x1004f70f
push 4
lea eax, [esp + 0x20]
push eax
push 1
push 6
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x1004f82d
mov eax, dword [ebx + 0xac]
mov edi, dword [esp + 0x10]
test eax, eax
je 0x1004f732
push dword [ebx + 0xb0]
push edi
push esi
call eax
add esp, 0xc
test eax, eax
js 0x1004f82d
mov eax, dword [ebx + 0xb4]
test eax, eax
je 0x1004f7e9
mov eax, dword [eax + 8]
test eax, eax
je 0x1004f7e9
push dword [ebx + 0xb8]
lea ecx, [esp + 0x24]
push dword [esp + 0x1c]
push ecx
push esi
call eax
add esp, 0x10
jmp 0x1004f7f9
xorps xmm0, xmm0
mov dword [esp + 0x54], 0
movups xmmword [esp + 0x3c], xmm0
mov eax, 0x17
movq qword [esp + 0x4c], xmm0
mov word [esp + 0x3c], ax
mov eax, dword [esp + 0x14]
movups xmm0, xmmword [eax]
mov eax, 0x1c
movups xmmword [esp + 0x44], xmm0
push eax
lea eax, [esp + 0x40]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jns 0x1004f6b6
mov eax, dword [ebx + 0xb4]
test eax, eax
je 0x1004f7e0
mov eax, dword [eax + 4]
test eax, eax
je 0x1004f7e0
push dword [ebx + 0xb8]
push esi
call eax
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0xb
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.10052757
add esp, 0x4c
ret
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x1004f7c8
push dword [esp + 0x18]
lea eax, [esp + 0x24]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x1004f812
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
je 0x1004f812
cmp eax, 0x2733
jne 0x1004f82d
mov eax, dword [ebx + 0xa4]
test eax, eax
je 0x1004f836
push dword [ebx + 0xa8]
push edi
push esi
call eax
add esp, 0xc
test eax, eax
jns 0x1004f836
push esi
push ebx
call fcn.1004f440
jmp 0x1004f7c5
push 0x14
call dword [section..data]
mov edi, eax
add esp, 4
test edi, edi
jne 0x1004f867
push esi
push ebx
call fcn.1004f440
add esp, 8
lea eax, [edi + 0xf]
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.10052757
add esp, 0x4c
ret
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [edi + 0x10], 0
push 0
mov dword [edi + 4], esi
mov dword [edi], ebp
call fcn.10043960
mov ecx, dword [esp + 0x6c]
add esp, 4
mov dword [edi + 0x10], eax
mov dword [edi + 8], ecx
test eax, eax
jne 0x1004f8c2
push esi
push ebx
call fcn.1004f440
push edi
call dword [0x10087008]
add esp, 0xc
mov eax, 0xf
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.10052757
add esp, 0x4c
ret
mov eax, dword [ebp + 0x64]
push edi
push eax
test ecx, ecx
je 0x1004f8d2
call fcn.10043a90
jmp 0x1004f8d7
call fcn.10043a30
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x1004f913
push esi
push ebx
call fcn.1004f440
push dword [edi + 0x10]
call fcn.10043980
push edi
call dword [0x10087008]
add esp, 0x10
mov eax, 0xf
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.10052757
add esp, 0x4c
ret
push eax
push esi
push dword [ebx + 0x98]
call fcn.10044410
add esp, 0xc
test eax, eax
jne 0x1004f961
push esi
push ebx
call fcn.1004f440
push dword [edi + 0x10]
call fcn.10043980
push dword [esp + 0x1c]
call fcn.10043b20
push edi
call dword [0x10087008]
add esp, 0x14
mov eax, 0xf
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.10052757
add esp, 0x4c
ret
mov eax, dword [ebx + 0x9c]
test eax, eax
je 0x1004f97b
push 0
push 1
push esi
push dword [ebx + 0xa0]
call eax
add esp, 0x10
cmp dword [esp + 0x68], 0
je 0x1004f985
mov dword [ebp + 0x68], edi
mov ecx, dword [esp + 0x58]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.10052757
add esp, 0x4c
ret