CCob/BOF.NET

DownloadFile() fails for files larger 1MB

0xShkk opened this issue · 0 comments

Hi, thank you for sharing this great code.

Unfortunately I always receive a

 [-] download [id: -1555981019] closed: Missed start message/metadata.

error in Cobalt when trying to download files larger 1MB. What could be the issue here?

My code on the assembly side for simple testing of the download looks like this:

using BOFNET;
using System.IO;

namespace dlfix
{
    internal class Program
    {
        class DLFIX : BeaconObject
        {

            public DLFIX(BeaconApi api) : base(api) { }

            public override void Go(string[] args)
            {
                BeaconConsole.WriteLine("[+] TESTING DOWNLOAD");

                byte[] filebyte = File.ReadAllBytes(@"C:\temp\Testing");
                MemoryStream stream = new MemoryStream();

                using (var writer = new BinaryWriter(stream))
                {
                    writer.Write(filebyte);
                    stream.Position = 0;
                    DownloadFile("notexisting.bin", stream);
                }

            }
        }
    }
}