BullyWiiPlaza / Universal-Pointer-Searcher

An application for finding memory pointers
Apache License 2.0
24 stars 1 forks source link

Write pointers to HDD when running out of memory to keep going #13

Closed Yohoki closed 1 year ago

Yohoki commented 4 years ago

This is an issue I've been running into a lot that I think has to do with using too high of an offset range.

Sometimes when searching for pointers, the computer will just freeze and require holding in the power button to reset. I'm pretty sure it can happen fairly consistently when I raise the offset range to 10000 or so, but doesn't always. I'll try to get to a point where I can save all my work and be ok with the computer crashing a few times to test what's exactly making it crash, but I know it usually happens when I haven't had any luck finding anything useful and try increasing things a bit to sweep a few more pointers up. The only things I really ever increase is offset min/max and max depth. Everything else is pretty much never touched.

BullyWiiPlaza commented 4 years ago

Well, you're not supposed to use such a high offset range. That will probably exhaust your PC's RAM and make the PC crash eventually or slow down dramatically. It's not really a bug when you kind of misuse the tool like that. The offset range should be around 2000 or less and almost all of the time negative offsets are supposed to be excluded as well.

Yohoki commented 4 years ago

I thought that might have been the issue. But is that not what the Maximum Memory Chunk Size is for? I only have it using ~.75gb. I have 8gb, so that should be enough to work, right?

I had it crash last night, but I think I had it set to -1000 to 1000, so that should be within the 2000 range. 2000 seems awfully low to me, seeing as some of the codes I've seen in the vita have been in the 5 digits range. If it's not possible on this tool, it's alright because we still have tempAR, but it gives us thousands of pointers that probably don't work.

For instance, God of War on Vita has a pointer using -0x164BC offset. That being said, It could just be a case of the Vita being a weird console for hacking... It has some strange DMAs that we just don't understand completely, yet.

BullyWiiPlaza commented 4 years ago

The maximum memory chunk size works differently. It basically only controls how much of the RAM dump is loaded into the PC's RAM at once. This is useful for PCs with less RAM than the RAM dump size itself.

However, if you choose a big offset range, the temporarily results will go into the millions which will then probably max. out your RAM yet again. So technically any offset range is supported but you need enough RAM for them to fit. Since my laptop has 32GB RAM I could maybe do a search for you. Though, you just gave me the idea to maybe support writing out results to the disk if the RAM is running full to keep going without a crash or whatever. :)

Are you sure the God of War pointer is the best you/someone could find? It's incredibly uncommon for valid pointers to even have negative offsets or to be that high. Most games are fine with offsets in the 2000 range. Cheat Engine also defaults to an offset range fo 2000 - 4000 which seems reasonable and I could confirm this as well for a game I was making cheats for.

Yohoki commented 4 years ago

Ah. That makes sense, now. I see. So if we needed super high offsets, we'll have to default to TempAR for that. It sucks, but I understand that now.

No no no. I won't make you do a search for me. lol. That ruins the fun of breaking the game to begin with! XD But thank you very much for the offer. I'm glad to see you'd be willing to go that far. I will use TempAR if I have to.

Writing to the disk would be a better solution, though. I believe that's how Vitacheat (the plugin for searching for codes and dumping on vita) does it. It has a set number of addresses loaded in RAM (2kb, I think) and the rest is stored on disk. Although, this is for code searching, not pointer searching.

God of War was done by the Chinese community, so I have no idea how accurate it is... I do know that they work with the unencrypted EBoot files somehow and look for things in Ida Pro. So, I'm fairly certain their code is accurate. But, no idea. I'd have to get the game and find out. The -0x164BC is the most extreme offset used in that list, but many are in the +0x5000 range.

Yohoki commented 4 years ago

I went out and bought God of War for vita for $15 bucks so that I could do a proper check and.... you're absolutely right. There's 3 working pointers in the 0x1300 range that work perfectly fine. So, the super high pointer ranges are most likely unnecessary. So, when I make a tutorial on how to use your tool for Vita, I'll make sure people know to only search between -2000 and 2000.

I think the reason why pointers were getting that high is because some vita games just randomly load up in different areas. I've been noticing it a lot in HxD that sometimes the addresses are just off by 0x01000000 and I've no idea why. This also seems to be happening with God of War and the offset dumps just can't be mixed with normal dumps for pointer searching. So, they probably found a random pointer that just happened to be inside a stable area of memory.

So, it looks like running out of ram shouldn't be an issue. But writing to HDD would still be a nice feature to add as a safety net.

BullyWiiPlaza commented 3 years ago

So instead of writing pointers out to the disk, I decided to implement a way of detecting your RAM usage and stop collecting more pointers automatically when things get critical. This feature is now implemented here via command line option if you want to customize it beyond the default value. Please note that the operating system usually already performs caching in and out of RAM pages if you're running out of RAM so I thought it would be unnecessary if I implemented this hard work myself and in general it would be immensely slow to keep pushing through and you wouldn't get to results any time soon on pointer depths of 5 and higher.