Function at 0x401213
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x40a004]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [ebp + 8], 0
push ebx
push esi
push edi
mov ebx, ecx
mov edi, edx
jne 0x401251
and dword [ebp - 0xb], 0
push 0
push 5
lea eax, [ebp - 0xc]
push eax
push dword [0x40b8b0]
mov byte [ebp - 0xc], 1
call dword [sym.imp.WS2_32.dll_send]
jmp 0x40145a
cmp byte [ebp + 8], 1
jne 0x40145a
movsx esi, byte [edi]
lea eax, [esi + 1]
push eax
call fcn.00401ded
push esi
lea ecx, [edi + 1]
push ecx
push eax
mov dword [ebp - 0x28], eax
call fcn.00405710
mov eax, dword [ebp - 0x28]
sub ebx, esi
mov byte [esi + eax], 0
dec ebx
lea eax, [ebx + 1]
push eax
call fcn.00401ded
push ebx
lea ecx, [esi + edi + 1]
push ecx
push eax
mov dword [ebp - 0x44], eax
call fcn.00405710
mov edi, dword [ebp - 0x44]
add esp, 0x20
push 6
xor esi, esi
push 1
mov byte [edi + ebx], 0
push 2
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x24], esi
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
mov dword [ebp - 0x34], ebx
cmp ebx, 0xffffffff
je 0x401346
push dword [ebp - 0x28]
mov dword [ebp - 0x20], esi
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, esi
je 0x401346
cmp word [eax + 8], 2
jne 0x4012f3
movsx ecx, word [eax + 0xa]
mov eax, dword [eax + 0xc]
push ecx
push dword [eax]
lea eax, [ebp - 0x20]
push eax
call fcn.00405710
add esp, 0xc
push 2
pop eax
push 0x50
mov word [ebp - 0x1c], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x1a], ax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x18], eax
push 0x10
lea eax, [ebp - 0x1c]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x401346
mov eax, edi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x401323
push esi
sub eax, ecx
push eax
push edi
push ebx
mov ebx, dword [sym.imp.WS2_32.dll_send]
call ebx
cmp eax, 0xffffffff
jne 0x40135d
push dword [ebp - 0x34]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [ebp - 0x28]
call fcn.00401e81
push edi
call fcn.00401e81
pop ecx
pop ecx
xor al, al
jmp 0x40145c
xor edi, edi
inc edi
push edi
push edi
call fcn.00401ebb
push edi
push edi
mov dword [ebp - 0x40], eax
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x38], esi
call fcn.00401ebb
push edi
push edi
mov dword [ebp - 0x30], eax
call fcn.00401ebb
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x34]
lea edi, [ebp - 0xc]
call fcn.0040146b
add esp, 0x30
test al, al
je 0x4013ee
mov edi, dword [ebp - 0x48]
mov eax, dword [ebp - 0x38]
lea eax, [eax + edi + 4]
mov dword [ebp - 0x2c], eax
inc eax
push eax
mov dword [ebp - 0x3c], edi
call fcn.00401ded
push edi
push dword [ebp - 0x30]
mov dword [ebp - 0x24], eax
push eax
call fcn.00405710
mov eax, dword [ebp - 0x24]
push dword [ebp - 0x38]
add eax, edi
push dword [ebp - 0x20]
mov dword [eax], 0xa0d0a0d
add eax, 4
push eax
call fcn.00405710
add esp, 0x1c
push dword [ebp - 0x40]
call fcn.00401e81
push dword [ebp - 0x30]
call fcn.00401e81
push dword [ebp - 0x20]
call fcn.00401e81
add esp, 0xc
push dword [ebp - 0x34]
call dword [sym.imp.WS2_32.dll_closesocket]
push esi
push 4
lea eax, [ebp - 0x2c]
push eax
push dword [0x40b8b0]
call ebx
push esi
push 4
lea eax, [ebp - 0x3c]
push eax
push dword [0x40b8b0]
call ebx
push esi
push dword [ebp - 0x2c]
push dword [ebp - 0x24]
push dword [0x40b8b0]
call ebx
push dword [ebp - 0x24]
call fcn.00401e81
push dword [ebp - 0x28]
call fcn.00401e81
push dword [ebp - 0x44]
call fcn.00401e81
add esp, 0xc
mov al, 1
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004019c7
leave
ret