Function at 0x46f228
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Initialize winsock library
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffd80
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x280], ebx
mov dword [ebp - 0x26c], ebx
mov dword [ebp - 0x260], ebx
mov dword [ebp - 0x25c], ebx
mov dword [ebp - 0x258], ebx
mov dword [ebp - 0x254], ebx
mov dword [ebp - 0x238], ebx
mov dword [ebp - 0x134], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x1c], ecx
mov byte [ebp - 0x15], dl
mov ebx, eax
mov eax, dword [ebp - 0x1c]
call fcn.00404bc0
mov eax, dword [ebp + 0x14]
call fcn.00404bc0
xor eax, eax
push ebp
push 0x46f9f8
push dword fs:[eax]
mov dword fs:[eax], esp
cmp byte [ebx + 0x10], 0
jne 0x46f98c
cmp byte [ebp - 0x15], 4
jne 0x46f2ac
mov esi, 0xfffffffe
jmp 0x46f991
cmp byte [ebp - 0x15], 1
je 0x46f2b8
cmp byte [ebp + 8], 0
je 0x46f2dd
cmp word [0x481c10], 0
jne 0x46f2dd
push 0x481c10
push 0x101
call sub.wsock32.dll_WSAStartup
test eax, eax
je 0x46f2dd
or esi, 0xffffffff
jmp 0x46f991
or esi, 0xffffffff
lea eax, [ebp - 0x28]
mov edx, dword [ebp - 0x1c]
call fcn.004047a8
lea eax, [ebp - 0x2c]
mov edx, dword [ebp + 0x14]
call fcn.004047a8
mov dword [ebp - 0x20], 0xffffffff
cmp byte [ebp - 0x15], 3
jne 0x46f347
cmp dword [ebp - 0x1c], 0
je 0x46f318
mov eax, dword [ebp - 0x1c]
mov edx, 0x46fa14
call fcn.00404b1c
je 0x46f325
lea eax, [ebp - 0x1c]
mov edx, 0x46fa14
call fcn.004047a8
cmp dword [ebp + 0x14], 0
je 0x46f33a
mov eax, dword [ebp + 0x14]
mov edx, 0x46fa20
call fcn.00404b1c
je 0x46f347
lea eax, [ebp + 0x14]
mov edx, 0x46fa20
call fcn.004047a8
cmp byte [ebp - 0x15], 3
jne 0x46f6df
cmp dword [ebp - 0x1c], 0
je 0x46f366
mov eax, dword [ebp - 0x1c]
mov edx, 0x46fa14
call fcn.00404b1c
je 0x46f383
cmp dword [ebp + 0x14], 0
je 0x46f6df
mov eax, dword [ebp + 0x14]
mov edx, 0x46fa20
call fcn.00404b1c
jne 0x46f6df
push 0x46fa30
push dword [ebp - 0x1c]
push 0x46fa3c
push dword [ebp + 0x14]
lea eax, [ebp - 0x134]
mov edx, 4
call fcn.00404a90
mov edx, dword [ebp - 0x134]
lea eax, [ebp - 0x130]
mov ecx, 0xff
call fcn.004049ac
mov edi, 0x65
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x130]
inc eax
push eax
call sub.kernel32.dll_CreateFileA_2
mov esi, eax
cmp esi, 0xffffffff
jne 0x46f555
call sub.kernel32.dll_GetLastError_2
cmp eax, 0xe7
je 0x46f495
mov eax, 0x7e1
mov dword [ebx + 0xdc], eax
lea eax, [ebp - 0x238]
push eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x250], eax
mov byte [ebp - 0x24c], 0xb
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x248], eax
mov byte [ebp - 0x244], 0xb
call sub.kernel32.dll_GetLastError_2
mov dword [ebp - 0x240], eax
mov byte [ebp - 0x23c], 0
lea edx, [ebp - 0x250]
mov eax, dword [0x480ae8]
mov ecx, dword [ebx + 0xdc]
mov eax, dword [eax + ecx*4 - 0x1f40]
mov ecx, 2
call fcn.004093e4
mov edx, dword [ebp - 0x238]
lea eax, [ebp - 0x234]
mov ecx, 0xff
call fcn.004049ac
lea edx, [ebp - 0x234]
lea eax, [ebx + 0x11]
mov cl, 0xc8
call fcn.00402fd8
cmp byte [ebp + 8], 0
jne 0x46f555
mov esi, 0xfffffff7
jmp 0x46f991
imul eax, dword [ebp + 0xc], 0x3e8
push eax
lea eax, [ebp - 0x130]
inc eax
push eax
call sub.kernel32.dll_WaitNamedPipeA
test eax, eax
jne 0x46f54e
mov eax, 0x7e0
mov dword [ebx + 0xdc], eax
lea eax, [ebp - 0x254]
push eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x250], eax
mov byte [ebp - 0x24c], 0xb
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x248], eax
mov byte [ebp - 0x244], 0xb
call sub.kernel32.dll_GetLastError_2
mov dword [ebp - 0x240], eax
mov byte [ebp - 0x23c], 0
lea edx, [ebp - 0x250]
mov eax, dword [0x480ae8]
mov ecx, dword [ebx + 0xdc]
mov eax, dword [eax + ecx*4 - 0x1f40]
mov ecx, 2
call fcn.004093e4
mov edx, dword [ebp - 0x254]
lea eax, [ebp - 0x234]
mov ecx, 0xff
call fcn.004049ac
lea edx, [ebp - 0x234]
lea eax, [ebx + 0x11]
mov cl, 0xc8
call fcn.00402fd8
cmp byte [ebp + 8], 0
jne 0x46f555
mov esi, 0xfffffff7
jmp 0x46f991
dec edi
jne 0x46f3be
cmp esi, 0xffffffff
jne 0x46f5f4
mov edi, 0x7e1
mov dword [ebx + 0xdc], edi
lea eax, [ebp - 0x258]
push eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x250], eax
mov byte [ebp - 0x24c], 0xb
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x248], eax
mov byte [ebp - 0x244], 0xb
call sub.kernel32.dll_GetLastError_2
mov dword [ebp - 0x240], eax
mov byte [ebp - 0x23c], 0
lea edx, [ebp - 0x250]
mov eax, dword [0x480ae8]
mov eax, dword [eax + edi*4 - 0x1f40]
mov ecx, 2
call fcn.004093e4
mov edx, dword [ebp - 0x258]
lea eax, [ebp - 0x234]
mov ecx, 0xff
call fcn.004049ac
lea edx, [ebp - 0x234]
lea eax, [ebx + 0x11]
mov cl, 0xc8
call fcn.00402fd8
cmp byte [ebp + 8], 0
jne 0x46f5f4
mov esi, 0xfffffff7
jmp 0x46f991
cmp esi, 0xffffffff
je 0x46f6b7
xor eax, eax
mov dword [ebp - 0x30], eax
push 0
push 0
lea eax, [ebp - 0x30]
push eax
push esi
call sub.kernel32.dll_SetNamedPipeHandleState
test eax, eax
jne 0x46f6b7
push esi
call sub.kernel32.dll_CloseHandle_2
or esi, 0xffffffff
mov edi, 0x7e2
mov dword [ebx + 0xdc], edi
lea eax, [ebp - 0x25c]
push eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x250], eax
mov byte [ebp - 0x24c], 0xb
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x248], eax
mov byte [ebp - 0x244], 0xb
call sub.kernel32.dll_GetLastError_2
mov dword [ebp - 0x240], eax
mov byte [ebp - 0x23c], 0
lea edx, [ebp - 0x250]
mov eax, dword [0x480ae8]
mov eax, dword [eax + edi*4 - 0x1f40]
mov ecx, 2
call fcn.004093e4
mov edx, dword [ebp - 0x25c]
lea eax, [ebp - 0x234]
mov ecx, 0xff
call fcn.004049ac
lea edx, [ebp - 0x234]
lea eax, [ebx + 0x11]
mov cl, 0xc8
call fcn.00402fd8
cmp byte [ebp + 8], 0
jne 0x46f6b7
mov esi, 0xfffffff7
jmp 0x46f991
cmp esi, 0xffffffff
jne 0x46f6cc
cmp byte [ebp + 8], 0
jne 0x46f6df
mov esi, 0xfffffff7
jmp 0x46f991
mov byte [ebx + 0x10], 3
xor eax, eax
mov dword [ebx + 4], eax
mov dword [ebx + 8], esi
xor esi, esi
jmp 0x46f991
inc esi
jne 0x46f6e8
cmp byte [ebp - 0x15], 3
je 0x46f6f2
cmp byte [ebp + 8], 0
je 0x46f957
lea eax, [ebp - 0x1c]
mov edx, dword [ebp - 0x28]
call fcn.004047a8
lea eax, [ebp + 0x14]
mov edx, dword [ebp - 0x2c]
call fcn.004047a8
cmp dword [ebp + 0x10], 0
jne 0x46f715
mov dword [ebp + 0x10], 0xcea
cmp dword [ebp - 0x1c], 0
jne 0x46f728
lea eax, [ebp - 0x1c]
mov edx, 0x46fa4c
call fcn.004047a8
push 0
push 1
push 2
call sub.wsock32.dll_socket
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xffffffff
jne 0x46f7a9
mov esi, 0x7d4
mov dword [ebx + 0xdc], esi
lea eax, [ebp - 0x260]
push eax
call sub.wsock32.dll_WSAGetLastError
mov dword [ebp - 0x268], eax
mov byte [ebp - 0x264], 0
lea edx, [ebp - 0x268]
mov eax, dword [0x480ae8]
mov eax, dword [eax + esi*4 - 0x1f40]
xor ecx, ecx
call fcn.004093e4
mov edx, dword [ebp - 0x260]
lea eax, [ebp - 0x234]
mov ecx, 0xff
call fcn.004049ac
lea edx, [ebp - 0x234]
lea eax, [ebx + 0x11]
mov cl, 0xc8
call fcn.00402fd8
mov esi, 0xfffffff8
jmp 0x46f991
xor eax, eax
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x24]
push eax
push 0x8004667e
mov eax, dword [ebx + 4]
push eax
call sub.wsock32.dll_ioctlsocket
lea eax, [ebp - 0x14]
xor ecx, ecx
mov edx, 0x10
call fcn.004030e8
mov word [ebp - 0x14], 2
mov eax, dword [ebp - 0x1c]
call fcn.00404bd0
mov esi, eax
push esi
call sub.wsock32.dll_inet_addr
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
je 0x46f7f9
mov eax, dword [ebp - 4]
mov dword [ebp - 0x10], eax
jmp 0x46f8ba
push esi
call sub.wsock32.dll_gethostbyname
test eax, eax
jne 0x46f887
mov esi, 0x7d5
mov dword [ebx + 0xdc], esi
lea eax, [ebp - 0x26c]
push eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x27c], eax
mov byte [ebp - 0x278], 0xb
call sub.wsock32.dll_WSAGetLastError
mov dword [ebp - 0x274], eax
mov byte [ebp - 0x270], 0
lea edx, [ebp - 0x27c]
mov eax, dword [0x480ae8]
mov eax, dword [eax + esi*4 - 0x1f40]
mov ecx, 1
call fcn.004093e4
mov edx, dword [ebp - 0x26c]
lea eax, [ebp - 0x234]
mov ecx, 0xff
call fcn.004049ac
lea edx, [ebp - 0x234]
lea eax, [ebx + 0x11]
mov cl, 0xc8
call fcn.00402fd8
mov esi, 0xfffffff9
jmp 0x46f991
mov edx, dword [eax + 0xc]
mov edx, dword [edx]
xor ecx, ecx
mov cl, byte [edx]
movzx esi, byte [edx + 1]
shl esi, 8
add ecx, esi
movzx esi, byte [edx + 2]
shl esi, 0x10
add ecx, esi
movzx edx, byte [edx + 3]
shl edx, 0x18
add ecx, edx
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 4]
mov dword [ebp - 0x10], edx
mov word [eax + 0xa], 0xa
mov eax, dword [ebp + 0x10]
push eax
call sub.wsock32.dll_htons
mov word [ebp - 0x12], ax
push 0x10
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x20]
push eax
call sub.wsock32.dll_connect
test eax, eax
jge 0x46f957
mov esi, 0x7d3
mov dword [ebx + 0xdc], esi
lea eax, [ebp - 0x280]
push eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x27c], eax
mov byte [ebp - 0x278], 0xb
call sub.wsock32.dll_WSAGetLastError
mov dword [ebp - 0x274], eax
mov byte [ebp - 0x270], 0
lea edx, [ebp - 0x27c]
mov eax, dword [0x480ae8]
mov eax, dword [eax + esi*4 - 0x1f40]
mov ecx, 1
call fcn.004093e4
mov edx, dword [ebp - 0x280]
lea eax, [ebp - 0x234]
mov ecx, 0xff
call fcn.004049ac
lea edx, [ebp - 0x234]
lea eax, [ebx + 0x11]
mov cl, 0xc8
call fcn.00402fd8
mov esi, 0xfffffffa
jmp 0x46f991
cmp byte [ebx + 0x10], 3
je 0x46f964
mov eax, ebx
call fcn.0046f098
mov dl, 1
mov eax, ebx
call fcn.0046f0f0
mov byte [ebx + 0x10], 1
mov eax, dword [ebp - 0x20]
mov dword [ebx + 4], eax
xor eax, eax
mov dword [ebx + 8], eax
xor esi, esi
mov byte [ebx + 0x11], 0
xor eax, eax
mov dword [ebx + 0xdc], eax
jmp 0x46f991
mov esi, 0xffffffec
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x46f9ff
lea eax, [ebp - 0x280]
call fcn.00404710
lea eax, [ebp - 0x26c]
call fcn.00404710
lea eax, [ebp - 0x260]
mov edx, 4
call fcn.00404734
lea eax, [ebp - 0x238]
call fcn.00404710
lea eax, [ebp - 0x134]
call fcn.00404710
lea eax, [ebp - 0x2c]
mov edx, 2
call fcn.00404734
lea eax, [ebp - 0x1c]
call fcn.00404710
lea eax, [ebp + 0x14]
call fcn.00404710
ret