Skip to content

snowberry-software/Snowberry.IO.SingleFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License NuGet Version

Snowberry.IO.SingleFile

A library for reading and modifying bundles from single-file published .NET applications.

How to use it

Reading and modifying the data from a single-file published .NET application

using var singleFileBinaryData = SingleFileBinaryData.GetFromFile(o.InputFilePath);

// To access the bundle manifest
var bundleManifest = singleFileBinaryData.BundleManifest;

// To access information about the bundle's files
var fileEntry = bundleManifest.FileEntries[0];

// To read the file's data
using var fileEntryStream = singleFileBinaryData.GetStream(fileEntry);

// Do stuff...

// Modify the file entry
SingleFileBinaryData.ModifyFileEntry(fileEntry, new byte[]);
// or
fileEntry.ModifiedFileEntryMeta?.Dispose();
fileEntry.ModifiedFileEntryMeta = new()
{
    ModifiedDataStream = stream,
    FileLocation = new()
    {
        Offset = 0,
        Size = stream.Length
    }
};

// Repack the application
singleFileBinaryData.Save("output.exe", TargetInfo.Windows, new BundlerOptions());

About

A bundle reader and writer for .NET single file published applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages