Hacking COMPLETED BASIC MODCHIP / DONGLE UF2 SD BOOT FILES. Trinket / Rebug / RCMX86 / Others

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Don’t worry i was drinking Jim Beam while testing, thank you very much :)
OK... 0 folder in OP updated.

Try this. Overwrite all nx files you have with these in this zip.

Please report back!

I haven`t got a console in bits at the minute
 

Attachments

  • 0.zip
    403.8 KB · Views: 201
  • Like
Reactions: halk271

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Here is one for you to try people.

Try this 0.nx file. Rename to any nx you are using. So for example, if you are using modchip mode 4 built-in Hekate at the minute, you could change to mode 7 and rename this to 1.nx to have this Hekate version as payload num 1

It is Hekate modified to use the 0 folder. Made so it doesn`t interfere with any other version of Hekate you may use. Fully compatible with normal version. This isn`t made to replace the normal version, though you could do. If people want it like this, I will build it in to chainloader and use it as default.

Made backup options a bit clearer too.

a start.ini will be generated in 0 folder containing 9 payload entries (your start.bin and 1.bin, 2.bin, 3.bin ... ... etc)

Credit to CTCaer. Modded by the idiot OP of this thread.
 

Attachments

  • moddedhekate_0_nx.zip
    80.7 KB · Views: 169

noX1609

B9S freak ;)
Member
Joined
Aug 30, 2016
Messages
477
Trophies
0
Age
33
XP
501
Country
Germany
@mattytrog: Sounds interresting but i‘m not sure if i understood completely what‘s the difference to the methods with included hekate we already had.
If i get it right this one uses the 0 folder for it‘s configs etc. instead of the bootloader folder and so it would be possible to use 2 different versions of hekate with different settings. Is that correct?
 

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
@mattytrog: Sounds interresting but i‘m not sure if i understood completely what‘s the difference to the methods with included hekate we already had.
If i get it right this one uses the 0 folder for it‘s configs etc. instead of the bootloader folder and so it would be possible to use 2 different versions of hekate with different settings. Is that correct?
Correct. It isn`t required at all.

Just something I been messing around with.
 
  • Like
Reactions: noX1609

noX1609

B9S freak ;)
Member
Joined
Aug 30, 2016
Messages
477
Trophies
0
Age
33
XP
501
Country
Germany
Correct. It isn`t required at all.

Just something I been messing around with.
Ok thanks :)
There came an idea to my mind: It should be possible to also have 3 different versions if the bin is modded to support this isn‘t it?
If so, could you explain where this is edited / included in the source code (best would be via PM)? Because would be interesting for me as a developer playing arround with it :)
Is the sourcecode for this mod on your github? If not could you send me the source via PM?
 

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Ok thanks :)
There came an idea to my mind: It should be possible to also have 3 different versions if the bin is modded to support this isn‘t it?
If so, could you explain where this is edited / included in the source code (best would be via PM)? Because would be interesting for me as a developer playing arround with it :)
Is the sourcecode for this mod on your github? If not could you send me the source via PM?
I can do. I wasn`t going to upload it because bugger all has changed. The config.c file have a couple of altered /added lines along with main.c.

Thats it.

Will publish source later on though. But you will see there are hardly any differences.
 

noX1609

