Homebrew How were payloads like Godmode9 created?

HamBone41801

Vipera’s Alt
OP
Member
Joined
Jan 16, 2017
Messages
1,083
Trophies
0
Age
23
XP
974
Country
United States
As the title says, I'm interested in the creation of payloads used by a9lh or sighax. Specifically, Id like to create a payload that would play .m4a audio files.
 

Ryccardo

Penguin accelerator
Member
Joined
Feb 13, 2015
Messages
7,690
Trophies
1
Age
28
Location
Imola
XP
6,909
Country
Italy
As the title says, I'm interested in the creation of payloads used by a9lh or sighax. Specifically, Id like to create a payload that would play .m4a audio files.
Well this is a hard question...

A payload is no more than a binary executable (which must be programmed keeping in mind there's no real operating system to interact with, and that specific memory addresses are reserved for specific devices and purposes - it doesn't have to be 100% handwritten assembly but it's not your typical amateur command line program for windows/mac/linux/bsd/plan9/... either)

Plus you'd have to consider nobody has developed an arm9 homebrew with sound; while nobody is opposed to you being the first, how much of that is due to lack of interest and how much due to technical limitations is something I don't know the answer for...

Sorry if this answer sounds generic but to a certain extent so is your question, like all "how to learn programming" - it's a combination of reading documentation, others' code, and trial and error!
 
D

Deleted User

Guest
If you really want an audio player that starts at boot:

  1. Install 11.2 FW
  2. Install menuhax
  3. Create a audio player (.3dsx extension)
  4. Name it boot.3dsx
  5. Put on SD card
  6. Hold menuhax button
  7. Profit (Kinda)
There you go. Have at it.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
I'll break this into two 'replies' of sorts since the question branches into two different areas (even if they're related).

As the title says, I'm interested in the creation of payloads used by a9lh or sighax.

This isn't terribly difficult, but basically, you'd compile your code into an ELF and use objcopy to extract the binary code out of it (in the case of a9lh), or take the ELF and build a FIRM file for it with TuxSH's firmtool (sighax/b9s). The thing is you have to understand the environment in which you're wanting to work, which I'll describe below in the second 'reply'.


Specifically, Id like to create a payload that would play .m4a audio files.

Now this is where things would get iffy. You have to consider the A9LH/Sighax environment to be like an embedded device, or perhaps a better analogy would be a PC that's still booting/the BIOS/EFI* just finished executing. Hardware generally isn't initialised to a level where you need it to be, and there aren't any operating system drivers or services in place to let you do what you want. It's an extremely primitive environment where you have to do everything yourself (you could even think about it being like the DS or GBA). You would have to bring the screens up to show graphics (relatively easy to do, there's lots of code for it in Luma, godmode9, etc.) for a menu, and get input to drive the menu (easy to do, it's just a hardware register that you read like on the DS or GBA).

Finally, you have the issue of sound. The 3DS has a DSP chip that plays sound, but it uses its own firmware, so you would have to figure out how to initialise the chip, upload firmware to it, and then start sending sound data to it. Nobody has done this outside of the FIRM/horizon environment (meaning the main 3DS OS), so you'd not have any references to work with. You could reverse engineer parts of the 3DS OS to get going, but that would take a lot of time and effort for something you could do as suggested above: get menuhax and run a program that way, or just wait the 6-9 seconds it takes for your console to boot and run your favourite music player. Alternatively, if something like MarcusD's TreeHome gets finished, maybe it could autoboot into certain titles, but until that happens, the prior ideas are all that are really available at this point.

*Leaving aside the fact that both BIOS and UEFI have extremely rudimentary device drivers and services to get the system going, it's for the sake of analogy and explanation.
 

HamBone41801

Vipera’s Alt
OP
Member
Joined
Jan 16, 2017
Messages
1,083
Trophies
0
Age
23
XP
974
Country
United States
I'll break this into two 'replies' of sorts since the question branches into two different areas (even if they're related).



This isn't terribly difficult, but basically, you'd compile your code into an ELF and use objcopy to extract the binary code out of it (in the case of a9lh), or take the ELF and build a FIRM file for it with TuxSH's firmtool (sighax/b9s). The thing is you have to understand the environment in which you're wanting to work, which I'll describe below in the second 'reply'.




Now this is where things would get iffy. You have to consider the A9LH/Sighax environment to be like an embedded device, or perhaps a better analogy would be a PC that's still booting/the BIOS/EFI* just finished executing. Hardware generally isn't initialised to a level where you need it to be, and there aren't any operating system drivers or services in place to let you do what you want. It's an extremely primitive environment where you have to do everything yourself (you could even think about it being like the DS or GBA). You would have to bring the screens up to show graphics (relatively easy to do, there's lots of code for it in Luma, godmode9, etc.) for a menu, and get input to drive the menu (easy to do, it's just a hardware register that you read like on the DS or GBA).

Finally, you have the issue of sound. The 3DS has a DSP chip that plays sound, but it uses its own firmware, so you would have to figure out how to initialise the chip, upload firmware to it, and then start sending sound data to it. Nobody has done this outside of the FIRM/horizon environment (meaning the main 3DS OS), so you'd not have any references to work with. You could reverse engineer parts of the 3DS OS to get going, but that would take a lot of time and effort for something you could do as suggested above: get menuhax and run a program that way, or just wait the 6-9 seconds it takes for your console to boot and run your favourite music player. Alternatively, if something like MarcusD's TreeHome gets finished, maybe it could autoboot into certain titles, but until that happens, the prior ideas are all that are really available at this point.

*Leaving aside the fact that both BIOS and UEFI have extremely rudimentary device drivers and services to get the system going, it's for the sake of analogy and explanation.
thanks for the reply man! I cracked the first part. I found a test for a payload in @d0k3 's github, fixed an error in his make file, and I can now build and load firms. as for the second part, I doubt ill be able to do all of that.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
thanks for the reply man! I cracked the first part. I found a test for a payload in @d0k3 's github, fixed an error in his make file, and I can now build and load firms. as for the second part, I doubt ill be able to do all of that.

No problem. It would be a daunting task, for sure. It took TuxSH, Aurora, Mid-kid, b1l1s, and some others a good week or so just to get screen init working safely. Sound would be a fair bit more complicated..
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: