Function at 0x402d50
Capabilities:
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
call fcn.00401850
mov edx, 0x7d0
cmp eax, 0x7b0
jg 0x402fe2
mov dword [esp], edx
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x24], eax
mov esi, eax
mov byte [eax], 0x24
inc esi
mov ebx, dword [ebp + 0xc]
mov byte [ebp - 0x1d], 0
test ebx, ebx
jle 0x402e2b
xor edi, edi
mov byte [ebp - 0x1d], 0
lea esi, [esi]
lea edi, [edi]
mov eax, dword [ebp + 8]
lea ecx, [edi + eax]
movzx eax, byte [ecx]
add byte [ebp - 0x1d], al
mov byte [esi], al
inc esi
mov edx, dword [ebp + 0xc]
sub edx, edi
cmp edx, 0x61
jle 0x402f1a
mov edx, 0x61
movzx ebx, byte [ecx + 1]
mov eax, 1
cmp bl, byte [ecx]
je 0x402dd9
jmp 0x402f26
cmp byte [eax + ecx], bl
jne 0x402de2
inc eax
cmp edx, eax
lea esi, [esi]
jne 0x402dd4
lea edx, [eax - 1]
cmp edx, 2
jle 0x402f26
sub eax, 7
cmp eax, 1
ja 0x402e09
lea esi, [esi]
lea edi, [edi]
dec edx
lea eax, [edx - 6]
cmp eax, 1
jbe 0x402e00
mov byte [esi], 0x2a
mov al, dl
add byte [ebp - 0x1d], 0x47
add al, 0x1d
add byte [ebp - 0x1d], dl
mov byte [esi + 1], al
add esi, 2
lea eax, [edx + 1]
add edi, eax
cmp dword [ebp + 0xc], edi
jg 0x402da0
mov byte [esi], 0x23
lea edi, [esi + 3]
movzx eax, byte [ebp - 0x1d]
shr al, 4
movzx eax, al
and eax, 0xf
call fcn.00401d60
mov byte [esi + 1], al
movzx eax, byte [ebp - 0x1d]
and eax, 0xf
call fcn.00401d60
mov byte [esi + 3], 0
mov byte [esi + 2], al
mov ecx, dword [ebp - 0x24]
sub edi, ecx
jmp 0x402eb6
xor eax, eax
mov dword [esp + 0xc], eax
mov eax, 1
mov dword [esp + 8], eax
lea eax, [ebp - 0xd]
mov dword [esp + 4], eax
mov eax, dword [section..data]
mov dword [esp], eax
call sub.WSOCK32.DLL_recv
mov esi, eax
mov eax, dword [0x40d040]
sub esp, 0x10
test eax, eax
jne 0x402f35
cmp esi, 0
jle 0x402f6c
cmp byte [ebp - 0xd], 3
je 0x402fb8
cmp byte [ebp - 0xd], 0x2b
lea esi, [esi]
je 0x402fca
xor edx, edx
mov dword [esp + 0xc], edx
mov dword [esp + 8], edi
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov eax, dword [section..data]
mov dword [esp], eax
call sub.WSOCK32.DLL_send
sub esp, 0x10
cmp eax, edi
jne 0x402fef
mov eax, dword [0x40d040]
test eax, eax
je 0x402e60
mov eax, dword [ebp - 0x24]
mov ebx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], eax
mov eax, str.putpkt____s_____looking_for_ack__n
add ebx, 0x40
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.msvcrt.dll_fprintf
mov dword [esp], ebx
call sub.msvcrt.dll_fflush
jmp 0x402e60
cmp edx, 1
lea esi, [esi]
jg 0x402dc2
mov eax, 1
nop
lea esi, [esi]
jmp 0x402e20
movsx eax, byte [ebp - 0xd]
mov ebx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], eax
add ebx, 0x40
mov dword [esp + 8], eax
mov eax, str._received__c__0x_x___n
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.msvcrt.dll_fprintf
mov dword [esp], ebx
call sub.msvcrt.dll_fflush
cmp esi, 0
jg 0x402e9e
lea esi, [esi]
jne 0x403013
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov esi, 0x16
mov ebx, 1
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], str.putpkt_read_:_Got_EOF_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sub.msvcrt.dll_free
lea esp, [ebp - 0xc]
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x40de50]
call dword [eax + 0x34]
cmp byte [ebp - 0xd], 0x2b
jne 0x402eb6
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sub.msvcrt.dll_free
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.00401850
lea edx, [eax + 0x20]
jmp 0x402d6e
mov dword [esp], str.putpkt_write_
call sub.msvcrt.dll_perror
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sub.msvcrt.dll_free
lea esp, [ebp - 0xc]
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.putpkt_read_
call sub.msvcrt.dll_perror
jmp 0x402fa0