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

chronoss

Well-Known Member
Member
Joined
May 26, 2015
Messages
3,010
Trophies
1
XP
4,913
Country
Congo, Republic of the
This CFW is pretty good and good luck for his creator :)

387087.jpg
vs
392206.jpg
 
  • Like
Reactions: laharl22

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
I have those too, but I play other gba games (ffvi) from time to time :P

I've been too busy coding to inject Mother 3 and some others like MMBN1-6. I actually own M3 for that matter. Box, manual and all. I'm getting off topic here, though. :P

Also, I'm porting reboot at the moment from Cakes' patch. GNU as doesn't play so well with some armips-isms.
 
  • Like
Reactions: Wolfvak

fuyukaidesu

Well-Known Member
Newcomer
Joined
Mar 2, 2015
Messages
51
Trophies
0
Age
123
XP
782
Country
France
Is there a reason for the 512 bytes size limit for patches?
Also why use bytecode, instead of compiling C patches. Can't the loader module mark pages as executable?
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
Is there a reason for the 512 bytes size limit for patches?
Also why use bytecode, instead of compiling C patches. Can't the loader module mark pages as executable?

The 512 size limit is because I was too lazy to use svcControlMemory while testing. It's temporary. It also only applies to loader, not the arm9loaderhax patcher.

There's a few reasons for not using C code, namely:
* It requires a linker to resolve symbols, and GCC doesn't like pc-relative code without relocations. I also can't guarantee it will always be at the same offset in loader.
* ARM11 and ARM9 would need different code, because while they share a lot in common, mixing isn't a good idea.
* Bytecode can be more compact than compiled C code.
* C code can do many more nasty/bad things than bytecode can, so it also doubles as a sandbox.
* It's easier to debug a failed patch.
 
Last edited by chaoskagami,

doggomando

Member
Newcomer
Joined
Mar 20, 2016
Messages
23
Trophies
0
Age
26
XP
86
Country
Canada
Just to be clear, native_firm, twl_firm, and agb_firm have different keys, and the keys are different between o3ds and n3ds. The keys for twl_firm and agb_firm should be named twl.key and agb.key, respectively.



That's cool. Well, I guess given cygwin you can probably build then.



What patches did you enable, what firmware are you using as native, what system software is on your sysnand, etc? You can just kill the power if it crashes like that, btw. It won't hurt anything.

Also, please upload loader.log if you have it in the folder.

(Corbenik is a little slower to boot than other CFWs, too.)
native_firm is 9.6.0 and my sysnand is 11.0
I don't have that file btw.
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
native_firm is 9.6.0 and my sysnand is 11.0
I don't have that file btw.

With the newest release, do you have boot.log? What patches did you enable? 9.6.0 is pretty old - as in, I haven't tested it at all.
 

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,043
Trophies
2
Age
25
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
6,014
Country
Portugal
Updater (test version, might not work properly).

Instead of deleting the cobernik directory and payload, it renames it using time and date. This will probably be changed in the future.

This *should* allow for different payloads to be used (if your payload is not /arm9loaderhax.bin).
Just write the path in a file named "cobernik-updater.cfg" and place it on the root of the SD Card (ex. "/somefolder/mypayload.bin")

BTW It's a 3DSX, I may make a CIA of it once I'm happy with it overall.
 

Attachments

  • corbenikupdater.zip
    708.8 KB · Views: 92

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
Updater (test version, might not work properly).

Instead of deleting the cobernik directory and payload, it renames it using time and date. This will probably be changed in the future.

This *should* allow for different payloads to be used (if your payload is not /arm9loaderhax.bin).
Just write the path in a file named "cobernik-updater.cfg" and place it on the root of the SD Card (ex. "/somefolder/mypayload.bin")

BTW It's a 3DSX, I may make a CIA of it once I'm happy with it overall.

FYI, your lua code is wrong for the very reason that you chose not to unpack in place. You're not copying the firmware and keys to the new directory, so this will abort next boot. Context:

Code:
    debugWrite(0,100,"Extracting to path...", white, TOP_SCREEN)
    if updated == 0 then
        System.extractZIP(downloadedzip,appinstallpath)
    end
    -- You should be copying  /corbenik/firmware and /corbenik/keys here.
    debugWrite(0,120,"DONE! Press A/B to exit!", green, TOP_SCREEN)
 

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,043
Trophies
2
Age
25
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
6,014
Country
Portugal
FYI, your lua code is wrong for the very reason that you chose not to unpack in place. You're not copying the firmware and keys to the new directory, so this will abort next boot. Context:

Code:
    debugWrite(0,100,"Extracting to path...", white, TOP_SCREEN)
    if updated == 0 then
        System.extractZIP(downloadedzip,appinstallpath)
    end
    -- You should be copying  /corbenik/firmware and /corbenik/keys here.
    debugWrite(0,120,"DONE! Press A/B to exit!", green, TOP_SCREEN)
Right, thanks, forgot about that.
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
Right, thanks, forgot about that.

No prob. I just don't want people complaining to me if an autoupdater broke the install or anything. :P

EDIT: I think maybe next release I'll start adding sha256sums for sanity purposes on github.

Any specific reason, btw, that you don't just 302 to github raw on your server?

