Skip to content
Jon Feldman edited this page Jun 13, 2016 · 8 revisions

Corbenik

Corbenik is (yet another) CFW for the 3DS. Unlike other CFWs, this was mostly written from scratch and for fun. I'm a control freak, and this carries quite a bit of my mindset being a LFS/Gentoo user.

Some parts are inherited from other CFWs - e.g. the firmware loading code in src/firm is mostly based on Cakes, and the patch bytecode is based on Luma3DS' implementation in C (though it isn't really derived from it.)

Out of the bunch of CFWs in existence, Corbenik is most similar to Cakes of the bunch, in that it uses external patches. External patches are headered, can have dependencies (NYI), and consist of a lightweight and specialized bytecode/assembly which is intended solely for efficient patching.

See Bytecode, host/bytecode_asm.py and patch/* for more on this. The assembler is a bit crappy at the moment, and I do plan to improve it. However, it outputs the correct code and gets the job done for now.

Rationale

I was initially going to make Cakes dynamic, but I quickly realized a fatal flaw in any "patch" format: what you can do from a patch is limited to what the parser handles. With Cakes, converting to a dynamic method isn't terribly difficult, but what about the patches that have a 'find, then seek backwards until' type of logic? Cakes would need have another construct to decribe that, and at that point, the .cake format has become a kludge and doing a VM's job by another name.

In my opinion, the best way to fix this was to externalize patches as programs - arm binaries or bytecode. The former didn't go so well (look back in the history of this repo. Fun times) and I ended up going with the latter.

I also had a number of mad science experiments which would be very hard to perform in the context of ReiNAND based firmwares, and Cakes wouldn't make it easy either due to its limited patch format. Therefore, this was created.

Comparison

If you want to know how Corbenik sizes up to other CFWs as of NOW - see Features. I don't intend to sugarcoat - Corbenik is under development and is incomplete. There will be no true stable release until a number of common features are implemented. Right now, all releases should be considered experimental.

However! It does have a few legs up on other CFWs, namely:

  • Bytecode patches.
  • Loader can both dump and replace code, as well as apply patches.
  • Pretty much every simple patch that Luma3DS has, and most every patch for loader.
    • All of the common bits aside from the exception vector hook, basically.
  • The CFW is a little slower to boot than Cakes, and loader takes negligibly longer to load stuff. I may be able to optimize more, but at this point it is fast enough to not impact people.

Feedback is welcome, but don't report anything obvious in nightlies. By obvious, I mean immediate and complete lockups in any setup, or crashes that occur 99% of the time. Otherwise, file a bug or complain to me on GBATemp (especially if you have an O3DS.)

For compilation instructions, see Building.

Unless otherwise noted - everything original in this repo can be used under the terms of the GNU GPLv3 or later. This includes situations where there's no copyright header within a source file. I get lazy with those; assume everything can be used under the GPLv3. No source files within this repo bear questionable licenses, I make sure when it is introduced.

Quote of the Day

Welcome to "The World."

Clone this wiki locally