Function at 0x10039680
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101462ab
mov eax, dword fs:[0]
push eax
sub esp, 0x248
mov eax, dword [0x1018d0d0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x250], eax
mov eax, dword [ebp + 0x10]
push 0x18
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x230], 0
mov dword [ebp - 0x22c], 0
call fcn.1011a4b2
add esp, 4
test eax, eax
jne 0x100396ea
call fcn.10115fd1
lea ecx, [eax + 4]
mov dword [eax], eax
test ecx, ecx
je 0x100396f5
mov dword [ecx], eax
lea ecx, [eax + 8]
test ecx, ecx
je 0x100396fe
mov dword [ecx], eax
mov word [eax + 0xc], 0x101
mov dword [ebp - 0x230], eax
lea eax, [ebp - 0x24c]
mov dword [ebp - 4], 0
push eax
call fcn.100062d0
mov eax, dword [ebx + 4]
add esp, 4
mov dword [ebp - 0x124], 0
mov dword [ebp - 0x228], 0
test eax, eax
jne 0x10039748
mov eax, dword [ebp - 0x230]
xor bl, bl
jmp 0x10039b5a
cmp eax, 0x40
jb 0x10039768
lea ecx, [ecx]
mov eax, dword [ebx]
mov ecx, ebx
push dword [eax]
lea eax, [ebp - 0x234]
push eax
call fcn.100352e0
cmp dword [ebx + 4], 0x40
jae 0x10039750
mov eax, dword [ebx]
mov esi, dword [eax]
cmp esi, eax
je 0x1003986f
push 0
push 1
push 2
call sub.WS2_32.dll_socket
mov ecx, dword [esi + 0x10]
mov edi, eax
xor eax, eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov eax, 2
push 0x50
mov dword [ebp - 0x1c], ecx
mov word [ebp - 0x20], ax
call sub.WS2_32.dll_htons
mov word [ebp - 0x1e], ax
lea eax, [ebp - 0x244]
push eax
push 0x8004667e
push edi
mov dword [ebp - 0x244], 1
call sub.WS2_32.dll_ioctlsocket
test eax, eax
jne 0x10039826
lea eax, [ebp - 0x234]
mov dword [ebp - 0x234], edi
push eax
lea ecx, [ebp - 0x230]
call fcn.10037ba0
mov ecx, dword [esi + 0x10]
push 0x10
mov dword [eax], ecx
lea eax, [ebp - 0x20]
push eax
push edi
call sub.WS2_32.dll_connect
test eax, eax
je 0x10039826
mov eax, dword [ebp - 0x124]
cmp eax, 0x40
jae 0x1003980e
mov dword [ebp + eax*4 - 0x120], edi
inc dword [ebp - 0x124]
mov eax, dword [ebp - 0x228]
cmp eax, 0x40
jae 0x10039826
mov dword [ebp + eax*4 - 0x224], edi
inc dword [ebp - 0x228]
cmp byte [esi + 0xd], 0
jne 0x10039867
mov eax, dword [esi + 8]
cmp byte [eax + 0xd], 0
jne 0x1003984c
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
jne 0x10039867
nop
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
je 0x10039840
jmp 0x10039867
mov eax, dword [esi + 4]
cmp byte [eax + 0xd], 0
jne 0x10039865
cmp esi, dword [eax + 8]
jne 0x10039865
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0xd], 0
je 0x10039855
mov esi, eax
cmp esi, dword [ebx]
jne 0x10039774
lea eax, [ebp - 0x240]
mov dword [ebp - 0x240], 3
push eax
lea eax, [ebp - 0x228]
mov dword [ebp - 0x23c], 0
push eax
lea eax, [ebp - 0x124]
push eax
push 0
push 0
call sub.WS2_32.dll_select
test eax, eax
je 0x10039aaa
lea esp, [esp]
cmp eax, 0xffffffff
je 0x10039aaa
mov eax, dword [ebp - 0x230]
mov esi, dword [eax]
cmp esi, eax
je 0x10039941
mov edi, dword [esi + 0x10]
lea eax, [ebp - 0x124]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x10039aed
mov eax, dword [ebp - 0x124]
cmp eax, 0x40
jae 0x100398f5
mov dword [ebp + eax*4 - 0x120], edi
inc dword [ebp - 0x124]
cmp byte [esi + 0xd], 0
jne 0x10039937
mov eax, dword [esi + 8]
cmp byte [eax + 0xd], 0
jne 0x1003991c
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
jne 0x10039937
mov edi, edi
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
je 0x10039910
jmp 0x10039937
mov eax, dword [esi + 4]
cmp byte [eax + 0xd], 0
jne 0x10039935
cmp esi, dword [eax + 8]
jne 0x10039935
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0xd], 0
je 0x10039925
mov esi, eax
mov eax, dword [ebp - 0x230]
cmp esi, eax
jne 0x100398c5
mov esi, dword [eax]
cmp esi, eax
je 0x10039a84
jmp 0x10039950
mov edi, dword [esi + 0x10]
lea eax, [ebp - 0x228]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x10039a20
mov edx, dword [ebp - 0x228]
xor ecx, ecx
test edx, edx
je 0x100399b3
cmp dword [ebp + ecx*4 - 0x224], edi
je 0x10039984
inc ecx
cmp ecx, edx
jb 0x10039974
jmp 0x100399b3
lea eax, [edx - 1]
cmp ecx, eax
jae 0x100399ac
jmp 0x10039990
mov eax, dword [ebp + ecx*4 - 0x220]
mov dword [ebp + ecx*4 - 0x224], eax
inc ecx
mov edx, dword [ebp - 0x228]
lea eax, [edx - 1]
cmp ecx, eax
jb 0x10039990
dec edx
mov dword [ebp - 0x228], edx
mov edx, dword [ebp - 0x124]
xor eax, eax
test edx, edx
je 0x10039a03
nop
cmp dword [ebp + eax*4 - 0x120], edi
je 0x100399d0
inc eax
cmp eax, edx
jb 0x100399c0
jmp 0x10039a03
lea ecx, [edx - 1]
cmp eax, ecx
jae 0x100399fc
jmp 0x100399e0
mov ecx, dword [ebp + eax*4 - 0x11c]
mov dword [ebp + eax*4 - 0x120], ecx
inc eax
mov edx, dword [ebp - 0x124]
lea ecx, [edx - 1]
cmp eax, ecx
jb 0x100399e0
dec edx
mov dword [ebp - 0x124], edx
push edi
call sub.WS2_32.dll_closesocket
push esi
lea eax, [ebp - 0x234]
push eax
lea ecx, [ebp - 0x230]
call fcn.100352e0
mov esi, dword [eax]
jmp 0x10039a78
mov eax, dword [ebp - 0x228]
cmp eax, 0x40
jae 0x10039a38
mov dword [ebp + eax*4 - 0x224], edi
inc dword [ebp - 0x228]
cmp byte [esi + 0xd], 0
jne 0x10039a78
mov eax, dword [esi + 8]
cmp byte [eax + 0xd], 0
jne 0x10039a5d
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
jne 0x10039a78
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
je 0x10039a51
jmp 0x10039a78
mov eax, dword [esi + 4]
cmp byte [eax + 0xd], 0
jne 0x10039a76
cmp esi, dword [eax + 8]
jne 0x10039a76
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0xd], 0
je 0x10039a66
mov esi, eax
cmp esi, dword [ebp - 0x230]
jne 0x10039950
lea eax, [ebp - 0x240]
push eax
lea eax, [ebp - 0x228]
push eax
lea eax, [ebp - 0x124]
push eax
push 0
push 0
call sub.WS2_32.dll_select
test eax, eax
jne 0x100398b0
xor ebx, ebx
mov eax, dword [ebp - 0x230]
mov esi, dword [eax]
cmp esi, eax
je 0x10039b55
lea esp, [esp]
push dword [esi + 0x10]
call sub.WS2_32.dll_closesocket
cmp byte [esi + 0xd], 0
jne 0x10039b47
mov eax, dword [esi + 8]
cmp byte [eax + 0xd], 0
jne 0x10039b2c
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
jne 0x10039b47
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
je 0x10039ae1
jmp 0x10039b47
mov ecx, dword [ebp - 0x250]
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 0x10]
mov esi, dword [ebp - 0x24c]
mov edi, dword [ebp - 0x248]
mov dword [ecx], eax
lea eax, [ebp - 0x254]
push eax
call fcn.100062d0
mov edx, dword [ebp - 0x238]
add esp, 4
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub ecx, esi
mov dword [edx], ecx
sbb eax, edi
mov dword [edx + 4], eax
jmp 0x10039aac
mov eax, dword [esi + 4]
cmp byte [eax + 0xd], 0
jne 0x10039b45
cmp esi, dword [eax + 8]
jne 0x10039b45
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0xd], 0
je 0x10039b35
mov esi, eax
mov eax, dword [ebp - 0x230]
cmp esi, eax
jne 0x10039ac0
test ebx, ebx
setne bl
push eax
push dword [eax]
lea eax, [ebp - 0x238]
push eax
lea ecx, [ebp - 0x230]
call fcn.10037c50
push dword [ebp - 0x230]
call fcn.1011a1ea
add esp, 4
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1011a3e5
mov esp, ebp
pop ebp
ret 0xc