adamhathcock / sharpcompress

SharpCompress is a fully managed C# library to deal with many compression types and formats.
MIT License
2.26k stars 480 forks source link

Add .asar support #413

Open lanzorg opened 6 years ago

lanzorg commented 6 years ago

It would be great if sharpcompress could handle .asar archives.

adamhathcock commented 6 years ago

It’s for electron? https://github.com/electron/asar/

I’ll look into it. Looks simple enough, unlike Tar :)

lanzorg commented 6 years ago

Yes, it is.
Glad to know this would be "easily" possible. :)

adamhathcock commented 6 years ago

The hard part is that someone would need to port Pickle to C# https://github.com/electron-archive/node-chromium-pickle

The essentially has a Pickled JSON dictionary at the header then a series of bytes afterward. The dictionary contains all the offsets for the files in the archive.

roy-tate commented 5 years ago

I haven't personally tested this, but Razorvine.Pyrolite implements Pickle for a limited mapping of Python objects. It is on GitHub, MIT licensed, targets .Net Standard 2.0, and the documentation explicitly says that the pickle and un-pickle (Protocol 2) can be used stand-alone (Razorvine.Pyrolite/Pickle)