Function at 0x401220
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x1c
push ebx
push ebp
or ebp, 0xffffffff
push 0x40020
mov dword [esp + 0xc], ebp
call fcn.00401942
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4014aa
push esi
push edi
xor eax, eax
mov ecx, 0x10008
mov edi, ebx
xor esi, esi
rep stosd dword es:[edi], eax
mov dword [esp + 0x14], esi
test esi, esi
jne 0x401269
cmp ebp, 0xffffffff
je 0x401269
test ebp, ebp
jne 0x401305
jmp 0x401280
test ebp, ebp
je 0x401280
cmp ebp, 0xffffffff
je 0x401280
push 2
push ebp
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
push 6
mov edi, 2
push 1
push edi
call sub.WSOCK32.dll_socket
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x4012a7
mov dword [esp + 0x10], 0x15
mov dword [esp + 0x14], edi
jmp 0x401428
push 0xa769
mov word [esp + 0x20], di
call sub.WSOCK32.dll_htons
mov word [esp + 0x1e], ax
mov eax, dword [esp + 0x30]
cmp esi, 5
mov dword [esp + 0x20], eax
ja 0x40143a
lea ecx, [esp + 0x1c]
push 0x10
push ecx
push ebp
call sub.WSOCK32.dll_connect
test eax, eax
jge 0x401305
push edi
push ebp
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
push 0x7d0
or ebp, 0xffffffff
mov dword [esp + 0x14], 3
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401428
mov esi, dword [esp + 0x38]
mov edx, dword [esp + 0x34]
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
mov dword [ebx], 0xaabbccdd
mov dword [ebx + 4], edx
mov dword [ebx + 8], 0x30303030
repne scasb al, byte es:[edi]
not ecx
add ecx, 2
mov edi, esi
shr ecx, 2
shl ecx, 2
mov dword [ebx + 0x10], ecx
or ecx, 0xffffffff
mov dword [ebx + 0x14], 0x74401100
lea edx, [ebx + 0x20]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x14]
mov eax, dword [ebx + 0x10]
push ecx
push eax
push edx
call fcn.004011d0
mov ecx, dword [ebx + 0x10]
lea eax, [ebx + 0x20]
push ecx
push eax
call fcn.004011a0
mov esi, dword [ebx + 0x10]
add esp, 0x14
xor edi, edi
add esi, 0x20
push edi
push esi
push ebx
push ebp
mov dword [ebx + 0xc], eax
call sub.WSOCK32.dll_send
cmp eax, esi
je 0x40139e
mov dword [esp + 0x10], 0x2c
jmp 0x401428
mov dword [esp + 0x10], edi
mov dword [ebx], edi
mov dword [esp + 0x18], edi
mov edi, ebx
mov esi, 0x40020
push 0
push esi
push edi
push ebp
call sub.WSOCK32.dll_recv
test eax, eax
jle 0x4013fb
cmp eax, esi
jg 0x4013fb
cmp esi, 0x40020
jne 0x4013d7
cmp dword [ebx], 0xaabbccdd
jne 0x4013d7
mov esi, dword [ebx + 0x10]
add esi, 0x20
mov ecx, dword [esp + 0x18]
sub esi, eax
add ecx, eax
add edi, eax
test esi, esi
mov dword [esp + 0x18], ecx
jne 0x4013af
cmp dword [ebx], 0xaabbccdd
je 0x401405
mov dword [esp + 0x10], 0x4f
jmp 0x401428
mov dword [esp + 0x10], 0x4e
jmp 0x401428
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x401461
push eax
lea eax, [ebx + 0x20]
push eax
call fcn.004011a0
mov ecx, dword [ebx + 0xc]
add esp, 8
cmp ecx, eax
je 0x401461
mov dword [esp + 0x10], 0x50
mov esi, dword [esp + 0x14]
inc esi
cmp esi, 5
mov dword [esp + 0x14], esi
jb 0x401256
push ebx
call fcn.004018d9
add esp, 4
test ebp, ebp
pop edi
pop esi
jle 0x401457
push 2
push ebp
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
mov eax, dword [esp + 8]
pop ebp
pop ebx
add esp, 0x1c
ret
mov eax, dword [ebx + 8]
test eax, eax
je 0x40146e
mov dword [esp + 0x10], eax
jmp 0x40143a
mov edx, dword [ebx + 0x14]
mov eax, dword [ebx + 0x10]
lea esi, [ebx + 0x20]
push edx
push eax
push esi
call fcn.004011d0
mov edi, dword [esp + 0x48]
add esp, 0xc
test edi, edi
je 0x40149b
mov ecx, dword [ebx + 0x10]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x40]
test eax, eax
je 0x40143a
mov ecx, dword [ebx + 0x10]
mov dword [eax], ecx
jmp 0x40143a
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret