Coder Social home page Coder Social logo

xnblib's Introduction

XNBLib

XNBLib is the library behind XNBE, my XNB decompiler. It allows easy asset decompilation for all the formats that both XNA amd MonoGame support.

Supported Formats

  • Images (output as PNG)
  • Audio (output as WAV)
  • SpriteFontTexture (output as PNG)

More planned!

Usage

  1. Import the library into your project.
  2. Instantiate the Exporter class.
  3. Pass a string array of paths to XNB files into ExportFile().
  4. (Optional) Also pass in a string that points to an output folder.
  5. (Optional) Subscribe to the OnStatusUpdate event to get console output as a string.
  6. (Optional) Subscribe to the OnCompleted event to do something when XNBLib has finished.
  7. Run() the Exporter and wait for the files to decompile!

Examples

1

var exporter = new Exporter(new [] { "C:\\path\\to\\file.xnb" });
exporter.Run();

After this, your decompiled files will be placed in the same folder as their XNB counterparts.

2

var exporter = new Exporter(new [] { "C:\\path\\to\\file.xnb" }, "C:\\output");
exporter.OnStatusUpdate += Exporter_OnStatusUpdate;
exporter.Run();

...

void Exporter_OnStatusUpdate(string status)
{
    Console.WriteLine("[XNBLib] " + status);
	// You can also leave this method blank to mute any console output.
}

After this, your decompiled files will be placed in C:/output and [XNBLib] will be appended to the start of any console output.

Live Example

XNBExporter is a console application I developed to showcase XNBLib. Check it out here!

Acknowledgments

  • gameking008 - For the WAVE exporter.
  • Dcrew - For increasing efficiency, fixing bugs, and adding SpriteFontTexture support.

xnblib's People

Contributors

pyroglyph avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.