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,696
Trophies
1
Age
28
Location
Imola
XP
6,922
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
  • RedColoredStars @ RedColoredStars:
    There is zero instacart delivery to here. No door dash. No Uber. Notta. Its a small farming community
    +1
  • Sicklyboy @ Sicklyboy:
    eagerly awaiting 4x 8TB HDDs to get delivered today
  • RedColoredStars @ RedColoredStars:
    So I drive the 30 miles there, spend $100-$150 on groceries, and drive back home. Still saved $$$ after gas over shopping locally.
    +1
  • K3Nv2 @ K3Nv2:
    You'd think you could make deals with local farmers
  • AncientBoi @ AncientBoi:
    :unsure::unsure::unsure: I could make a killing there doing instcart there :D @RedColoredStars
  • RedColoredStars @ RedColoredStars:
    It makes the trip even more worth it if I'm out of my medication and need to stop by the medical dispensary. I try to line the two up to avoid extra trips.
    +1
  • RedColoredStars @ RedColoredStars:
    @AncientBoi, Except the town is pretty MAGA infested. People still flying TRUMP 2016 flags all over. They didnt get the memo the year changed since then. lol.
    +1
  • RedColoredStars @ RedColoredStars:
    They passed a city ordinance last month. No smoking cannabis in public. Not even eating gummies. $300 fine and misdemeanor charge if caught. People can walk down the street smoking cigs and tossing the butts all over, but God forbit someone take a couple puffs of their medication.
    +1
  • RedColoredStars @ RedColoredStars:
    First off, it's recreationally legal here. Secondly, I have a prescription from my doctor and approved by the state. But still a fucking criminal.
    +1
  • RedColoredStars @ RedColoredStars:
    Like at bars. Cant sit outside even in the smoking section and take a few puffs. Yet I have to breath the cig smoke from 20 people chain smoking all night in every direction around me.
  • K3Nv2 @ K3Nv2:
    Honestly I feel like Trump is going to crush Biden just because of the trial
  • RedColoredStars @ RedColoredStars:
    They cite
    public health and safety concerns" LMAO!!! Yet they do nothing about the poison drinking water quality.
  • K3Nv2 @ K3Nv2:
    The look at how they treated me card is powerful within dumb voters
  • RedColoredStars @ RedColoredStars:
    A Trump win is certainly a possibility. If he's reelected, 4 more years then no one has to worry about him being president ever again. I survived last time, I'll survive it if there's a next time. Don't know how anyone could vote for the guy, but I'm also not anyone else but me.
    +1
  • K3Nv2 @ K3Nv2:
    Honestly things were cheaper with Trump but that's tounge and cheek could be exactly the same outcome if he won reelection
  • RedColoredStars @ RedColoredStars:
    All of the fake "Christians" vote for him even though he's broken like 8 of the 10 commandments... that we know of. Maybe all 10. LOL
    +1
  • K3Nv2 @ K3Nv2:
    A president is just a public figure within America
  • K3Nv2 @ K3Nv2:
    South park put it will there's always a bite between a turd sandwhich or a giant douce
    +1
  • RedColoredStars @ RedColoredStars:
    I like when he says stuff like "They are preventing me from talking!!!" Wait. What? You mean the person that is literally talking right now.. is being prevented from talking? LOL! Gag order also does not apply to taking the stand. He's free to say whatever he'd like. lolol
    +1
  • NinStar @ NinStar:
    holy fuck this discsussion sucks, where are my sisters
  • K3Nv2 @ K3Nv2:
    Well if it sucks stop blowing turd sandwhich
    +1
  • Xdqwerty @ Xdqwerty:
    @NinStar, convince your parents to make a sister for you
  • NinStar @ NinStar:
    parents? what parents?
  • K3Nv2 @ K3Nv2:
    People who screwed each other to make you
    +1
    K3Nv2 @ K3Nv2: People who screwed each other to make you +1