Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Thu Mar 28, 2024 3:17 am

All times are UTC - 8 hours [ DST ]


Forum rules


Discussion of illegal hacking/cracking is prohibited. (No virus/trojans/cracks/warez/etc allowed.)



Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Tue Oct 06, 2009 12:07 pm 
Offline
Kommunist
Kommunist

Joined: Tue Oct 30, 2007 9:53 am
Posts: 43
Does anyone know how to force a data pointer to always load it's data in the same address?

Specifically, to assign some data for one actor in ocarina of time (N64 version 1.0 U).

Would it be possible to just assign the pointer to load in some obscure out-of-the way place like somewhere in the 600000+ range? I don't care where it's loaded, just that the data variable addresses for one set of an actor's data stay the same.

*An alternative to this would be to order the pointer to load it's data first, or after all the priority-set pointers load their data(a few actors always load their data in set locations, like Navi, for instance).

The data I'm referring to includes the address 801e3A00 when Link's in the Temple of Time.(it's the actor data that includes this address).


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2009 6:03 pm 
Offline
Komrade
Komrade
User avatar

Joined: Tue Mar 27, 2007 6:23 pm
Posts: 1354
Location: Mario Raceway, 1509.831, 217.198, -564.429
Title: Mario Kart 64 Hacker
You want to force a single dynamically-allocated block to be allocated in a static location in extended RAM? Best way I can think of would be to patch the loading routine to check what it's allocating for, and in that condition return your fixed pointer instead of calling the allocator.

I'm pretty sure OoT's actors are a linked list, so this should be doable. If it were an array you'd have more problems. An alternative might be to copy the block after everything is loaded, and update all pointers to it.

If the game uses a sophisticated enough allocator, it might try to free that block and then freak out since it was never allocated. Games I've worked with don't free individual blocks - allocation is only done when a map is loaded, and freeing is done by just resetting the heap pointer. I would imagine OoT uses a similar method. (It allocates things such as your items when needed, but probably doesn't free them until you leave the map; the benefit would be load time rather than memory usage.)

_________________
Image 143
HyperNova Software is now live (but may take a few tries to load) currently down; check out my PSP/DS/Game Boy/Windows/Linux homebrew, ROM hacks, and Gameshark codes!


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2009 7:44 pm 
Offline
Kommunist
Kommunist

Joined: Tue Oct 30, 2007 9:53 am
Posts: 43
It does seem to load the data separately for each map, and therein lies the problem that makes it dynamic instead of static.
(you've spent some time hacking this game, don't you know this for certain?)

Honestly, I don't know why it does this for this particular actor, when the data in this area for friggin' NAVI is, at least in some areas, BELOW it and it's ALWAYS the same address!

So, what would be the best way to do this?

Would it be better to assign the pointer or to give this pointer's assigning a higher priority order that makes it get assigned so early it's always in the same place(like NAVI'S is!).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 06, 2009 7:55 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
Why do you need the data to be static?

Why can't you just modify the assembly to dump the pointer somewhere and then use the pointer that has been dumped to keep track of the data you're manipulating?

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 07, 2009 6:42 am 
Offline
Kommunist
Kommunist

Joined: Tue Oct 30, 2007 9:53 am
Posts: 43
So you're saying it's better to send the pointer to some other location that's always free?

..Then let's go with that one. It was my first thought on how to do this, actually.

Ok, though- how do I go about doing this? Do I figure out the starting point of the data and then find it's pointer and set that to where I want it(and where do I want it? is the 600000+ range good?)

You see, I'm just doing this with my N64 ASM tools-free gameshark.
I can't see the things you can see in the code, so I'm handicapped until I finally stop being lazy and go pursue something that gives me access to these tools.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 07, 2009 8:32 am 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
600000 isn't a valid address. Unless you have the expansion pak. If you do, that's fine; you should anyway.

You were talking about forcing data to load to a specific location. I assumed you wanted to do this so the data would be easy to find. Well there's a much easier way to do this, which is to simply follow a pointer to that data. As for doing THAT, there's two ways:

The first is to actually find a consistent pattern in the pointers you can find in the RAM. The second is to modify some assembly code to put the pointer in a block of memory that "is always free". 0x80600000 isn't a bad address for that (again, only if you have the expansion pak); however, you're not "setting" any pointers. You're just copying one to a memory location that's easy to locate.

The N64 GS doesn't have pointer codes. To read and copy pointers around you will need to write some assembly code. If you can't think of a good place to hook it, I would suggest some code that is reached after the absolute branch at 0x80000180. This is if you know the pointer structure and can merely follow pointers to get to the one you want to use. If you don't actually see a pattern, then you will need to find some assembly code that constantly accesses your data structure and modify it to grant you use of whatever value is in the register that will hold the pointer you need.

In either case, actual use of the pointer might as well be done instead of copying it to say, 0x80600000, because you need assembly to load your data anyway. The assembly itself would be a good candidate for something at 0x80600000.

What you originally suggested is much more difficult to do and still requires patching assembly code. If you don't have either the tools to modify assembly code or the skill to use what you have to do so then I'm afraid you're fucked.

What exactly do you have? You might be able to do much more than you think.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 07, 2009 10:07 am 
Offline
Kommunist
Kommunist

Joined: Tue Oct 30, 2007 9:53 am
Posts: 43
I just have codes in the data block, and know where a few of them are in different areas.
actor size mod in temple of time:
801e3A50 xxxx
801e3A54 yyyy
801e3A58 zzzz

Lake hylia size mod for same actor:
801e8800 xxxx
801e8804 yyyy
801e8808 zzzz

Temple of time codes for actor:
actor number: 801E3A00 xxxx




All I want to do is be able to make codes for the data in the block, so all I want is for that block of data to always be found in the same spot, not caring where that spot is.
It doesn't matter what the method is, only that it achieves this.

So, with that in mind what's the easiest method to achieve this?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 07, 2009 5:41 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
Definitely assembly.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 11, 2009 1:59 pm 
Offline
Kommunist
Kommunist

Joined: Tue Oct 30, 2007 9:53 am
Posts: 43
Fine. I need assembly then.

If I want to do that, I need a way to connect my gameshark to my PC.

Would this product be a good way to do that? Is it all I need to be able to use an assembly program to make this code:

http://www.newegg.com/Product/Product.a ... 6815104231

I swear to god, say it is and I'll get it within a week and start making codes the right way from here on..


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 11, 2009 3:11 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
I have no idea. That approach looks difficult.

Would be best to just use an emulator.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 98 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group