Function at 0x4c5950
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Set socket configuration

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4fe15b
push eax
mov dword fs:[0], esp
sub esp, 0x880
push ebx
mov ebx, dword [esp + 0x894]
push ebp
xor ebp, ebp
push esi
cmp ebx, ebp
push edi
je 0x4c5d55
mov esi, dword [esp + 0x8a4]
cmp esi, ebp
je 0x4c5d55
mov eax, dword [ebx + 6]
mov dword [esp + 0x1c], ebp
and eax, 0xffff
mov dword [ebx + 6], eax
mov dword [esi + 0x20], ebp
mov dword [esp + 0x14], 0
lea eax, [esp + 0x700]
push eax
push 0x101
call sub.WS2_32.dll_WSAStartup
test eax, eax
jne 0x4c5d55
push str.ct0.xiaoyou.qq.com
call sub.WS2_32.dll_gethostbyname
test eax, eax
mov dword [esp + 0x18], eax
je 0x4c5d50
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x10], edi
je 0x4c5d50
mov ecx, dword [esp + 0x18]
push 0x1bb
mov edx, dword [ecx + 0xc]
mov eax, dword [edx]
mov ecx, dword [eax]
mov word [esp + 0x3c], 2
mov dword [esp + 0x1c], ecx
call sub.WS2_32.dll_htons
mov edx, dword [esp + 0x18]
mov word [esp + 0x3a], ax
lea eax, [esp + 0x38]
push 0x10
push eax
push edi
mov dword [esp + 0x48], edx
call sub.WS2_32.dll_connect
cmp eax, 0xffffffff
jne 0x4c5a58
push edi
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x4c5d55
inc eax
cmp eax, 2
mov dword [esp + 0x14], eax
jl 0x4c59a9
lea ecx, [esp + 0x28]
mov dword [esp + 0x28], 0
push ecx
push 0x8004667e
push edi
call sub.WS2_32.dll_ioctlsocket
cmp byte [ebx + 0x17], 4
jne 0x4c5a91
push 0x1c
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], 0x1e
jmp 0x4c5c54
mov edx, dword [ebx + 0x48]
mov ecx, dword [ebx + 0x1c]
mov eax, dword [edx - 8]
lea eax, [ecx + eax + 0x28]
mov dword [ebx + 0x18], eax
add eax, 0x1e
push eax
mov dword [esp + 0x28], eax
call sub.MFC42.DLL_operatornew
xor edx, edx
mov edi, eax
mov dl, byte [ebx + 1]
mov dword [esp + 0x24], edi
mov byte [edi + ebp], dl
mov al, byte [ebx]
inc ebp
mov byte [edi + ebp], al
mov cl, byte [ebx + 2]
inc ebp
xor eax, eax
mov byte [edi + ebp], cl
mov dl, byte [ebx + 3]
inc ebp
mov byte [edi + ebp], dl
mov al, byte [ebx + 5]
inc ebp
mov byte [edi + ebp], al
mov cl, byte [ebx + 4]
inc ebp
mov byte [edi + ebp], cl
mov edx, dword [ebx + 6]
inc ebp
shr edx, 0x18
mov byte [edi + ebp], dl
mov eax, dword [ebx + 6]
inc ebp
shr eax, 0x10
mov byte [edi + ebp], al
mov ecx, dword [ebx + 6]
inc ebp
shr ecx, 8
mov byte [edi + ebp], cl
mov dl, byte [ebx + 6]
inc ebp
mov byte [edi + ebp], dl
mov eax, dword [ebx + 0xa]
inc ebp
shr eax, 0x18
mov byte [edi + ebp], al
mov ecx, dword [ebx + 0xa]
inc ebp
shr ecx, 0x10
mov byte [edi + ebp], cl
mov edx, dword [ebx + 0xa]
inc ebp
shr edx, 8
mov byte [edi + ebp], dl
mov al, byte [ebx + 0xa]
inc ebp
mov byte [edi + ebp], al
mov ecx, dword [ebx + 0xe]
inc ebp
shr ecx, 0x18
mov byte [edi + ebp], cl
mov edx, dword [ebx + 0xe]
inc ebp
shr edx, 0x10
mov byte [edi + ebp], dl
mov eax, dword [ebx + 0xe]
inc ebp
shr eax, 8
mov byte [edi + ebp], al
mov cl, byte [ebx + 0xe]
inc ebp
mov byte [edi + ebp], cl
mov edx, dword [ebx + 0x12]
inc ebp
shr edx, 0x18
mov byte [edi + ebp], dl
mov eax, dword [ebx + 0x12]
inc ebp
shr eax, 0x10
mov byte [edi + ebp], al
mov ecx, dword [ebx + 0x12]
inc ebp
shr ecx, 8
mov byte [edi + ebp], cl
mov dl, byte [ebx + 0x12]
inc ebp
mov byte [edi + ebp], dl
mov al, byte [ebx + 0x16]
inc ebp
mov byte [edi + ebp], al
mov cl, byte [ebx + 0x17]
inc ebp
mov byte [edi + ebp], cl
mov edx, dword [ebx + 0x18]
inc ebp
shr edx, 0x18
mov byte [edi + ebp], dl
mov eax, dword [ebx + 0x18]
inc ebp
shr eax, 0x10
mov byte [edi + ebp], al
mov ecx, dword [ebx + 0x18]
inc ebp
shr ecx, 8
mov byte [edi + ebp], cl
mov dl, byte [ebx + 0x18]
inc ebp
mov byte [edi + ebp], dl
mov eax, dword [ebx + 0x1c]
inc ebp
shr eax, 0x18
mov byte [edi + ebp], al
mov ecx, dword [ebx + 0x1c]
inc ebp
shr ecx, 0x10
mov byte [edi + ebp], cl
mov edx, dword [ebx + 0x1c]
inc ebp
shr edx, 8
mov byte [edi + ebp], dl
mov al, byte [ebx + 0x1c]
inc ebp
mov byte [edi + ebp], al
mov ecx, dword [ebx + 0x1c]
mov eax, dword [ebx + 0x20]
inc ebp
push ecx
push eax
lea edx, [edi + ebp]
push edx
call dword [sym.imp.MSVCRT.dll_strncpy]
mov edx, dword [ebx + 0x1c]
mov eax, dword [ebx + 0x24]
add ebp, edx
lea esi, [ebx + 0x28]
shr eax, 0x18
mov byte [edi + ebp], al
mov ecx, dword [ebx + 0x24]
inc ebp
shr ecx, 0x10
mov byte [edi + ebp], cl
mov edx, dword [ebx + 0x24]
inc ebp
mov ecx, 8
shr edx, 8
mov byte [edi + ebp], dl
mov al, byte [ebx + 0x24]
inc ebp
mov byte [edi + ebp], al
inc ebp
add edi, ebp
add ebp, 0x20
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebx + 0x48]
mov esi, dword [esp + 0x30]
mov ecx, dword [eax - 8]
push ecx
push eax
lea ecx, [esi + ebp]
push ecx
call dword [sym.imp.MSVCRT.dll_strncpy]
mov edx, dword [ebx + 0x48]
xor eax, eax
mov al, byte [ebx + 0x4d]
add esp, 0x1c
mov edi, dword [edx - 8]
add ebp, edi
mov edi, dword [esp + 0x10]
mov byte [esi + ebp], al
mov cl, byte [ebx + 0x4c]
inc ebp
mov byte [esi + ebp], cl
mov esi, dword [esp + 0x8a4]
inc ebp
lea edx, [esp + 0x2c]
push 4
push edx
push 1
push 6
push edi
mov dword [esp + 0x40], 0
call sub.WS2_32.dll_setsockopt
mov edx, dword [esp + 0x24]
mov dword [esp + 0x18], 0
mov ecx, edx
test edx, edx
mov dword [esp + 0x14], ecx
je 0x4c5cce
jmp 0x4c5c8d
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
cmp ecx, 0x5b4
mov eax, 0x5b4
jg 0x4c5c9c
mov eax, ecx
push 0
push eax
mov eax, dword [esp + 0x28]
sub eax, ecx
add eax, edx
push eax
push edi
call sub.WS2_32.dll_send
cmp eax, 0xffffffff
je 0x4c5cc1
mov ecx, dword [esp + 0x14]
sub ecx, eax
mov dword [esp + 0x14], ecx
jne 0x4c5c85
jmp 0x4c5cce
call sub.WS2_32.dll_WSAGetLastError
mov dword [esp + 0x18], 1
mov ecx, dword [esp + 0x20]
push ecx
call sub.MFC42.DLL_operatordelete
mov eax, dword [esp + 0x1c]
add esp, 4
test eax, eax
je 0x4c5d05
push edi
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
mov eax, dword [esp + 0x1c]
cmp eax, 1
je 0x4c5d55
inc eax
cmp eax, 2
mov dword [esp + 0x1c], eax
jl 0x4c59a1
lea edx, [esp + 0x30]
lea eax, [esp + 0x5fc]
push edx
push 0
push 0
push eax
push 0
mov dword [esp + 0x44], 0x14
mov dword [esp + 0x48], 0
mov dword [esp + 0x614], edi
mov dword [esp + 0x610], 1
call sub.WS2_32.dll_select
xor ebx, ebx
cmp eax, 0xffffffff
jne 0x4c5d70
call sub.WS2_32.dll_WSAGetLastError
jmp 0x4c61c4
call sub.WS2_32.dll_WSACleanup
xor eax, eax
mov ecx, dword [esp + 0x890]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x88c
ret
test eax, eax
jle 0x4c61c4
lea ecx, [esp + 0x5fc]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4c61c4
mov ecx, 0x16d
xor eax, eax
lea edi, [esp + 0x48]
push eax
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x4c]
push 0x5b4
push edx
push eax
mov dword [esp + 0x2c], 1
call sub.WS2_32.dll_recv
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4c60bc
xor ecx, ecx
cmp ebx, ecx
je 0x4c60d0
cmp dword [esp + 0x1c], ecx
je 0x4c5fc0
cmp ebx, 0x1e
mov dword [esp + 0x1c], ecx
jb 0x4c60f7
movzx dx, byte [esp + 0x49]
mov ch, byte [esp + 0x48]
mov al, byte [esp + 0x4a]
or ecx, edx
mov byte [esi + 2], al
movzx ax, byte [esp + 0x4d]
xor edx, edx
mov word [esi], cx
mov cl, byte [esp + 0x4b]
mov dh, byte [esp + 0x4c]
or edx, eax
mov eax, dword [esp + 0x50]
mov byte [esi + 3], cl
mov ecx, dword [esp + 0x4e]
mov word [esi + 4], dx
mov edx, dword [esp + 0x4f]
and ecx, 0xff
and edx, 0xff
shl ecx, 8
or ecx, edx
mov edx, dword [esp + 0x51]
shl ecx, 8
and eax, 0xff
and edx, 0xff
or ecx, eax
mov eax, dword [esp + 0x52]
shl ecx, 8
or ecx, edx
mov edx, dword [esp + 0x54]
mov dword [esi + 6], ecx
mov ecx, dword [esp + 0x53]
and eax, 0xff
and ecx, 0xff
shl eax, 8
or eax, ecx
mov ecx, dword [esp + 0x55]
shl eax, 8
and edx, 0xff
and ecx, 0xff
or eax, edx
mov edx, dword [esp + 0x56]
shl eax, 8
or eax, ecx
mov ecx, dword [esp + 0x58]
mov dword [esi + 0xa], eax
mov eax, dword [esp + 0x57]
and edx, 0xff
and eax, 0xff
shl edx, 8
or edx, eax
mov eax, dword [esp + 0x59]
shl edx, 8
and ecx, 0xff
and eax, 0xff
or edx, ecx
mov ecx, dword [esp + 0x5a]
shl edx, 8
or edx, eax
mov eax, dword [esp + 0x5c]
mov dword [esi + 0xe], edx
mov edx, dword [esp + 0x5b]
and ecx, 0xff
and edx, 0xff
shl ecx, 8
or ecx, edx
and eax, 0xff
shl ecx, 8
or ecx, eax
mov eax, dword [esp + 0x5d]
mov edx, eax
mov al, byte [esp + 0x5f]
shl ecx, 8
and edx, 0xff
mov byte [esi + 0x16], ah
mov byte [esi + 0x17], al
mov eax, dword [esp + 0x60]
or ecx, edx
and eax, 0xff
mov dword [esi + 0x12], ecx
mov ecx, dword [esp + 0x61]
shl eax, 8
mov edx, dword [esp + 0x62]
and ecx, 0xff
or eax, ecx
mov ecx, dword [esp + 0x63]
shl eax, 8
and edx, 0xff
and ecx, 0xff
or eax, edx
shl eax, 8
or eax, ecx
mov dword [esi + 0x18], eax
inc eax
push eax
call sub.MFC42.DLL_operatornew
mov edx, dword [esi + 0x18]
mov dword [esi + 0x20], eax
lea ebp, [ebx - 0x1c]
add esp, 4
mov byte [eax + edx], 0
mov esi, dword [esi + 0x18]
cmp ebp, esi
jbe 0x4c5f5b
mov ebp, esi
mov eax, dword [esp + 0x8a4]
mov ecx, ebp
mov edx, ecx
lea esi, [esp + 0x64]
mov edi, dword [eax + 0x20]
add ebp, 0x1c
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [eax + 0x18]
lea esi, [ecx + 0x1c]
cmp ebx, esi
jbe 0x4c5f94
xor ecx, ecx
mov ch, byte [esp + ebp + 0x48]
inc ebp
mov cl, byte [eax + 0x24]
mov word [eax + 0x24], cx
lea edx, [esi + 1]
cmp ebx, edx
jbe 0x4c5fa9
xor ecx, ecx
mov cl, byte [esp + ebp + 0x48]
inc ebp
mov ch, byte [eax + 0x25]
mov word [eax + 0x24], cx
add esi, 2
cmp ebp, esi
jae 0x4c60df
mov esi, dword [esp + 0x8a4]
jmp 0x4c608f
mov eax, dword [esi + 0x18]
mov edx, ebp
mov dword [esp + 0x18], edx
lea edi, [eax + 0x1c]
cmp ebp, edi
jae 0x4c6042
lea ecx, [ebx + ebp]
cmp ecx, edi
mov dword [esp + 0x14], ecx
jbe 0x4c6013
mov edx, dword [esp + 0x8a4]
sub eax, ebp
add eax, 0x1c
lea esi, [esp + 0x48]
mov edx, dword [edx + 0x20]
mov ecx, eax
lea edi, [edx + ebp - 0x1c]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x18]
and ecx, 3
add ebp, eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x8a4]
mov ecx, eax
jmp 0x4c6042
mov eax, dword [esp + 0x8a4]
mov ecx, ebx
lea esi, [esp + 0x48]
mov eax, dword [eax + 0x20]
lea edi, [eax + ebp - 0x1c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ebp, dword [esp + 0x14]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x8a4]
mov ecx, ebx
mov eax, dword [esi + 0x18]
lea edi, [eax + 0x1c]
cmp edx, edi
mov dword [esp + 0x18], edi
ja 0x4c6066
lea eax, [edx + ebx]
cmp eax, edi
jbe 0x4c6066
xor eax, eax
inc ebp
mov ah, byte [esp + ecx + 0x48]
inc ecx
mov al, byte [esi + 0x24]
mov word [esi + 0x24], ax
lea eax, [edi + 1]
cmp edx, eax
ja 0x4c6086
lea edi, [edx + ebx]
cmp edi, eax
jbe 0x4c6082
xor eax, eax
inc ebp
mov al, byte [esp + ecx + 0x48]
mov ah, byte [esi + 0x25]
mov word [esi + 0x24], ax
mov edi, dword [esp + 0x18]
add edx, ebx
add edi, 2
cmp edx, edi
jae 0x4c60fe
mov edx, dword [esp + 0x10]
mov ecx, 0x16d
xor eax, eax
lea edi, [esp + 0x48]
rep stosd dword es:[edi], eax
push eax
lea ecx, [esp + 0x4c]
push 0x5b4
push ecx
push edx
call sub.WS2_32.dll_recv
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4c5dc3
call sub.WS2_32.dll_WSAGetLastError
mov eax, dword [esp + 0x10]
push eax
call sub.WS2_32.dll_closesocket
jmp 0x4c61c0
mov ecx, dword [esp + 0x10]
push ecx
call sub.WS2_32.dll_closesocket
jmp 0x4c61c0
mov edx, dword [eax + 0x20]
lea ecx, [eax + 0x1c]
push edx
call sub.MFC42.DLL_CString::operator_3
mov esi, dword [esp + 0x8a4]
jmp 0x4c61c0
xor ebx, ebx
jmp 0x4c61c0
cmp byte [esi + 0x17], 3
jne 0x4c61b4
mov eax, dword [esi + 0x12]
test eax, eax
je 0x4c61b4
add eax, 0x400
push eax
call sub.MFC42.DLL_operatornew
mov edx, dword [esi + 0x18]
mov edi, eax
mov eax, dword [esi + 0x12]
lea ecx, [esp + 0x20]
add eax, 0x400
push ecx
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0x20]
push edi
push edx
push eax
call fcn.0040a6e0
mov ecx, dword [esi + 0x12]
add esp, 0x14
mov ebp, eax
mov byte [ecx + edi], 0
push edi
lea ecx, [esi + 0x1c]
call sub.MFC42.DLL_CString::operator_3
push edi
call sub.MFC42.DLL_operatordelete
add esp, 4
test ebp, ebp
je 0x4c61c0
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_4
mov edx, dword [esi + 0x12]
mov eax, dword [esi + 0x18]
push edx
push eax
push ebp
lea ecx, [esp + 0x20]
push 0x52e510
push ecx
mov dword [esp + 0x8ac], 0
call sub.MFC42.DLL_CString::Format
mov edx, dword [esp + 0x28]
add esp, 0x14
push 0
push 0
push edx
call sub.MFC42.DLL_AfxMessageBox
lea ecx, [esp + 0x14]
mov dword [esp + 0x898], 0xffffffff
call sub.MFC42.DLL_CString::CString
jmp 0x4c61c0
mov eax, dword [esi + 0x20]
lea ecx, [esi + 0x1c]
push eax
call sub.MFC42.DLL_CString::operator_3
mov edi, dword [esp + 0x10]
push edi
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4c61e6
push eax
call sub.MFC42.DLL_operatordelete
add esp, 4
mov dword [esi + 0x20], 0
test ebx, ebx
je 0x4c5d55
cmp ebx, 0xffffffff
je 0x4c5d55
mov eax, 1
jmp 0x4c5d57