From: chaoskagami Date: Tue, 17 May 2016 07:23:37 +0000 (-0400) Subject: Minor update to misc stuff X-Git-Tag: stable-1~69 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=2a659589d5c1b158c2c5cfd827c8c7896fd4e2b6;p=corbenik%2Fcorbenik.git Minor update to misc stuff --- diff --git a/README.md b/README.md index b0d0d32..e592470 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,18 @@ Corbenik ============================== -This is (yet another) CFW for the 3DS. Unlike other CFWs, this was mostly written from scratch for fun, and because I'm a control freak. Some parts are inherited from other CFW - near everything in src/firm is based on CakesFW, and the signature patch/firmprot/svcbackdoor fix are all based on Luma3DS while using the more correct CakesFW section code versus pointer math magic. +This is (yet another) CFW for the 3DS. Unlike other CFWs, this was mostly written from scratch and for fun - because I'm a control freak, and this carries quite a bit of OSDev and RE with it. -Eventually in operation, this will be most similar to mid-kid/CakesForeveryWan out of the bunch. That is, it will use external patches from the filesystem and is intended for developers and control freaks. Unlike cakes, patches will be dynamically loaded code for arm9/arm11 which will be relocated against internal functions, allowing relatively tiny patches. This is not stable yet, and does not work yet. +Some parts are inherited from other CFW - for example, the firmware loading code in src/firm is based on Cakes, and sigpatch/firmprot/svcbackdoor are all loosely based on Luma3DS while using more correct Cakes-style section code. -I was initially going to use a dynamic cake-like patch, 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. The best way to fix is to simply externalize patches; as yifan lu suggested even that loader should use a bytecode VM. +Eventually in operation, this will be most similar to Cakes out of the bunch. That is, it will use external patches from the filesystem and is intended for developers and control freaks. Unlike cakes, patches will be dynamically loaded binaries for arm9/arm11 which will be relocated against internal functions, allowing relatively tiny patches. This is not stable, and does not work yet. + +Rationale: I was initially going to make dynamic cakes, 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. The best way to fix is to simply externalize patches; e.g. even yifan lu suggested even that loader should use a bytecode VM. If you want to know how Corbenik sizes up to other CFWs as of NOW - see `doc/features.md`. If you want to see how it will hopefully size up once I'm finished with all the code see `doc/intended-comparison.md` For compilation instructions, see `doc/compiling.md`. -Unless otherwise noted, everything in this repo can be used under the terms of the GNU GPL, Version 3 or later (if ever) at your discretion. 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 GPL. +Unless otherwise noted, everything in this repo can be used under the terms of the GNU GPL, Version 3 or later (if ever) at your discretion. 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 GPL, or files were from GPLv2 or later (and thus are upgraded.) -Technically, all patches must be open source under a compatible license as well due to these linking restrictions. I will not be making the linking exception. Allowing proprietary patches to exist will only harm everyone in the homebrew community in long-term. Read: NTR. +This repo is named after a certain "factor". DATA DRAAAAIN! diff --git a/copy.sh b/copy.sh index 7e26056..2872f61 100644 --- a/copy.sh +++ b/copy.sh @@ -1,7 +1,8 @@ #!/bin/bash mount /dev/sdb1 /media/cd || exit 0 -cp out/arm9loaderhax.bin /media/cd/anim/boot/a.bin || exit 0 +cp out/arm9loaderhax.bin /media/cd/anim/boot/none.bin || exit 0 cp out/arm9loaderhax.bin /media/cd/anim/boot/r.bin || exit 0 +cp out/arm9loaderhax.bin /media/cd/anim/boot/l.bin || exit 0 cp -r out/corbenik /media/cd/ || exit 0 umount /media/cd || exit 0 eject /dev/sdb || exit 0 diff --git a/doc/features.md b/doc/features.md index 1ef4779..1871f97 100644 --- a/doc/features.md +++ b/doc/features.md @@ -10,7 +10,7 @@ Feature graph +--------+-----------------+-----------------+------------------------------+-----------+---------------+-------------------+-------+ |ReiNAND |Meme(SD) |Builtin, Dynamic |Sig,Emu,Sys,Mod,Ptc |N/A |Readability |Minimalist | [4] | +--------+-----------------+-----------------+------------------------------+-----------+---------------+-------------------+-------+ -|Corbenik|Dec/Enc (SD) |Builtin, Dynamic |Sig,Ptc,Sys |N/A |Read/Speed |Advanced Devs | [5] | +|Corbenik|Dec/Enc (SD) |Builtin, Dynamic |Sig,Ptc,Sys,Svc |N/A |Read/Speed |Advanced Devs | [5] | +--------+-----------------+-----------------+------------------------------+-----------+---------------+-------------------+-------+ |NTR |N/A |Executable |Mis |Mis |Douchebaggery |Shilling Closed Src| [6] | +--------+-----------------+-----------------+------------------------------+-----------+---------------+-------------------+-------+ @@ -41,10 +41,13 @@ Misc features by CFW: * svcBackdoor (incomplete) * Luma * Loader replacement. CPU speed/language emulation + * Corbenik + * Arbitrary service injection to empty slots. + Similar results can be achieved in cakes, but with much pain. [1] I'm not just referring to speed; I'm referring to purpose-based optimization. For example; do you want something well documented? Would you choose a slower algorithm that can be more - easily debugged at the expense of speed? Would you use preprocessor macros to use multiple? + easily debugged at the expense of speed? Would you use preprocessor macros to use different implementations? CakesFW is Speed/Read. Speed first, keep readability if possible whenever possible. Which is a good approach. diff --git a/doc/nonos.md b/doc/nonos.md index ba3d6bc..4b0ec25 100644 --- a/doc/nonos.md +++ b/doc/nonos.md @@ -7,17 +7,26 @@ This is a ReiNAND only thing; get over it. * Loading firmware from sysnand. -IMHO, this is a bad idea for many reasons. +IMHO, this is a bad idea for many reasons. It sounds great in theory; it isn't in any way a good idea. -Corbenik is for people who know what they're doing first and foremost, so if getting a firmware is too hard, you're not the intended audience. Please use another CFW. +This is for people who know what they're doing first and foremost, so if getting a firmware is too hard, you're not the intended audience. Please use another CFW like Luma3DS. +I don't see this as a feature unless it's opt-in rather than opt-out or mandatory. If you're concerned about SD clutter; it's one folder, and everything IN THAT FOLDER IS IN FOLDERS. This is practically windows levels of organization, I don't think I can get more tidy. + + * Gateway launcher dat + +Screw off. Need I explain why? Do it yourself. It's never getting merged to master; it's against the very goal of CFW - to eliminate the need for flashcarts. + + * 3dsx + +Get a9lh. Seriously. You might be able to use Brahma, but hell if I know. a9lh is the only supported method of running this. Not bugs ========= * CETK decryption -No, I can't fix this on a9lh. Here's how to do it; boot another CFW, go into system settings, then boot corbenik. You'll get the keys you need. This works with Cakes as well. +No, I can't fix this on a9lh. Here's how to do it; boot another CFW, go into system settings, then boot corbenik. You'll get the keys you need. This works with Cakes as well. After this, you'll never need a key again. Another thing to know is only NATIVE_FIRM is required to boot, so you can boot Corbenik without AGB and TWL suceeding, reboot from settings and they'll decrypt. diff --git a/source/menu.c b/source/menu.c index 4336e2e..ef49c21 100644 --- a/source/menu.c +++ b/source/menu.c @@ -1,6 +1,6 @@ #include "common.h" #include "firm/firm.h" - +#include "firm/headers.h" #define MENU_BOOTME -1 #define MENU_MAIN 1 @@ -10,28 +10,11 @@ #define MENU_HELP 5 #define MENU_RESET 6 #define MENU_POWER 7 -#define MENU_DUMPBOOT 8 static int cursor_y = 0; static int which_menu = 1; static int need_redraw = 1; -int menu_dumpboot() { - // No, we can't dump the whole bootrom. - // I'm still curious what's in the readable half. - - FILE *output9; - if(!(output9 = fopen("/bootrom9_low.bin", "w"))) - abort("Failed to open file for write?\n"); - - fwrite((uint8_t*)0xffff0000, 1, 0x8000, output9); - fclose(output9); - - fprintf(stderr, "Dumped 0x8000 bytes at 0xffff0000\n"); - - return MENU_MAIN; -} - uint32_t wait_key() { uint32_t get = 0; while(get == 0) { @@ -129,7 +112,37 @@ int menu_options() { return 0; } -int menu_info() { return MENU_MAIN; } +int menu_info() { + clear_screen(TOP_SCREEN); + + set_cursor(TOP_SCREEN, 0, 0); + + header(); + struct firm_signature *native = get_firm_info(firm_loc); + struct firm_signature *agb = get_firm_info(agb_firm_loc); + struct firm_signature *twl = get_firm_info(twl_firm_loc); + + fprintf(stdout, "\nNATIVE_FIRM / Firmware:\n" + " Version: %s (%x)\n" + "AGB_FIRM / GBA Firmware:\n" + " Version: %s (%x)\n" + "TWL_FIRM / DSi Firmware:\n" + " Version: %s (%x)\n" + "\n" + "[Press any key]\n", + native->version_string, native->version, + agb->version_string, agb->version, + twl->version_string, twl->version); + while (1) { + if (wait_key() & BUTTON_ANY) + break; + } + + need_redraw = 1; + clear_screen(TOP_SCREEN); + + return MENU_MAIN; +} int menu_help() { clear_screen(TOP_SCREEN); @@ -138,23 +151,18 @@ int menu_help() { header(); - fprintf(stdout, "\nCorbenik is a 3DS firmware patcher\n" + fprintf(stdout, "\nCorbenik is a 3DS firmware patching tool;\n" " commonly known as a CFW. It seeks to address\n" " some faults in other CFWs and is generally\n" " just another choice for users - but primarily\n" - " the kind of person who runs Gentoo or LFS. ;P\n" + " is intended for developers.\n" "\n" "Credits to people who've helped me put this\n" - " together either by having written GPL code,\n" - " or being just generally helpful/cool people:\n" + " together either by code or helpfulness:\n" " @mid-kid, @Wolfvak, @Reisyukaku, @AuroraWright\n" " @d0k3, and others\n" "\n" - "The name of this comes from the .hack//series.\n" - " Look it up, if you don't already know it.\n" - "\n" - "Any bugs filed including the letters S, A\n" - " and O will be closed with no discussion.\n" + "[PROTECT BREAK] DATA DRAIN: OK\n" "\n" " \n" "\n"); @@ -198,10 +206,9 @@ int menu_main() { "Help/Readme", "Reset", "Power off", - "Dump partial arm9 bootrom", "Boot firmware" }; - int menu_max = 8; + int menu_max = 7; header(); @@ -239,7 +246,7 @@ int menu_main() { case BUTTON_A: need_redraw = 1; cursor_y = 0; - if (ret == 9) + if (ret == menu_max + 2) return MENU_BOOTME; // Boot meh, damnit! return ret; } @@ -271,9 +278,6 @@ int menu_handler() { case MENU_HELP: to_menu = menu_help(); break; - case MENU_DUMPBOOT: - to_menu = menu_dumpboot(); - break; case MENU_BOOTME: return 0; case MENU_RESET: