Eboot string hacking question

Discussion in 'PSP - Hacking & Homebrew' started by Patrick Evers Bjoerkman, Jun 19, 2014.

  1. Patrick Evers Bjoerkman

    Patrick Evers Bjoerkman Member

    Jun 19, 2014
    Hello, I am trying to change some strings in an decrypted elf eboot with a longer length that the original string. This is not possible directly due to offsets ofc, so I am wondering what to do exactly.

    I was thinking that since these binary files work with address offsets, then couldn't I simply make an address pointer that points to a new string written at the end of the Eboot and replace the original string with this address pointer?

    Is this possible or is there some smarter method I could use?
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    So you have the elf file, all nice to edit however you will.
    Said elf is located always at a given point in memory (or some simple maths thereupon)
    The code in the elf has pointers for strings located in the elf file, however as the elf file is in memory it just pulls things directly from memory and works based upon that logic rather than a more simple soft pointer systems.

    You want to increase the length of these strings but the pointers stop this from happening as things would get cut off or crash or something if you went beyond it. What actually happens here can trouble things but we will keep a bit simpler until the end of this list.
    You propose changing one or more pointers to be at the end of the elf where you have more space to play with.

    The answer is kind of. That is how things were done on older consoles, for the PSP this can be harder.

    Your biggest problems are likely to be memory issues and termination.

    Memory issues being the elf size was mostly known to the compiler (or worse someone using assembly) and it could adjust some memory offsets accordingly. You take another few kilobytes with strings and things could start falling over. We have similar problems on the DS when people want to do this, fortunately DS games with wifi tended to have all the error codes in there so you could steal space there, this sort of thing is what you might have to do here.
    Termination. Some pointer systems might take one pointer, the next and subtract the first from it (this is one type of pointer maths). Other things might just terminate when it encounters a 00 or something (the PSP was something of a C family device so you could get lucky here). Other things still might have a length value somewhere in the string, with the pointer or, worse, as part of the load command elsewhere.

    Finally are the strings variable length? I tend to see this sort of thing for menus in games and menus in games have historically been fans of fixed length sections (it is why various spell names in older games have been quite short, often almost to the point of breaking).

    If you can make it shorter and it is just a menu, a couple of location names or something able to be shortened then do so. If not then yeah you get to figure out how to make more space for you.