r0ah / vitacheat

FinalCheat / VitaCheat Database
343 stars 280 forks source link

Disable Address Space Layout Randomization #165

Closed Yohoki closed 6 months ago

Yohoki commented 1 year ago

I haven't been in the scene for a few years, but I now know what this issue is called, and how to fix it. So, I figured I'd share the knowledge.

Most of the time when I was making codes, even using pointers didn't work, as the addresses would randomly be in different places. Sometimes moved around by 0x1000, sometimes by 0x100000. It would cause codes to be shifted to different areas and they would not work for other people, and dumps would not yield useful pointers.

After a bit of research in another area of my life, I've come to find out this is called Address-Space Layout Randomization (ASLR) and is a memory allocation feature for security and optimization. Every time the game is loaded, the Vita has to allocate chunks of memory, and sometimes a chunk is moved to a different area.

There's little you can do to make the codes work 100% of the time if the game's layout changes.

However.... There is a solution.

A couple years ago Princess of Sleeping released a plugin called noASLR for homebrew developers. This is probably the solution that this community needed to fix the issue. I have not tested it, nor do I really feel like being the one to do so, but I think this is the way forward and should fix a lot of issues with dumps not being compatible or yielding useful pointers. You'll still need pointers and searching is a pain, but at least you'll be sure your dumps are good.

The only downside, if you make codes with this plugin, it's likely the users will need it also installed to use the codes... Meaning that every .psv in the database would need redone if it wants to be compatible with the plugin.

Anyway. That's the realization I came to, and a bit of extra help from an old hacker. Enjoy.

eighthdayregret commented 6 months ago

The issue in question is mostly remedied by using the B200 codes for non-ASM cheats. Unfortunately, most games where static, pointer, and B200 codes do not work require the A### codes and actual programming knowledge, which is far more common in modern games. NoASLR does not remedy this issue.