Function at 0x10002520
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x144
push ebx
push esi
push edi
push 1
xor ebx, ebx
push ebx
push ebx
push 6
push 1
push 2
mov esi, eax
mov edi, ecx
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov dword [edi], eax
cmp eax, 0xffffffff
je 0x100025a3
mov ecx, dword [0x1000502c]
push ebx
push ebx
push ecx
push eax
call dword [sym.imp.KERNEL32.DLL_CreateIoCompletionPort]
test eax, eax
jne 0x10002574
call fcn.10002c10
call dword [sym.imp.KERNEL32.DLL_GetLastError]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20
mov edx, 2
push 0x10
lea ecx, [esp + 0x18]
mov word [esp + 0x18], dx
mov edx, dword [edi]
push ecx
xor eax, eax
push edx
mov dword [esp + 0x24], ebx
mov word [esp + 0x22], ax
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x100025b2
call fcn.10002c10
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20
mov eax, dword [ebp + 0x10]
mov dword [edi + 4], eax
cmp dword [ebp + 0x14], ebx
jne 0x100026c2
mov edx, dword [ebp + 8]
mov ecx, 2
push edx
mov word [esp + 0x18], cx
call dword [sym.imp.WS2_32.dll_gethostbyname]
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
push ecx
push eax
lea ecx, [esp + 0x20]
push ecx
call sub.MSVCRT.dll_memcpy
mov edx, dword [esp + 0x24]
add esp, 0xc
push edx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [edi]
lea ecx, [esp + 0x10]
push ecx
push 0x8004667e
push edx
mov word [esp + 0x22], ax
mov dword [esp + 0x1c], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, dword [edi]
push 0x10
lea eax, [esp + 0x18]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_connect]
mov eax, dword [edi]
lea edx, [esp + 0x28]
push edx
push ebx
lea ecx, [esp + 0x50]
push ecx
push ebx
push eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x5c], 1
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], ebx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x100028fe
mov esi, dword [edi]
cmp esi, 0xffffffff
je 0x100026ae
push 4
lea ecx, [esp + 0x10]
push ecx
push 0x80
push 0xffff
mov edx, 1
xor eax, eax
push esi
mov word [esp + 0x20], dx
mov word [esp + 0x22], ax
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, 1
mov dword [edi], 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20
mov ecx, dword [ebp + 0x18]
mov eax, 2
push ecx
mov word [esp + 0x18], ax
call dword [sym.imp.WS2_32.dll_gethostbyname]
movsx edx, word [eax + 0xa]
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
push edx
push ecx
lea edx, [esp + 0x20]
push edx
call sub.MSVCRT.dll_memcpy
mov eax, dword [esp + 0x24]
add esp, 0xc
push eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ecx, dword [ebp + 0x1c]
push ecx
mov dword [esp + 0x1c], eax
call dword [sym.imp.WS2_32.dll_htons]
lea edx, [esp + 0x30]
push edx
mov word [esp + 0x1a], ax
mov eax, dword [edi]
push 0x8004667e
push eax
mov dword [esp + 0x3c], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov edx, dword [edi]
push 0x10
lea ecx, [esp + 0x18]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_connect]
mov eax, dword [edi]
lea ecx, [esp + 0x34]
push ecx
push ebx
lea edx, [esp + 0x50]
push edx
push ebx
push eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x5c], 1
mov dword [esp + 0x48], esi
mov dword [esp + 0x4c], ebx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x100027bf
mov esi, dword [edi]
cmp esi, 0xffffffff
je 0x100027ab
push 4
lea edx, [esp + 0x10]
push edx
push 0x80
push 0xffff
mov eax, 1
xor ecx, ecx
push esi
mov word [esp + 0x20], ax
mov word [esp + 0x22], cx
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi], 0xffffffff
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20
mov ecx, dword [edi]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea eax, [esp + 0x28]
push eax
push 0x1005
push 0xffff
push ecx
mov dword [esp + 0x38], 0x7530
call esi
mov eax, dword [edi]
push 4
lea edx, [esp + 0x28]
push edx
push 0x1006
push 0xffff
push eax
call esi
push ebx
push ebx
lea ecx, [esp + 0x30]
push ecx
push ebx
push ebx
push 0xc
mov eax, 0x1388
lea edx, [esp + 0x54]
push edx
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
mov eax, dword [edi]
push 0x98000004
push eax
mov dword [esp + 0x60], 1
mov dword [esp + 0x4c], ebx
call dword [sym.imp.WS2_32.dll_WSAIoctl]
mov eax, dword [ebp + 0x14]
sub eax, 1
je 0x10002880
sub eax, 1
je 0x1000286a
sub eax, 1
je 0x10002853
call fcn.10002c10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20
mov ecx, dword [ebp + 0x24]
mov edx, dword [ebp + 0x20]
mov eax, dword [ebp + 8]
push ecx
mov ecx, dword [ebp + 0xc]
push edx
push eax
push edi
call fcn.10003000
jmp 0x100028a3
mov ecx, dword [ebp + 0x24]
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
mov eax, dword [ebp + 0x20]
call fcn.10002e50
jmp 0x100028a3
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, ebx
jne 0x10002898
mov dword [esp + 0xc], 0xffffffff
jmp 0x100028ab
mov esi, dword [ebp + 0x20]
mov ecx, dword [ebp + 0xc]
call fcn.10002da0
mov dword [esp + 0xc], eax
cmp eax, ebx
je 0x100028fe
mov esi, dword [edi]
cmp esi, 0xffffffff
je 0x100028eb
push 4
lea ecx, [esp + 0x14]
push ecx
push 0x80
push 0xffff
mov edx, 1
xor eax, eax
push esi
mov word [esp + 0x24], dx
mov word [esp + 0x26], ax
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0xc]
mov dword [edi], 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20
push 0x30
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
push 0x30
mov esi, eax
push ebx
push esi
call sub.MSVCRT.dll_memset
mov edx, dword [0x1000502c]
add esp, 0x10
push esi
mov dword [esi + 0x14], edi
push ebx
mov dword [esi + 0x18], 1
push ebx
mov dword [esi + 0x2c], ebx
mov dword [esi + 0x1c], ebx
push edx
mov dword [esi + 0x28], ebx
call dword [sym.imp.KERNEL32.DLL_PostQueuedCompletionStatus]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x20