B9S freak ;)
Member
Joined
Aug 30, 2016
Messages
477
Trophies
0
Age
33
XP
501
Country
Germany
I can do. I wasn`t going to upload it because bugger all has changed. The config.c file have a couple of altered /added lines along with main.c.

Thats it.

Will publish source later on though. But you will see there are hardly any differences.
Ok cool would be great :) Please send me a short message via PM or post the link to the source here if you want it to be public :)
 

noX1609

B9S freak ;)
Member
Joined
Aug 30, 2016
Messages
477
Trophies
0
Age
33
XP
501
Country
Germany
Yeah right.
So do you mean he has to decide if you post it public or if you can send it to me via PM?
Or did i completely misunderstood you?
 

CTCaer

Developer
Developer
Joined
Mar 22, 2008
Messages
1,154
Trophies
0
XP
3,008
Country
Greece
No skin off my nose. It isn`t my code. Guess it is up to @CTCaer if he will let me or not :)
I can't force you to do anything.
Your only legal obligation is to have the source included in the zip or in an online repo.
And that's it. No credit, no permission, no nothing. Only the source.
(Because it's gpl. if it was MIT for example, you only need the license file to be included.)

EDIT:
Also distributing it privately, for example via pm to some ppl, is perfectly fine.
Ofc having a "PM me for binary", is not. But well semantics.

EDIT2:
Btw I wanted for months to include modchip communication, but hadn't the time and had to manage priorities.
My intention was to configure/update payloads/flash new fw..
 
Last edited by CTCaer,

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
I can't force you to do anything.
Your only obligation is to have the source included in the zip or in an online repo.
And that's it. No credit, no permission, no nothing. Only the source.
(Because it's gpl. if it was MIT for example, you only need the license file to be included.)

EDIT:
Also distributing it privately, for example via pm to some ppl, is perfectly fine.
Ofc having a "PM me for binary", is not. But well semantics.

EDIT2:
Btw I wanted for months to include modchip communication, but hadn't the time and had to manage priorities.
My intention was to configure/update payloads/flash new fw..

Thanks for getting back to me. I only made it for my private use really. I will upload the source to my git post-haste.

Thank-you.

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

EDIT: I can begin adding UF2 support from Hekate.

May even be able to emulate the double-press-reset via Hekate too. Maybe.
 
  • Like
Reactions: peteruk

CTCaer

Developer
Developer
Joined
Mar 22, 2008
Messages
1,154
Trophies
0
XP
3,008
Country
Greece
Well the only comms you can have, are through bootrom's usb stack.

So, only data. No special usb commands.

You have to add this support also to the chip. And then you can send payloads, get version info, change configuration, press buttons with "magic value" packets, etc.
The protocol already exists in the modchip. It's how you send a payload to switch. And you can do a state machine in the chip's code for anything else.

In hekate side, you need to add the usb stack functions. Check shofel2 cbfs or memloader payload for the protocol functions, or your chip's code.
Also you need to reduce hekate's size to approx 84KB and change the loading addr to 0x40010000. Otherwise the usb stack gets overwritten.
(That's why I haven't done it. I wanted to create minerva dram trainer in order for hos_launch in a module to not be slow).
 
  • Like
Reactions: mattytrog

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Well the only comms you can have, are through bootrom's usb stack.

So, only data. No special usb commands.

You have to add this support also to the chip. And then you can send payloads, get version info, change configuration, press buttons with "magic value" packets, etc.
The protocol already exists in the modchip. It's how you send a payload to switch. And you can do a state machine in the chip's code for anything else.

In hekate side, you need to add the usb stack functions. Check shofel2 cbfs or memloader payload for the protocol functions, or your chip's code.
Also you need to reduce hekate's size to approx 84KB and change the loading addr to 0x40010000. Otherwise the usb stack gets overwritten.
(That's why I haven't done it. I wanted to create minerva dram trainer in order for hos_launch in a module to not be slow).

I have playing with Hekate and managed to chop a rather sizeable chunk out. Namely graphics, backup/restore functions, console/SD info. I've been looking at the USB stack and indeed memloader is where I have been looking.

My quest continues! Many thanks for getting back to me :)
 
  • Like
Reactions: CTCaer

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Ok cool would be great :) Please send me a short message via PM or post the link to the source here if you want it to be public :)
I've uploaded source to GitHub.

Still getting my head around pull requests etc... Don't really know what I'm doing. I'm a C coder from the olden days and accordingly fossilised and out of date...

However it is there. Not forked. Because apparently forking is "rude".

: Shrugs shoulders:
 

PSxed

Well-Known Member
Member
Joined
Aug 28, 2014
Messages
113
Trophies
0
Age
36
XP
457
Country
Netherlands
Here you go gents. @Osmiza @PSxed


To run Atmosphere as a temporary solution...
I`m assuming you are using the 0 folder version of the chainloader... (0.nx + start.bin error when ejecting SD. CHECK THIS!)

Steps:

1) Download this file
2) Put your SD card in PC
3) Rename your current 0.nx file to something else (ie old0.nx)
4) In the download attached is a replacement 0.nx
5) Drag it to your 0 folder
6) Make sure BCT.ini, atmosphere folder and fusee-secondary are in the root of SD where they should be...
7) Put SD back in switch. Should boot.

This is a temporary solution until I have figured out whats happening. Looks like a hwinit problem.

Was this solution fixed in the main 0.nx file? Just modded another switch and i'm gonna put atmosphere there as well. If not, i'll just use this solution. :) As a developer myself, it sucks that i don't have any c++ (i presume it is c++?) experience or i would have fixed it myself.
 

noX1609

B9S freak ;)
Member
Joined
Aug 30, 2016
Messages
477
Trophies
0
Age
33
XP
501
Country
Germany
@mattytrog: Could you please do me a favor?
I tried to edit the uf2 chainloader file to have mode 8 active where i have the autoincrease and payloads 1,2 and 3 but with my hexeditor on OSX there seems to be a problem because at the offset where to set the mode as described at page on it shows me 00 but that should be 01 if i got the tutorial right. Or is the offset 4AF8 incorrect?
So could you please create the chainloader file for me with 0 folder used and mode 8? I would be very happy if you could do that because it‘s the only thing i need to have my console be able to boot 3 payloads :)
And could you upload a screenshot of the hex editor showing the offset because the picture that were included in the first post isn‘t there anymore since the update of the method? Because then i could compare it to the view i get and maybe i find my mistake.
Thanks in advance.

EDIT: Used Bootloader 1 with joycon only and Chainloader_0_folder.uf2

EDIT2: I used the zip from the other thread and not from this. Is that the problem and because of that the offset is not correct?
Can i use the File linked here together with the bootloader file from the hardware thread (thread where solder diagrams etc. are)?
That‘s all a bit confusing because the hardware thread has a zip with 4 files in it (2 bootloader and 2 chainloader) but that seems to be different files as linked in first post of this thread here.
 
Last edited by noX1609,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Least they got head in the end