Instantly share code, notes, and snippets.

Embed
What would you like to do?

How to find savedata exploits

Since the release of h-encore you might be wondering how such a user entry point is even possible. It is possible because games that were developed with an SDK around 3.00 and lower were compiled as a statically linked executable, thus its loading address is always the same and it cannot be relocated to an other region, which means that if we have an exploit in such a game, we can happily do ROP and don't need to deal with ASLR. They also don't have stack protection enabled by default, so stack smashing is the easiest way to trigger user ROP execution. Savedata exploits are more powerful than WebKit exploits in terms of available syscalls. The reason for that is after firmware 3.30 or so, Sony introduced sceKernelInhibitLoadingModule in their browser, which prevented us from loading additional modules. This limitation is crucial, since this was the only way to get syscalls, as they are randomized at boot.

Note that the following guide is written for people with few knowledge about exploitation.

How do we know that a game is a statically linked executable? They have got the value 0xFE00 for the e_type field in their ELF header. This is how you can see what type the executable has:

  1. Choose any game you want to attempt exploiting.
  2. Open the game in VitaShell using Open decrypted.
  3. Click on the file eboot.bin, press triangle and select Open hex editor.
  4. See what value is at offset 0xB0:
    • If it is 00 FE, it is statically linked, hence it may be exploitable.
    • If it is 04 FE, it is dynamically linked, hence is not exploitable due to ASLR.

If it is indeed a statically linked executable, you can now begin with fuzzing the savedata:

  1. Download any hex editor.
  2. Download and install CrashDump Enabler.
  3. Start your game and play it a little bit until you are sure that it has created a savedata.
  4. Either use vita-savemgr or VitaShell to export the savedata. If you use VitaShell, simply navigate to ux0:user/00/savedata and use Open decrypted on your game, then copy the savedata file out of the folder.
  5. Connect your PS Vita to your computer and begin writing crap into the savedata file using your hex editor. Simply write alot of a's at some points.
  6. Copy the savedata back (again with Open decrypted if using VitaShell) and play the game.
  7. Repeat this procedure until you get a crash. If the game complains that the savedata is invalid or so, then it is because there's a crc/hash check. In that case, you should give up, unless you know how to reverse engineer.

In case you get a crash, the crashdump will be written to ux0:data. You can open these dumps using VitaShell and then see whether there are any 0x61 or other repetitive values in the registers (assuming you've only written a's into your savedata):

  • If the pc register contains the value 0x61616161 or something similar, then congratulations, you've found a new user entry point!
  • If BadVaddr is 0x61616161 or something similar, then it may also be exploitable (depends on whether it was a load or a store that crashed).
  • If it doesn't contain anything special, then continue with fuzzing.

Be careful that in case you find something useful, you should NOT show a screenshot of the crashdump that contains any titleid/strings of the game (otherwise Sony might see and patch it).

If you find something, please contact Yifan and we can sell it for $$$.

@Yoti

This comment has been minimized.

Yoti commented Jul 6, 2018

"Repeat this precedure until you get a crash."
Mistype: prOcedure.

@TheOfficialFloW

This comment has been minimized.

Owner

TheOfficialFloW commented Jul 6, 2018

@Yoti thanks

@mathieulh

This comment has been minimized.

mathieulh commented Jul 6, 2018

"dynamically linnked" There is only one "n" in "linked".

@xyzz

This comment has been minimized.

xyzz commented Jul 6, 2018

"If the register pc" => "If the pc register"

@devnoname120

This comment has been minimized.

devnoname120 commented Jul 6, 2018

"how such an user entry point" should be "how such a user entry point"

@yifanlu

This comment has been minimized.

yifanlu commented Jul 6, 2018

"If you find something, please contact me." => "If you find something, please contact Yifan and we can sell it for $$$."

@TheOfficialFloW

This comment has been minimized.

Owner

TheOfficialFloW commented Jul 6, 2018

"0x61616161" => "0xF0CC0FF"

@StepS-

This comment has been minimized.

StepS- commented Jul 6, 2018

"this was the only to get syscalls" => "this was the only way to get syscalls"

@wfscans

This comment has been minimized.

wfscans commented Jul 8, 2018

Heh, I love that you tell em' to fuck off but still make the change... does that mean we should be looking for the mystic "0xF0CC0FF"?! :p

@Yoti

This comment has been minimized.

Yoti commented Aug 27, 2018

CrashDump Enabler is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment