Super Simple ELF patching (for HDLoader etc)
Final Edit notes:
-- I've produced a final release version of my package, now called
-- "ELF_repack_BATs.zip" and decided to attach it to this, the first post
-- of the thread, since that is what each newcomer will see on arrival.
-- So get that final release from the attachment at the bottom of this
-- post. (As yet it's not available anywhere else.)
Old Edit notes (modified):
-- I've removed the two batch listings from this text, as final
-- versions of the files have been released since then.
-- Most of the other text in this first post remains valid, so please
-- read on if you like. (But the docs in the released zip are better.)
I've noticed that several of you have problems with ELF patching,
mainly because you're not familiar with the format and its needs.
Well, neither am I, but experience has taught me ways to get
around such limitations and learn the basics of new stuff quickly,
and now I've come up with a solution that may be useful for many
of you as well.
NB: Those of you who are perfectly familiar with ELF formats,
obviously don't NEED my help to handle them. But please hear
me out anyway, as my solution may still be convenient for
you as well, even though you don't really need it.
I've simply made two bat files onto which you can drag-drop ELF
files to unpack or pack, respectively. The real work is done by
two readily available programs (more below) which are, however,
much more complex in their abilities than most of us want to
deal with normally, when we don't really need those features.
(Which is why I created those bats for my own usage.)
First of all, you need the two packer programs 'sjuncrunch' and
'ps2-packer'. The first one is just a stand-alone exe file which
you'll find at "http://www.oopo.net/consoledev/", and the other
one is a zip archive found at "http://ps2dev.org/kb.x?T=1061".
Unzip "ps2-packer-0.4-win32.zip" into a folder of your choice,
though the rest of my text below will call it "ELF_repack\".
Next copy "sjuncrunch.exe" into that same "ELF_repack\" folder
(where ps2-packer.exe already resides).
Then use Notepad or similar editor (NO wordprocessor) to make 2
text files containing the texts specified below. I suggest you
just cut and paste from the web page to be sure of getting it
right. Save these files as well in the "ELF_repack\" folder,
using the names "unpk_ELF.bat" and "pack_ELF.bat".
(The names don't really matter, but make them descriptive.)
Edit: ----- redundant bat listings removed from here -----
When you drop an ELF file onto either of these bats, or onto any
shortcut pointing to one of them (eg: useful on desktop), it
will start by renaming the file to the same name, followed by the
string ".tmp". That file will then be used as input to the real
programs, with the original name used for the output file. Once
the work is done, the .tmp file is erased, leaving you with the
processed output file using the name of the original file.
Effectively this means that you just pick up the original and drop
it on a batch, which then magically changes the file as needed...
Btw: When patching files, remember to always keep backup(s) of the
untouched originals, no matter how good the patches may seem.
Future (even more improved) patches may require virgin copies
and if you forgot to keep some, you're up the creek with no
Well, that's all for now. Happy patching everyone !
Best Regards: dlanor
PS: If unpacking results in an impossibly small file, such as a 1K file from
a 600K original, then it means either that your original was unpacked
already, or that it is damaged somehow. My bats can't know whether
the ELF is packed or not, and sjuncrunch gives no indicatation except
for showing zero-sized blocks and making a small file. You just have
to be aware of this possibility yourself.
Final release of ELF_repack_BATs.zip (with docs)
As promised earlier I have now made the effort to write some proper docs for my BATs, thus making it more of a real release package. I'll leave the other posts mostly intact though, except for adding some edit notes to ensure people get the real package from the first post.
(That is the only attachment left in this thread now, anyway.)
Best regards: dlanor