项目作者: SceneGate

项目描述 :
NDS game file formats
高级语言: C#
项目地址: git://github.com/SceneGate/Ekona.git
创建时间: 2018-12-08T01:17:53Z
项目社区:https://github.com/SceneGate/Ekona

开源协议:MIT License

下载


Ekona



Stable version



GitHub commits since latest release (by SemVer)



Build and release



MIT License


Ekona is a library part of the SceneGate
framework that provides support for DS and DSi file formats.

Supported formats

  • :video_game: DS cartridge:
    • :file_folder: Filesystem: read and write
    • :information_source: Header: read and write, including extended header
    • :framed_picture: Banner and icon: read and write.
    • :closed_lock_with_key: ARM9 secure area encryption and decryption (KEY1).
  • :video_game: DSi cartridge:
    • :file_folder: Filesystem: read and write arm9i and arm7i programs.
    • :information_source: Extended header: read and write
    • :framed_picture: Animated banner icons
    • :closed_lock_with_key: Modcrypt encryption and decryption
    • :lock_with_ink_pen: HMAC validation and generation when keys are provided.
    • :lock_with_ink_pen: Signature validation when keys are provided.

Getting started

Check-out the
getting started guide
to start using Ekona in no time! Below you can find an example that shows how
to open a DS/DSi ROM file (cartridge dump).

  1. // Create Yarhl node from a file (binary format).
  2. Node game = NodeFactory.FromFile("game.nds", FileOpenMode.Read);
  3. // Use the `Binary2NitroRom` converter to convert the binary format
  4. // into node containers (virtual file system tree with files and directories).
  5. game.TransformWith<Binary2NitroRom>();
  6. // And it's done!
  7. // Now we can access to every game file. For instance, we can export one file
  8. Node items = Navigator.SearchNode(game, "data/Items.dat");
  9. items.Stream.WriteTo("dump/Items.dat");

Usage

The project provides the following .NET libraries (NuGet packages in nuget.org).
The libraries works on supported versions of .NET: 6.0 and 8.0.

  • SceneGate.Ekona
    • SceneGate.Ekona.Containers.Rom: DS and DSi cartridge (ROM) format.
    • SceneGate.Ekona.Security: hash and encryption algorithms

Preview releases can be found in this
Azure DevOps package repository.
To use a preview release, create a file nuget.config in the same directory of
your solution file (.sln) with the following content:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <configuration>
  3. <packageSources>
  4. <clear></clear>
  5. <add key="nuget.org" value="https://api.nuget.org/v3/index.json" ></add>
  6. <add key="SceneGate-Preview" value="https://pkgs.dev.azure.com/SceneGate/SceneGate/_packaging/SceneGate-Preview/nuget/v3/index.json" ></add>
  7. </packageSources>
  8. <packageSourceMapping>
  9. <packageSource key="nuget.org">
  10. <package pattern="*" ></package>
  11. </packageSource>
  12. <packageSource key="SceneGate-Preview">
  13. <package pattern="Yarhl*" ></package>
  14. <package pattern="Texim*" ></package>
  15. <package pattern="SceneGate*" ></package>
  16. </packageSource>
  17. </packageSourceMapping>
  18. </configuration>

Documentation

You can get full details about how to use library from the
documentation
website.

Don’t miss the
formats specifications
in case you need to do further research.

And don’t hesitate to ask questions in the
project Discussion site!

Build

The project requires to build .NET 8.0 SDK.

To build, test and generate artifacts run:

  1. # Build and run tests
  2. dotnet run --project build/orchestrator
  3. # (Optional) Create bundles (nuget, zips, docs)
  4. dotnet run --project build/orchestrator -- --target=Bundle

To build the documentation only, run:

  1. dotnet docfx docs/docfx.json --serve

To run the performance test with memory and CPU traces:

  1. dotnet run --project src/Ekona.PerformanceTests/ -c Release -- -f "*<TestName>*" -m -p EP --maxWidth 60

Special thanks

The DS / DSi cartridge format was based on the amazing reverse engineering work
of Martin Korth at GBATek. Its
specifications of the hardware of the video controller and I/O ports was also a
great help in additional reverse engineering.