Giter Club home page Giter Club logo

altar.net's Introduction

Altar.NET

GameMaker: Studio data.win unpacker and decompiler (non-YYC, specifically made for Undertale), based on libaltar and Mirrawrs' data site (followed by my corrections/completions here and here).

Contains a lot of pointer-littered spaghetti code, because it's basically a continuation of libaltar, but in C#.

I'm not sure if this counts as 'redistribution of modified [libaltar] source', but including their notice just in case.

Building

You can build it from within Visual Studio (or MonoDevelop, or SharpDevelop, ...), or from the command-line:

[ms|x]build /m Altar.NET.sln /p:Configuration=[Debug|Release]

(NOTE: use msbuild on Windows, xbuild otherwise)
(NOTE: using the Debug configuration emits debug code, use Release for an optimized binary.)
(NOTE: the binary can be found at <repo-dir>/bin/<config>/altar.exe, it has all its dependencies merged into it. For a binary with separate DLLs for the dependencies, use the one in <repo-dir>/Altar.NET/bin/<config>/altar.exe.)

Usage

altar <verb>? [--help|-h]
altar [--version|-v]
altar <verb> <options...>

(NOTE: use ./altar if it is not added to your %PATH% yet, but resides in the current dir. Not applicable to CMD(but you shouldn't be using that).)
(NOTE: use mono altar.exe <args...> on mono (should be obvious).)

Verbs:

  • export: export parts from a data.win file. Options: -[gonsbpifjrmtacduvhekq]* --any --absolute --project --file --out --dumpunk --dumpempty --dumpall --quiet --noprecprog --detachedagrp --help
    • file: Path to the data.win or audiogroup<n>.dat file to export.
    • out: The output directory.
    • project: Emit a project file that can be recompiled by Altar.NET
    • gonsbpifjrmtacduvhekq: Select which parts of the data.win should be exported. Run altar export --help for more info.
    • absolute: Display absolute instruction offsets in decompiled/disassembled code, instead of relative to the first instruction.
    • dumpunk: Dump the raw contents of all chunks with unknown function.
    • dumpempty: Dump empty unknown chunks, too.
    • dumpall: Dump all (nonempty) raw chunks.
    • quiet: be completely silent (unless an error happens).
    • noprecprog: Don't report any exact details on the progress, but do output something. Makes things not break completely when cursor position isn't settable.
    • detachedagrp: Also dump the contents of an audiogroup<n>.dat file residing in the same directory as the data.win file.
    • help: ...
  • import: Recompile an Altar.NET project file to a data.win.
    • file: Path to the to project file.
    • out: The output data.win file.

API

To read a data.win file:

using Altar;
using Altar.Decomp; // for the Disassembler and Decompiler classes

// [...]

using (var f = GMFile.GetFile(path_to_file)) // NOTE: the file's content (as a byte array) can be passed instead
{
    // using 'f' should be straightforward enough with IntelliSense/...

    // disassemble code:
    Disassembler.DisplayInstructions(f, 0); // disassembles the code with ID=0
    // decompile code:
    Decompiler.DecompileCode(f, 0);
}

altar.net's People

Contributors

antymew avatar benjaminclot avatar impiaaa avatar porocyon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

altar.net's Issues

OutOfMemoryException when exporting large amount of sprite definitions

I'm trying to extract the sprite definitions for deltarune, and it stops at 106/1015 sprites with an unhandled OutOfMemoryException.

Here's the full log:

Warning: unknown chunk LANG is not empty, its content will not be exported!
Warning: unknown chunk EXTN is not empty, its content will not be exported!
Warning: unknown chunk GLOB is not empty, its content will not be exported!
Warning: unknown chunk SHDR is not empty, its content will not be exported!
Warning: unknown chunk TMLN is not empty, its content will not be exported!
Warning: unknown chunk DAFL is not empty, its content will not be exported!
Warning: unknown chunk EMBI is not empty, its content will not be exported!
Error reading ROOM #88 - skipping others.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at Altar.Unpack.SectionReader.ReadRoomObjInst(GMFileContent content, IntPtr p) in C:\Users\Marius\Documents\deltarune\Altar.NET\Altar.NET\Unpack\SectionReader.cs:line 161
   at Altar.Unpack.SectionReader.ReadList[T](GMFileContent content, CountOffsetsPair* list, Func`3 readThing) in C:\Users\Marius\Documents\deltarune\Altar.NET\Altar.NET\Unpack\SectionReader.cs:line 75
   at Altar.Unpack.SectionReader.GetRoomInfo(GMFileContent content, UInt32 id) in C:\Users\Marius\Documents\deltarune\Altar.NET\Altar.NET\Unpack\SectionReader.cs:line 585
   at Altar.GMFile.<>c__DisplayClass89_0.<.ctor>b__6(UInt32 i) in C:\Users\Marius\Documents\deltarune\Altar.NET\Altar.NET\GMFile.cs:line 231
   at Altar.GMFile.TryReadMany[T](SectionCountOffsets* hdr, Func`2 readOne) in C:\Users\Marius\Documents\deltarune\Altar.NET\Altar.NET\GMFile.cs:line 181
Exporting sprites... (106/1015)An error occured during export

Unhandled Exception: OutOfMemoryException.

Unknown issue when decompiling rooms.

Upon trying to decompile the rooms, I get thrown this error:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Altar.Unpack.Serialize.SerializeRoomTile(RoomTile tile, BackgroundInfo[] bgs)
at Altar.Unpack.Serialize.<>c__DisplayClass30_0.b__3(RoomTile t)
at Altar.Unpack.Serialize.SerializeArray[T,TRet](IEnumerable1 coll, Func2 converter)
at Altar.Unpack.Serialize.SerializeRoom(RoomInfo room, BackgroundInfo[] bgs, ObjectInfo[] objs)
at Altar.Program.Export(ExportOptions eo)
at Altar.Program.<>c.

b__9_0(String verb, Object vo)

Not exactly code savvy, so I have no clue what it means. Any help would be great!

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.