News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: [PSX] PS-X EXE aka SLUS  (Read 506 times)

Z3R0X

  • Jr. Member
  • **
  • Posts: 43
  • My name's not shane, kid.
    • View Profile
    • My YT channel with mini tools.
[PSX] PS-X EXE aka SLUS
« on: July 17, 2018, 08:27:41 am »
Hello everyone, I need advice on how to inject code into the SLUS without breaking it or my injected code be overwritten by the game.
- First possible solution is to find a blank spot in the SLUS but the problem here is that my code may be overwritten.
- Second solution that I use, but is no elegant: most of the SLUS (even PS2 ones) have these strings CdlReadS, CdlSeekP, CdlSeekL, CdlGetTD, CdlGetTN... many more, these are all the time is the same spot on the RAM, I write my code in this space and works on a real console with burned CD-R.

Any person with more knowledge about an elegant solution of doing this, thanks.

Gemini

  • Hero Member
  • *****
  • Posts: 1977
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: [PSX] PS-X EXE aka SLUS
« Reply #1 on: July 17, 2018, 09:39:29 am »
The general idea is to have a free spot inside your executable and inject there. Some games provide that kind of space if they have Fnt functions, which can be rerouted to do nothing and you also get around 4K of free space from the font itself. In some other cases you could find other stuff that becomes obsolete, say SJIS convertion tables or similar data. In special cases games use malloc like functions, which can be used to allocate your code, and since malloc always works with the same pattern, you'd have your code in the same exact spot of ram, which you can exploit to load new static code specifically crafted to use that as the base address.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

paul_met

  • Full Member
  • ***
  • Posts: 174
    • View Profile
    • Meduza Team
Re: [PSX] PS-X EXE aka SLUS
« Reply #2 on: July 17, 2018, 04:25:06 pm »
One of the developers of the PS1 emulator told me that there is no free space in the executable file. It is better and safer to replace already existing resources.
So, you can use the space reserved for the system font, which is never used in the game itself. This is 2kb of space.

« Last Edit: July 17, 2018, 04:34:10 pm by paul_met »

Z3R0X

  • Jr. Member
  • **
  • Posts: 43
  • My name's not shane, kid.
    • View Profile
    • My YT channel with mini tools.
Re: [PSX] PS-X EXE aka SLUS
« Reply #3 on: July 17, 2018, 08:48:36 pm »
Thanks for the replays, I will try both ways, some games does not have system font in the main exe or can not be found with tile molester, I guess I have change the method depending of the game.

Gemini

  • Hero Member
  • *****
  • Posts: 1977
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: [PSX] PS-X EXE aka SLUS
« Reply #4 on: July 18, 2018, 01:58:17 pm »
That is not a system font, it's something that gets linked with Fnt functions - a system font would be the one coming from the BIOS, which you can't use for injecting code, since it resides in the onboard ROM. In some cases you might be in luck and find that developers never stripped unused SDK functions, which provides quite some extra room.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

paul_met

  • Full Member
  • ***
  • Posts: 174
    • View Profile
    • Meduza Team
Re: [PSX] PS-X EXE aka SLUS
« Reply #5 on: July 19, 2018, 03:01:40 am »
Of course, it was meant that this is the system font of the game, which is used to output debugging information (such as errors or warnings).