Skip to content

Sc0ld/Hisn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hisn — .NET Packer & In-Memory Loader

.NET Framework 4.7.2+ · dnlib 3.6.0 · MIT License**

What is Hisn?

Hisn packs your .NET app into encrypted resource chunks, embeds a tiny runtime (Hisn.Runtime.dll), loads it from memory at run time, and calls your Startup method—so you don’t ship extra files with the protected app.


Features

  • Resource packing: split payload into chunks, AES-CBC encrypt, add HMAC integrity tags, write a manifest (HISN|v1|<nonce>).
  • In-memory load: embed Hisn.Runtime.dll as a resource and load it via AssemblyResolve.
  • Auto startup: patch <Module>..cctor to invoke Hisn.Runtime.Bootstrapper.Startup.
  • method trapping: replace method bodies with a safe throw to deter quick inspection.
  • Modular design: clear separation of packer, loader embedding, runtime, and crypto helpers.

Requirements

  • .NET Framework 4.7.2+
  • dnlib 3.6.0
  • Hisn.Runtime.dll available at protect-time (it is embedded as a resource)

Hisn will:

Build hisn.main.manifest + encrypted chunk resources hisn.main.cXX.

Embed Hisn.Runtime.dll as a resource (e.g., "RT").

Patch ..cctor to install the resolver and call Bootstrapper.Startup.


How it Works (at a glance)

ResourcePacker → creates the manifest and AES/HMAC chunks and embeds them as resources.

DllEmbedHooker → embeds Hisn.Runtime.dll and injects a call in ..cctor.

EmbeddedResolver → handles AppDomain.AssemblyResolve, loads the embedded runtime from memory, and calls Startup.

Hisn.Runtime → parses the manifest, verifies/decrypts chunks, assembles the payload, and loads/executes it from memory.


Production Tips (Customize)

Change secrets/keys (e.g., default MasterKey, "BuildSecret-CHANGE-ME").

Rename resource IDs (manifest/chunk prefixes, embedded DLL resource name).

Adjust startup: update startupType/startupMethod if your bootstrap signature differs.

Use Anti-Dump

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages