WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: CrimsoN@DC on February 19, 2012, 11:11:50 PM

Title: Creating your own pointer?
Post by: CrimsoN@DC on February 19, 2012, 11:11:50 PM
Well not thinking, I made a code today that loaded an address into a pointer, but I used the set pointer to codetype... did I do this wrong?  People say it froze before the game even booted to the main screen (of course I accidentally wrote to the code handler) but could my lack of pointer knowledge be the cause of this?

(What I'm trying to do is jump from the original address to an address in a blank part of the memory to do stuff... perhaps I don't need to jump but is it still possible?)

Also, when your using gecko registers, can you load a pointer into a gecko register?  One of the pointers you 'made'

And finally, when you use gecko registers and pointers and such, say we put a gecko register on the address 80123456, how far could I write in that gecko register?

I.e.
80000000 80123456
86000000 00001158
Etc etc.

Without worrying about anything?
Title: Re: Creating your own pointer?
Post by: Bully@Wiiplaza on February 20, 2012, 07:43:02 AM
I would use a breakpoint read and store the destination address to the ram.
Then I´ve got a pointer which can be used. But that´s somehow useless because you could just do anything inside the C2 code also.
But if you prefer gecko codestypes, you could do that.
Title: Re: Re: Creating your own pointer?
Post by: CrimsoN@DC on February 20, 2012, 03:18:15 PM
Well the problem is, is that I'm making a code from off of the top of my head, trying to make it universal with other codes for that game.  I.e. they can insert there own address to have my equation do something for them.  I figured this out, however, I still have a question.  Ill post it when I switch to my laptop in a few minutes so you can kind of see what I'm working with.

Edit:

So heres the code I'm working with, I commented it so you can see what I was thinking while making


80000000 8089AEA4 #sets
86000000 00002180 #adds
84200000 80000010 #Stores at 80000010
4A000000 80000010 #Sets po to 80000010
CE000000 80008180 #Checks po
34000010 8089AEA4 #Checks that values at 80000010 is >8089AEA4
52010000 00000000 #Loads po to ba
0600010 0000018 #Runs code
xxxxxxxx xxxxxxxx
xxxxxxxx xxxxxxxx
xxxxxxxx xxxxxxx
E2000000 80008000

However, I don't think I am doing this line right:
52010000 00000000 #Loads po to ba
0600010 0000018 #Runs code

How would I fix that?  I tried loading the pointer offset into the base address, while I thought that the po was the sum of my equation... Perhaps I wasn't right?  What I am mainly trying to do, is input an address, add a certain value to that address, then use that new address as the address at #Runs code.  Hopefully that made sense.
Title: Re: Re: Creating your own pointer?
Post by: Fake Code Spammer on February 20, 2012, 05:01:41 PM
This is cool idea man;D

Sent from my Kindle Fire using Tapatalk
Title: Re: Creating your own pointer?
Post by: CrimsoN@DC on February 21, 2012, 03:20:04 AM
*sigh* sorry for being like all over the place in this thread, however I suppose its better then spamming the help section.

With my code, 

80000000 8089AEA4 #sets
86000000 00002180 #adds
84200000 80000010 #Stores at 80000010
4A000000 80000010 #Sets po to 80000010
CE000000 80008180 #Checks
34000010 8089AEA4 #Checks that values at 80000010 is >8089AEA4
52010000 00000000 #Loads po to ba
06000000 00000018 #Runs code
436F6465 206D6164
65206279 20437269
6D736F4E 00000000
E2000000 80008000

I am starting to think that I am not loading the base address right... Any help?

What I'm thinking is happening, is that somewhere in the gr, the addresses get... err... How do I explain it... Out of logical order?  This is my second time working with gecko registers, the first time was nothing compared to how (almost) complicated this is.
Title: Re: Creating your own pointer?
Post by: dcx2 on February 21, 2012, 07:55:15 PM
First off, I wouldn't touch anything below 80001800.  I know that sometimes you can get away with it, but as a general rule I just don't.  There are some very important variables in that section of memory.

Second, only the upper 7 bits of the ba are used.  So if you load 80000010 into the ba, and then do 04000000 FFFFFFFF, you will write FFFFFFFF to address 80000000 instead.  Only the po uses all 32-bits of the address.