Hacking Official Corbenik - Another CFW for advanced users (with bytecode patches!)

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,248
Country
United States
Why not store the locale database in a file like sqlite or json?

Or there's not enough room to put code to parse sqlite or json?

A) sqlite is absolute shit
B) Json requires a parser (which has more overhead than a text file)
C) Both require importing libraries which need malloc, which is a pain because loader has no heap afaik
D) Both options have more overhead than a single plaintext file

I've started testing out skeith and have to say, there's several details I love. I love the "dim background" option. It really opened the door to tons of new themes!
So I made my own!
View attachment 54932

( ͡° ͜ʖ ͡°)

Dimming is still pretty buggy though. If you have an image of almost entirely dark colors with one white spot, it does odd things with it.
 
  • Like
Reactions: uyjulian

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
53
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,835
Country
Belgium
I know it's not important :P
Last commit that i build myself that works is "d30cf68"
Every other new commit i build since then gives me black screens (not even config gets loaded, so no log files)
(even renaming the corbenik folder to skeith, doesn't work)

When building latest commit and compare it with your skeith build, arm9loaderhax diff in size.

corbenik.png

No build errors, only 1 build warning, but that warning i also got before and with commit "d30cf68"
and that always worked fine.

Code:
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-e
abi/bin/ld.exe: warning: c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3
.0\libgcc.a(_bswapsi2.o) uses 4-byte wchar_t yet the output is to use 2-byte wch
ar_t; use of wchar_t values across objects may fail
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-e
abi/bin/ld.exe: warning: c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3
.0\libgcc.a(_udivmoddi4.o) uses 4-byte wchar_t yet the output is to use 2-byte w
char_t; use of wchar_t values across objects may fail
arm-none-eabi-objcopy  -S -O binary build/main.elf build/main.bin
`build/main.bin' -> `out/arm9loaderhax.bin'
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,248
Country
United States
I know it's not important :P
Last commit that i build myself that works is "d30cf68"
Every other new commit i build since then gives me black screens (not even config gets loaded, so no log files)
(even renaming the corbenik folder to skeith, doesn't work)

When building latest commit and compare it with your skeith build, arm9loaderhax diff in size.

corbenik.png

No build errors, only 1 build warning, but that warning i also got before and with commit "d30cf68"
and that always worked fine.

Code:
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-e
abi/bin/ld.exe: warning: c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3
.0\libgcc.a(_bswapsi2.o) uses 4-byte wchar_t yet the output is to use 2-byte wch
ar_t; use of wchar_t values across objects may fail
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-e
abi/bin/ld.exe: warning: c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3
.0\libgcc.a(_udivmoddi4.o) uses 4-byte wchar_t yet the output is to use 2-byte w
char_t; use of wchar_t values across objects may fail
arm-none-eabi-objcopy  -S -O binary build/main.elf build/main.bin
`build/main.bin' -> `out/arm9loaderhax.bin'

First of all, can't reproduce that. Building here works. I always clean install. I have no clue why everything after that commit would break, since the commit 8c1ae228 changes nothing unless you're overriding arguments in a way you shouldn't.

To be clear, when you build it yourself WITHOUT any arguments, it defaults to corbenik, not skeith. If you're building it yourself - you get a build with the path /corbenik. If you're renaming it, no shit it doesn't work. It won't be able to load the font or screeninit code, and arm9loaderhax.bin is mostly non-screeninit now (so black screen.) Notably, I'm pretty sure there's issues with the commit you're building off, as well. I'll look into it, but I can't reproduce this. Can you provide the file `build/main.elf` after building it from the latest commit?

Link warning is irrelevant. We're not using any libgcc functions involving wchar_t. It's just complaining because I'm forcing -fshort-wchar (the 3DS default.) Size is also irrelevant. Code is never generated the same depending on a number of factors, so that isn't a good comparison.
 

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
53
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,835
Country
Belgium
I always wipe the previous git cloned folder, So it's always a clean build and the argument i use is just "make release"
(So how to build with skeith output folder instead of corbenik?)

main.elf from latest git i cloned and build included (just remove.txt)

[EDIT]
Just a thumbs up
Getting the key files from native/twl/agb, worked perfect like you described in the readme.md with Decrypt9WIP (switched today to corbenik on my N3DSXL)
You'll need the firmkey for it as well unless you have decrypted your firmware, and it should be placed at/corbenik/keys/native.key. I can't tell you where to get it obviously, but there are a few ways to get valid firmware with/without a firmkey and not involving a download from a questionable place:

  • Decrypt the CETK using D9 and extract the firmkey using D9's scripts
  • Extract the encTitleKey using D9's scripts, and have D9 convert it
  • Decrypt the firmware with D9 directly
  • Boot another CFW, then reboot into Corbenik with a cetk for native at /corbenik/keys/native.cetk
You can also fetch the agb firm and twl firms to /corbenik/firmware/agb and /corbenik/firmware/twl respectively. If you don't have the firmkeys for these, you can fetch the cetk for each of them to /corbenik/keys/agb.cetk and/corbenik/keys/twl.cetk. Boot up the system, go to system settings, and it will extract the firm keys for them after rebooting.
 

Attachments

  • main.elf.txt
    186.4 KB · Views: 151
Last edited by DjoeN,
  • Like
Reactions: chaoskagami

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,248
Country
United States
...What the hell? This is classic Windows screwiness here. Let me give you an exerpt of what it's looking for at runtime on the 3DS (wtf):

Code:
c:/devkitPro/msys/corbenik/keys/twl.cetk
c:/devkitPro/msys/corbenik/keys/twl.key
c:/devkitPro/msys/corbenik/firmware/twl
c:/devkitPro/msys/corbenik/keys/agb.cetk
c:/devkitPro/msys/corbenik/keys/agb.key
c:/devkitPro/msys/corbenik/firmware/agb
c:/devkitPro/msys/corbenik/cache/p_native
c:/devkitPro/msys/corbenik/cache/p_twl
c:/devkitPro/msys/corbenik/cache/p_agb
c:/devkitPro/msys/corbenik/cache/loader/0000000000000000
c:/devkitPro/msys/corbenik/cache/loader/BOOT
c:/devkitPro/msys/corbenik/bits/top.bin
c:/devkitPro/msys/corbenik/bits/bottom.bin
c:/devkitPro/msys/corbenik/bits/termfont.bin
c:/devkitPro/msys/corbenik/bits/emunand.bin
c:/devkitPro/msys/corbenik/module/loader.cxi
c:/devkitPro/msys/corbenik/bits/reboot_hook.bin
c:/devkitPro/msys/corbenik/bits/reboot_code.bin
c:/devkitPro/msys/corbenik/bits/backdoor.bin
c:/devkitPro/msys/corbenik/bits/screeninit.bin
c:/devkitPro/msys/corbenik/boot.log
c:/devkitPro/msys/corbenik/cache/screenshot.ppm

I don't even know why this is occuring unless a variable I'm using is overlapping with msys and getting overriden.

EDIT: Can you paste the output of the 'env' command in a msys terminal?
 
Last edited by chaoskagami,

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
53
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,835
Country
Belgium
...What the hell? This is classic Windows screwiness here. Let me give you an exerpt of what it's looking for at runtime on the 3DS (wtf):

Code:
c:/devkitPro/msys/corbenik/keys/twl.cetk
c:/devkitPro/msys/corbenik/keys/twl.key
c:/devkitPro/msys/corbenik/firmware/twl
c:/devkitPro/msys/corbenik/keys/agb.cetk
c:/devkitPro/msys/corbenik/keys/agb.key
c:/devkitPro/msys/corbenik/firmware/agb
c:/devkitPro/msys/corbenik/cache/p_native
c:/devkitPro/msys/corbenik/cache/p_twl
c:/devkitPro/msys/corbenik/cache/p_agb
c:/devkitPro/msys/corbenik/cache/loader/0000000000000000
c:/devkitPro/msys/corbenik/cache/loader/BOOT
c:/devkitPro/msys/corbenik/bits/top.bin
c:/devkitPro/msys/corbenik/bits/bottom.bin
c:/devkitPro/msys/corbenik/bits/termfont.bin
c:/devkitPro/msys/corbenik/bits/emunand.bin
c:/devkitPro/msys/corbenik/module/loader.cxi
c:/devkitPro/msys/corbenik/bits/reboot_hook.bin
c:/devkitPro/msys/corbenik/bits/reboot_code.bin
c:/devkitPro/msys/corbenik/bits/backdoor.bin
c:/devkitPro/msys/corbenik/bits/screeninit.bin
c:/devkitPro/msys/corbenik/boot.log
c:/devkitPro/msys/corbenik/cache/screenshot.ppm

I don't even know why this is occuring unless a variable I'm using is overlapping with msys and getting overriden.

EDIT: Can you paste the output of the 'env' command in a msys terminal?

output included.
 

Attachments

  • env.txt
    2.6 KB · Views: 180
Last edited by DjoeN,

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
0
XP
865
Country
United States
Well, I happen to be in the US where we have a psycho crazy bastard (pardon my french) running for president and breaking DMCA will land you in jail longer than theft.

So, point stands, really.



I'm not sure why I wasn't doing so in the first place, sorry. The other folders really should be using proper paths in the makefile.



Some scene standards are crap, and I'm not afraid to try flipping them on their head for experimentation. I also hate root path clutter.

No real reason for the rename aside from not using file extensions here, I guess. It's not like the 3DS uses FAT16 where it would actually be an issue. It'd probably be better to just read the D9 keydb.

--------------------- MERGED ---------------------------



Contrib is solely for bytecode patches. That would go in external. Also, I'm not sure chainloading should be a part of corbenik, but if enough people ask, I'll make it a compile-time thing to enable/disable. I have a chainloader already written that isn't terribly hard to repurpose.

No need to worry about the psycho crazy bastard. Bernie is out. Now if the FBI would just indict Hillary so she'd be out too. The last thing you want is Bill Clinton (the crazy bastard who signed the DMCA in the first place) getting a third term courtesy of his equally insane wife.
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,248
Country
United States
No need to worry about the psycho crazy bastard. Bernie is out. Now if the FBI would just indict Hillary so she'd be out too. The last thing you want is Bill Clinton (the crazy bastard who signed the DMCA in the first place) getting a third term courtesy of his equally insane wife.

You can get out of my thread now.

Reasons:
A) This is a CFW topic, not a political debate
B) "Psycho crazy bastard" was not aimed at Bernie.
 

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
0
XP
865
Country
United States
You can get out of my thread now.

