Function at 0x401260
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create thread
Create udp socket
Download and write a file
Get socket status
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header
Set socket configuration
Terminate thread
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x23f8
call fcn.004105e0
mov eax, dword [0x43d120]
xor eax, ebp
mov dword [ebp - 8], eax
push esi
push edi
mov eax, dword [ebp + 0x14]
mov dword [eax], 0xffffffff
cmp dword [ebp + 0x18], 1
jne 0x401291
mov ecx, dword [ebp + 0x10]
mov dword [ecx], 0
push str.http:__
mov edx, dword [ebp + 8]
push edx
call fcn.0040db70
add esp, 8
mov dword [ebp - 0x2138], eax
cmp dword [ebp - 0x2138], 0
jne 0x4012b9
or eax, 0xffffffff
jmp 0x401a1f
mov eax, dword [ebp - 0x2138]
add eax, 7
mov dword [ebp - 0x2138], eax
push 0x4352cc
mov ecx, dword [ebp - 0x2138]
add ecx, 7
push ecx
call fcn.0040db70
add esp, 8
mov dword [ebp - 0x214c], eax
cmp dword [ebp - 0x214c], 0
je 0x401327
mov edx, dword [ebp - 0x214c]
sub edx, dword [ebp - 0x2138]
push edx
mov eax, dword [ebp - 0x2138]
push eax
lea ecx, [ebp - 0x21b8]
push ecx
call fcn.004104b0
add esp, 0xc
mov edx, dword [ebp - 0x214c]
sub edx, dword [ebp - 0x2138]
mov byte [ebp + edx - 0x21b8], 0
jmp 0x401340
mov eax, dword [ebp - 0x2138]
add eax, 7
push eax
lea ecx, [ebp - 0x21b8]
push ecx
call fcn.0040f840
add esp, 8
push 0x4352d0
lea edx, [ebp - 0x21b8]
push edx
call fcn.0040db70
add esp, 8
mov dword [ebp - 0x2138], eax
cmp dword [ebp - 0x2138], 0
je 0x401386
mov eax, dword [ebp - 0x2138]
mov byte [eax], 0
mov ecx, dword [ebp - 0x2138]
add ecx, 1
push ecx
call fcn.00410469
add esp, 4
mov dword [ebp - 0x21bc], eax
jmp 0x401390
mov dword [ebp - 0x21bc], 0x50
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x2128], eax
cmp dword [ebp - 0x2128], 0xffffffff
jne 0x4013b3
or eax, 0xffffffff
jmp 0x401a1f
lea edx, [ebp - 0x22d4]
push edx
push 0
lea eax, [ebp - 0x21b8]
push eax
push 0x401b60
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebp - 0x22d0], eax
push 0x3e8
mov ecx, dword [ebp - 0x22d0]
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x401415
push 0
mov edx, dword [ebp - 0x22d0]
push edx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [ebp - 0x22d0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x401a1f
mov ecx, dword [ebp - 0x22d0]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x10
push 0
lea edx, [ebp - 0x2148]
push edx
call fcn.004103c0
add esp, 0xc
mov eax, 2
mov word [ebp - 0x2148], ax
lea ecx, [ebp - 0x21b8]
push ecx
call fcn.00401a30
add esp, 4
mov dword [ebp - 0x2144], eax
movzx edx, word [ebp - 0x21bc]
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x2146], ax
mov dword [ebp - 4], 1
lea eax, [ebp - 4]
push eax
push 0x8004667e
mov ecx, dword [ebp - 0x2128]
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov dword [ebp - 0x22c8], 0
mov dword [ebp - 0x22dc], 0
jmp 0x4014ad
mov edx, dword [ebp - 0x22dc]
add edx, 1
mov dword [ebp - 0x22dc], edx
mov eax, dword [ebp - 0x22dc]
cmp eax, dword [ebp - 0x22c8]
jae 0x4014d4
mov ecx, dword [ebp - 0x22dc]
mov edx, dword [ebp + ecx*4 - 0x22c4]
cmp edx, dword [ebp - 0x2128]
jne 0x4014d2
jmp 0x4014d4
jmp 0x40149e
mov eax, dword [ebp - 0x22dc]
cmp eax, dword [ebp - 0x22c8]
jne 0x40150d
cmp dword [ebp - 0x22c8], 0x40
jae 0x40150d
mov ecx, dword [ebp - 0x22dc]
mov edx, dword [ebp - 0x2128]
mov dword [ebp + ecx*4 - 0x22c4], edx
mov eax, dword [ebp - 0x22c8]
add eax, 1
mov dword [ebp - 0x22c8], eax
xor ecx, ecx
jne 0x401492
push 0x10
lea edx, [ebp - 0x2148]
push edx
mov eax, dword [ebp - 0x2128]
push eax
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x2134], 0
mov ecx, dword [ebp + 0x1c]
mov dword [ebp - 0x2130], ecx
mov ecx, 0x41
lea esi, [ebp - 0x22c8]
lea edi, [ebp - 0x2120]
rep movsd dword es:[edi], dword [esi]
lea edx, [ebp - 0x2134]
push edx
push 0
lea eax, [ebp - 0x2120]
push eax
push 0
push 1
call dword [sym.imp.WS2_32.dll_select]
lea ecx, [ebp - 0x2120]
push ecx
mov edx, dword [ebp - 0x2128]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x401593
mov eax, dword [ebp - 0x2128]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x401a1f
lea ecx, [ebp - 0x21b8]
push ecx
mov edx, dword [ebp + 8]
push edx
push str.GET__s_HTTP_1.1_r_nHost:__s_r_n_r_n
lea eax, [ebp - 0x2010]
push eax
call fcn.0041020b
add esp, 0x10
lea ecx, [ebp - 0x2010]
push ecx
call fcn.0040f320
add esp, 4
mov dword [ebp - 0x2018], eax
push 0
mov edx, dword [ebp - 0x2018]
push edx
lea eax, [ebp - 0x2010]
push eax
mov ecx, dword [ebp - 0x2128]
push ecx
call dword [sym.imp.WS2_32.dll_send]
mov dword [ebp - 0x2014], eax
mov edx, dword [ebp - 0x2014]
cmp edx, dword [ebp - 0x2018]
je 0x40160d
mov eax, dword [ebp - 0x2128]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x401a1f
mov dword [ebp - 0x212c], 0
mov byte [ebp - 0x22c9], 0
cmp dword [ebp + 0x18], 0
jne 0x401659
push 0x4352f4
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.004101a1
add esp, 8
mov dword [ebp - 0x2124], eax
cmp dword [ebp - 0x2124], 0
jne 0x401659
mov edx, dword [ebp - 0x2128]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x401a1f
mov dword [ebp - 0x23f0], 0
mov dword [ebp - 0x22e4], 0
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x22e0], eax
mov dword [ebp - 0x23f4], 0
jmp 0x401691
mov ecx, dword [ebp - 0x23f4]
add ecx, 1
mov dword [ebp - 0x23f4], ecx
mov edx, dword [ebp - 0x23f4]
cmp edx, dword [ebp - 0x23f0]
jae 0x4016b8
mov eax, dword [ebp - 0x23f4]
mov ecx, dword [ebp + eax*4 - 0x23ec]
cmp ecx, dword [ebp - 0x2128]
jne 0x4016b6
jmp 0x4016b8
jmp 0x401682
mov edx, dword [ebp - 0x23f4]
cmp edx, dword [ebp - 0x23f0]
jne 0x4016f1
cmp dword [ebp - 0x23f0], 0x40
jae 0x4016f1
mov eax, dword [ebp - 0x23f4]
mov ecx, dword [ebp - 0x2128]
mov dword [ebp + eax*4 - 0x23ec], ecx
mov edx, dword [ebp - 0x23f0]
add edx, 1
mov dword [ebp - 0x23f0], edx
xor eax, eax
jne 0x401676
lea ecx, [ebp - 0x22e4]
push ecx
push 0
push 0
lea edx, [ebp - 0x23f0]
push edx
push 1
call dword [sym.imp.WS2_32.dll_select]
lea eax, [ebp - 0x23f0]
push eax
mov ecx, dword [ebp - 0x2128]
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x40173d
mov edx, dword [ebp - 0x2128]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, 0xfffffffd
jmp 0x401a1f
push 0
push 0x1000
lea eax, [ebp - 0x1010]
push eax
mov ecx, dword [ebp - 0x2128]
push ecx
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x2014], eax
mov edx, dword [ebp - 0x2014]
mov byte [ebp + edx - 0x1010], 0
cmp dword [ebp - 0x2014], 0
jg 0x40178c
mov eax, dword [ebp - 0x2128]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, 0xfffffffc
jmp 0x401a1f
movzx ecx, byte [ebp - 0x22c9]
test ecx, ecx
je 0x4017fb
cmp dword [ebp + 0x18], 0
jne 0x4017bc
mov edx, dword [ebp - 0x2124]
push edx
push 1
mov eax, dword [ebp - 0x2014]
push eax
lea ecx, [ebp - 0x1010]
push ecx
call fcn.0041005b
add esp, 0x10
cmp dword [ebp + 0x18], 1
jne 0x4017e4
mov edx, dword [ebp - 0x2014]
push edx
lea eax, [ebp - 0x1010]
push eax
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx]
add edx, dword [ebp - 0x212c]
push edx
call fcn.0040f940
add esp, 0xc
mov eax, dword [ebp - 0x212c]
add eax, dword [ebp - 0x2014]
mov dword [ebp - 0x212c], eax
jmp 0x4019a7
push str.HTTP_1.1_404
lea ecx, [ebp - 0x1010]
push ecx
call fcn.0040db70
add esp, 8
test eax, eax
je 0x401828
mov edx, dword [ebp - 0x2128]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x401a1f
push str.HTTP_1.1_200
lea eax, [ebp - 0x1010]
push eax
call fcn.0040db70
add esp, 8
test eax, eax
jne 0x401855
mov ecx, dword [ebp - 0x2128]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x401a1f
push str.Content_Length:
lea edx, [ebp - 0x1010]
push edx
call fcn.0040db70
add esp, 8
mov dword [ebp - 0x2138], eax
cmp dword [ebp - 0x2138], 0
jne 0x40188d
mov eax, dword [ebp - 0x2128]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x401a1f
mov ecx, dword [ebp - 0x2138]
add ecx, 0x10
mov dword [ebp - 0x2138], ecx
mov edx, dword [ebp - 0x2138]
push edx
call fcn.00410469
add esp, 4
mov dword [ebp - 0x22d8], eax
push str._r_n_r_n
lea eax, [ebp - 0x1010]
push eax
call fcn.0040db70
add esp, 8
mov dword [ebp - 0x2138], eax
cmp dword [ebp - 0x2138], 0
jne 0x4018e9
mov ecx, dword [ebp - 0x2128]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x401a1f
mov edx, dword [ebp - 0x2138]
add edx, 4
mov dword [ebp - 0x2138], edx
mov byte [ebp - 0x22c9], 1
mov eax, dword [ebp - 0x2138]
lea ecx, [ebp - 0x1010]
sub eax, ecx
mov edx, dword [ebp - 0x2014]
sub edx, eax
mov dword [ebp - 0x2014], edx
cmp dword [ebp + 0x18], 0
jne 0x40194b
mov eax, dword [ebp - 0x2124]
push eax
push 1
mov ecx, dword [ebp - 0x2014]
push ecx
mov edx, dword [ebp - 0x2138]
push edx
call fcn.0041005b
add esp, 0x10
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 0x22d8]
mov dword [eax], ecx
cmp dword [ebp + 0x18], 1
jne 0x40199b
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0x22d8]
mov dword [edx], eax
mov ecx, dword [ebp - 0x22d8]
add ecx, 1
push ecx
call fcn.0040f13a
add esp, 4
mov dword [ebp - 0x23f8], eax
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x23f8]
mov dword [edx], eax
mov ecx, dword [ebp - 0x2014]
push ecx
mov edx, dword [ebp - 0x2138]
push edx
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
push ecx
call fcn.0040f940
add esp, 0xc
mov edx, dword [ebp - 0x2014]
mov dword [ebp - 0x212c], edx
mov eax, dword [ebp - 0x22d8]
cmp eax, dword [ebp - 0x212c]
jg 0x401659
mov ecx, dword [ebp - 0x2128]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
cmp dword [ebp + 0x18], 0
jne 0x4019db
mov edx, dword [ebp - 0x2124]
push edx
call fcn.0040fe7d
add esp, 4
cmp dword [ebp + 0x18], 1
jne 0x4019f0
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
mov edx, dword [ebp - 0x22d8]
mov byte [ecx + edx], 0
cmp dword [ebp + 0x18], 1
jne 0x401a05
mov eax, dword [ebp + 0x14]
cmp dword [eax], 0
jge 0x401a05
mov eax, 0xfffffffb
jmp 0x401a1f
cmp dword [ebp + 0x18], 1
jne 0x401a1a
mov ecx, dword [ebp + 0x10]
cmp dword [ecx], 0
jne 0x401a1a
mov eax, 0xfffffffb
jmp 0x401a1f
mov eax, 1
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040f82a
mov esp, ebp
pop ebp
ret