I may code my own updater eventually if rehosting starts being a problem. It isn't all that hard to do, and I don't even need a web server (just github would do the job. ;P)
 
Last edited by chaoskagami,
  • Like
Reactions: gnmmarechal

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,043
Trophies
2
Age
25
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
6,014
Country
Portugal
No prob. I just don't want people complaining to me if an autoupdater broke the install or anything. :P

EDIT: I think maybe next release I'll start adding sha256sums for sanity purposes on github.

Any specific reason, btw, that you don't just 302 to github raw on your server?

I may code my own updater eventually if rehosting starts being a problem. It isn't all that hard to do, and I don't even need a web server (just github would do the job. ;P)
Ok, it should do the job now.
I only rehosted it because afaik, github doesn't have static direct links to the file. Am I wrong?

https://github.com/gnmmarechal/corbenik-updater/blob/master/index.lua

On my EasyRPG 3DS Updater: RE, I used to host everything myself, but then EasyRPG was added to the official Jenkins, which has static direct links. So now, I don't host the file myself.
 
Last edited by gnmmarechal,

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
Ok, it should do the job now.
I only rehosted it because afaik, github doesn't have static direct links to the file. Am I wrong?

https://github.com/gnmmarechal/corbenik-updater/blob/master/index.lua

That depends on whether LP+ supports 302 redirects. If yes, then you can download releases directly using https://github.com/chaoskagami/corbenik/releases/download/v0.0.5/release.zip URLs with the version changed obviously. These redirect to S3 storage. This goes for any project on github, as well.
 

gnmmarechal

Well-Known Member
Member
GBAtemp Patron
Joined
Jul 13, 2014
Messages
6,043
Trophies
2
Age
25
Location
https://gs2012.xyz
Website
gs2012.xyz
XP
6,014
Country
Portugal

Wolfvak

nyaa~
Member
Joined
Oct 25, 2015
Messages
918
Trophies
1
XP
3,486
Country
Uruguay

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
It doesn't. It barely supports HTTPS if you use a self compiled build (which I've tried and concluded as "impossible")

Ahahaha. Figured. LP+ is impossible to compile. Plus, its' licensing is technically illegal to to the inclusion of unrar (but that's another problem.)

Here's a wget log, by the way. Release URLs do a 302.

Code:
wget https://github.com/chaoskagami/corbenik/releases/download/v0.0.5/release.zip >log 2>&1

--2016-06-06 18:16:25--  https://github.com/chaoskagami/corbenik/releases/download/v0.0.5/release.zip
Resolving github.com... 192.30.252.123
Connecting to github.com|192.30.252.123|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-cloud.s3.amazonaws.com/releases/60402672/fa144114-2bce-11e6-9a92-99091a836c13.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160606%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160606T221506Z&X-Amz-Expires=300&X-Amz-Signature=71df18de60454b80f4fb29fadd87054e7b13450e65f89608a0184593b52ac249&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Drelease.zip&response-content-type=application%2Foctet-stream [following]
--2016-06-06 18:16:27--  https://github-cloud.s3.amazonaws.com/releases/60402672/fa144114-2bce-11e6-9a92-99091a836c13.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160606%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160606T221506Z&X-Amz-Expires=300&X-Amz-Signature=71df18de60454b80f4fb29fadd87054e7b13450e65f89608a0184593b52ac249&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Drelease.zip&response-content-type=application%2Foctet-stream
Resolving github-cloud.s3.amazonaws.com... 54.231.66.81
Connecting to github-cloud.s3.amazonaws.com|54.231.66.81|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 325291 (318K) [application/octet-stream]
Saving to: ‘release.zip’

     0K .......... .......... .......... .......... .......... 15% 44.6K 6s
    50K .......... .......... .......... .......... .......... 31%  173K 3s
   100K .......... .......... .......... .......... .......... 47%  189K 2s
   150K .......... .......... .......... .......... .......... 62% 1.45M 1s
   200K .......... .......... .......... .......... .......... 78%  209K 1s
   250K .......... .......... .......... .......... .......... 94%  922K 0s
   300K .......... .......                                    100% 5.73M=2.0s

2016-06-06 18:16:30 (159 KB/s) - ‘release.zip’ saved [325291/325291]
 

GBHAKC75

Well-Known Member
Member
Joined
Jan 26, 2008
Messages
406
Trophies
0
XP
563
Country
France
First if all, thanks a lot for your work, it's great !

Few questions : any plans to bring N3DS CPU OC patches ? Also, do you plan to use the keys from d0k3 homebrews such as Decrypt9 ? That would be nice to have one "standard" to avoid duplicating keys everywhere.
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
OP
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
First if all, thanks a lot for your work, it's great !

Few questions : any plans to bring N3DS CPU OC patches ? Also, do you plan to use the keys from d0k3 homebrews such as Decrypt9 ? That would be nice to have one "standard" to avoid duplicating keys everywhere.

It already can override CPU globally, but granular isn't really working. It's on the table, though. This also isn't done from a patch at the moment since it involves configuration.

As for the keydb of D9: I can see about loading Slot0x11Key96 from it. As for the FIRM keys, last I checked those aren't part of D9's DB.
 
Last edited by chaoskagami,
  • Like
Reactions: GBHAKC75

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtu.be/my3HxcHln3s?si=e3N9nhhfPl4_z8i3