Hacking Read file from disc using assembly

  • Thread starter Thread starter Yacker
  • Start date Start date
  • Views Views 1,238
  • Replies Replies 5

Yacker

Well-Known Member
Member
Joined
Apr 3, 2013
Messages
182
Reaction score
131
Trophies
1
XP
1,575
Country
United States
Probably an insane question; but would it be possible to write my own disc reading function with assembly? Struggling to find anything on this with google.
 
IOS is used to handle such things. You would then get to tickle IOS to make it spit back data.
https://wiibrew.org/wiki//dev/di
https://wiibrew.org/wiki/IOS#DIP
While it is for the gamecube enough of it carried over to the wii that 5.7 of http://hitmen.c02.at/files/yagcd/yagcd/frames.html might be of interest as well.

If it is an existing game you are doing a ROM hack for I would look to hijack any internal read commands (the game might build up a file system aware, handle waits and the like, leaving you mainly to fire off the read and then having it fed back).
If you are doing your own homebrew then fair enough, though devkitpro/devkitppc might well have something you can use or look at as well (they tended not to lean into disc reading but there are some things).


I don't know what will go here as far as using the drive -- it was mainly only the older drives that did raw reads (3x only to the official encrypted disc 6x speed) so you are possibly limiting yourself to said old drives, possibly mod chips and maybe optical drive emulators, and maybe also wanting people to have a hacked IOS ( https://www.wiibrew.org/wiki/DVDX for some examples, though cioscorp could also be worth a look).
 
  • Like
Reactions: jeannotte
Yeah, it's for a game hack, but the thing is the game has its own proprietary file system that's hard coded, which makes it a giant pain in the ass to modify. Hence why I just wanna make my own reader. I found that first Wiibrew page while doing research on my own, but it wasn't clear to me how to use it. Seems the second one cleared up the IPC thing, plus the wiibrew page on IPC itself, thanks, I'll see if I can get IOS working from here.
 
Heh.
Nothing too unusual for DS games to have their own archives that they operate of but I have not heard of Wii stuff doing it before.
 
Alright, so I did some fiddling around and got file reading from disc to work on a gamecube game, but it doesn't work on Wii. Naturally I'm assuming this is because the Wii's IOS is limiting me from directly interfacing with the hardware. So I went back to trying to figure out how to get IOS to work; Wiibrew says I must operate it through the IPC registers. Fair enough, but when trying to read or write them, Dolphin simply claims it's invalid memory. Figured I'd try 0xCD800000 instead of 0x0D800000, and that seemed to work, but while it seems to acknowledge the command (flag returns 0x2) it never seems to actually execute it (0x4)...or, at least, as it appears on the surface, but Dolphin reports creating a handle to it just fine. Figured maybe the flags just aren't updated and I can just pull the output, but that doesn't seem to be it either. Worst case scenario here, though, it seems to consistently produce the same ID, according to Dolphin. So I could just hardcode the fd on actually reading, after spinning a little while to ensure the IPC got it; though that seems like a not very elegant solution.

Update: nevermind literally 5 minutes after posting that long diatribe I went back to trying it with the non-IOS method and got it working by just changing the address to 0xCD806000. Thanks, with this I'll be able to do some fun stuff
 
Last edited by Yacker,
Update: nevermind, I'm a fool. It's not working at all. Apparently didn't even figure it out for GCN.
Update2: Yep, definitely a fool. IT IS working, I just fucked up one register. Ack.
 
Last edited by Yacker,

Site & Scene News

Popular threads in this forum