Reasons:
A) This is a CFW topic, not a political debate
B) "Psycho crazy bastard" was not aimed at Bernie.

How was I to know you're a liberal? Your statements made you seem anti-DMCA, thus, libertarian. You brought up how bad the DMCA is, not me. I was trying to be agreeable. After all, if you hate the DMCA, then the last thing you should want is the person who signed it back in the White House. Either way, just contributing my $0.02 worth to that discussion. If you didn't want it being discussed, why open that can of worms in the first place? I guess we just have to agree to disagree on which evil is the lesser one. It's extremely unlikely either will prevent Civil War II anyway, so it's really not worth fighting over. I'll try to keep my comments focused on your CFW from now on, just as long as you'll do the same.
 
Last edited by Kazuma77,

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,001
Trophies
2
Age
24
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
5,673
Country
Portugal
I am downgrade my 2ds and install luma 3ds. "intended for noobs (no offense intended)" not offend.
Honestly, downgrading etc. is straightforward enough for a noob.


This, on the other hand - is the CFW where you get COMPLETE control over the settings - it doesn't protect you from yourself.


If you can't figure out how to install it, DO NOT DO IT. Seriously.

Luma, on the other hand, is distributed as THE noob-proof CFW.
 
  • Like
Reactions: chaoskagami

Temptress Cerise

Miss Magic~ <3
Member
Joined
May 1, 2016
Messages
2,240
Trophies
1
XP
2,162
Country
United States
I am downgrade my 2ds and install luma 3ds. "intended for noobs (no offense intended)" not offend.
Stick with Luma3DS. I am not even sure why you are asking about this, as this clearly says "Corbenik - Another CFW for advanced users" - If you also read the first post, you'd know this isn't a CFW you easily set up, especially if you are completely new to the 3DS. Look into it once you've learned your way around a 3DS, and even then, this probably isn't for you if you didn't bother to read the README.

Also, sorry if I came off as rude, that was not my intention.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: Hope they made lots of spaget