hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.12k stars 2.16k forks source link

Static Guest Virtual Memory #15601

Closed illusion0001 closed 2 months ago

illusion0001 commented 2 years ago

What should happen

Not sure if it's been opened before but guest memory isn't static last time I checked, there is memory editor in the emulator itself but for those who prefer external software like cheat engine will have to find base addr manually.

Who would this benefit

Game patching users

Platform (if relevant)

No response

Games this would be useful in

-

Other emulators or software with a similar feature

Vita3k implemented this a few weeks back. https://github.com/Vita3K/Vita3K/pull/1802

Checklist

anr2me commented 2 years ago

It's not guaranteed to be static, just giving a hint for preferred address when possible

// preferred_address is only a hint for mmap, if it can't use it, the kernel will choose itself the address

But yeah, i wished there is an easier way to calculate the base address when using cheat engine to create cheats (ie. a base address that can be calculated with naked eyes without the need of calculator), as PPSSPP built-in memory viewer/editor is lack of advanced search engine like what CE have.

LunaMoo commented 2 years ago

i wished there is an easier way to calculate the base address when using cheat engine to create cheats

I made a cheat table that skips all manual calculating more than 6 years ago ~ here, partially because I was sick writing long guides how to check PPSSPP log when the address is logged on first game's boot and explain how to deal with the issues CE has when attached to PPSSPP, partially because I was also lazy to do more than a few clicks to find something before going to disassembly with it to create a proper cheat.

That cheat table can:

unknownbrackets commented 2 years ago

I think hard setting it to something that will only sometimes work is potentially just more confusing, for the times when it fails. FWIW there's also a websocket API that can be used to programmatically get the current base address too.

-[Unknown]

hrydgard commented 2 years ago

We used to use a static address in the past (0x2300000000), and ran into all sorts of weird issues. Mainly on non-Windows platforms though, but I think it's safer in general to let the OS choose where the memory is mapped. And as LunaMoo and unknownbrackets say, we do have ways of getting the base address out (and could add more if needed).

NABN00B commented 2 months ago

Maybe we can close this now with #15748 and #16994 in, among other options such as the WebSocket message. https://github.com/hrydgard/ppsspp/blob/9317fbdd5e8304de7fc0351b95cefbcc53228834/Core/Debugger/WebSocket/DisasmSubscriber.cpp#L255-L267