Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Guest Virtual Memory #15601

Closed
2 tasks done
illusion0001 opened this issue Jun 17, 2022 · 5 comments
Closed
2 tasks done

Static Guest Virtual Memory #15601

illusion0001 opened this issue Jun 17, 2022 · 5 comments

Comments

@illusion0001
Copy link

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. Vita3K/Vita3K#1802

Checklist

@anr2me
Copy link
Collaborator

anr2me commented Jun 17, 2022

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
Copy link
Collaborator

LunaMoo commented Jun 17, 2022

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:

  • workaround windows debugger bug which causes CE unable to freeze values in PPSSPP(important to do it as first step),
  • attach to PPSSPP process via script,
  • find base address for you,
  • limit search range to user memory,
  • print out simple write cheats in CWC formatting from cheat table entries(as well as address for disassembly etc.),
  • uses AOBscan so rarely ever has to be updated(had to update it some time ago, but it still works in latest version).

@unknownbrackets
Copy link
Collaborator

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
Copy link
Owner

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
Copy link
Contributor

NABN00B commented Jul 31, 2024

Maybe we can close this now with #15748 and #16994 in, among other options such as the WebSocket message.

// Request the current PSP memory base address (memory.base)
//
// WARNING: Avoid this unless you have a good reason. Uses PPSSPP's address space.
//
// No parameters.
//
// Response (same event name):
// - addressHex: string indicating base address in hexadecimal (may be 64 bit.)
void WebSocketDisasmState::Base(DebuggerRequest &req) {
JsonWriter &json = req.Respond();
Reporting::NotifyDebugger();
json.writeString("addressHex", StringFromFormat("%016llx", (uintptr_t)Memory::base));
}

@hrydgard hrydgard closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants