Welcome! Log In Create A New Profile

Advanced

How does Ocarina work?

Posted by profetylen 
How does Ocarina work?
January 12, 2010 06:05PM
The title says it all. (How does Ocarina work (the cheat application)?)
Re: How does Ocarina work?
January 12, 2010 07:12PM
Probably runs a small app. in the background that peeks and pokes memory or injects a code cave into the games code. Just a guess.
Re: How does Ocarina work?
January 12, 2010 07:52PM
But how can you run an app in the background?
BTW, is it open source? I'd love to check the source out, but I haven't been able to find the source anywhere on internet. Neither have I found information about whether it is open source or not.
Re: How does Ocarina work?
January 12, 2010 08:29PM
its open source now, think there's a link on the wiki. EDIT: BTW, its Gecko OS source not Ocarina and can be downloaded here : [usbgecko.googlecode.com]

anyway it works by inserting a small hook (basically a patch, which makes a program, in this case a game, jump to a particular location in memory. At that location, there is custom code inserted, which in this case is a code reload. it then tells the program to go back to where it came from) into memory which is connected to the screen refresh code. the hook reloads the codes everytime it is run i.e. every time screen is refreshed. the hook applies the code by changing the value at the given offset to the value in the code. Then it boots the game with the hook loaded into memory.

I hope this explains it a bit, if you have any more questions or questions about specific parts or whatever, I'll try to answer them, although I'm not sure how much more I know.



Edited 1 time(s). Last edit at 01/12/2010 09:11PM by SifJar.
Re: How does Ocarina work?
January 12, 2010 10:28PM
That was a very good explanation! Thanks alot and also thank you for the link!

I have some more questions though:

1) Does the screen refresh code look exactly the same in every game and that's why it can find it?

2) Where does it put the custom code and how can it find that location?
Re: How does Ocarina work?
January 12, 2010 11:43PM
1) I believe so. Either that or its always in the same position in memory, or both. I am not 100% sure on that I am afraid.

2) I assume you mean how does the hook know where to jump to? In that case, Gecko OS finds an empty bit of memory big enough to hold the code, then stores the address of that location in the hook which is inserted into the screen refresh code.

Sorry I cannot be of more help, I have not investigated it too thoroughly, this is just stuff I have picked up from forums and IRC and the like.
Re: How does Ocarina work?
January 13, 2010 08:29PM
Still, you are to alot of help! Very much thank you for this SifJar!
Re: How does Ocarina work?
January 13, 2010 08:31PM
Yeah SifJar very useful information. It's pretty clever that it hooks into the video refresh, that gives me a few ideas :) Although my ppc asm is pretty lousy.
Re: How does Ocarina work?
January 14, 2010 04:52PM
Quote
scanff
Yeah SifJar very useful information. It's pretty clever that it hooks into the video refresh, that gives me a few ideas :) Although my ppc asm is pretty lousy.

I'd love to hear you ideas as I find Ocarina and stuff like it very interesting!
Re: How does Ocarina work?
January 14, 2010 09:20PM
Quote
profetylen
Quote
scanff
Yeah SifJar very useful information. It's pretty clever that it hooks into the video refresh, that gives me a few ideas :) Although my ppc asm is pretty lousy.

I'd love to hear you ideas as I find Ocarina and stuff like it very interesting!

We talked about a screen capture app. a long time ago on this forum. I would be cool if you could hook into the video refresh and redirect to a stub that did this. Not sure if you'd have enough code space or what impact it would have on the frame rate though.

I could easily do this on a PC but don't know enough about the inner working of a Wii or do I have the asm skills to write the capture stub.
Re: How does Ocarina work?
January 14, 2010 11:25PM
You could start by looking at the default Gecko stub and trying to understand it. I believe it is the file "patchhook.S" in the Gecko source.
Re: How does Ocarina work?
January 15, 2010 12:20PM
@scanff: Are you talking about video or images?

Just to see if I got things right: What has to been done is:

1. Find where the frambuffer is stored.

2. Convert the framebuffer to video / an image and save it to the SD or USB.

or am I missingsomething?



Edited 2 time(s). Last edit at 01/15/2010 04:53PM by profetylen.
Re: How does Ocarina work?
January 16, 2010 02:40AM
Quote
profetylen
@scanff: Are you talking about video or images?

Just to see if I got things right: What has to been done is:

1. Find where the frambuffer is stored.

2. Convert the framebuffer to video / an image and save it to the SD or USB.

or am I missingsomething?

You could save image or videos.

I'm not sure you'd want to convert the framebuffer it would probably choke up the cpu. But yes that's the general idea.
Re: How does Ocarina work?
January 16, 2010 12:16PM
Okay! Good luck with it if you decide to do it :)
Sorry, only registered users may post in this forum.

Click here to login