Editing GimConv
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 437: | Line 437: | ||
==Identifying GIM settings by bruteforce== | ==Identifying GIM settings by bruteforce== | ||
{{Boxinfo1|content='''GIM-to-GIM''' is the only conversion method that is '''[https://en.wikipedia.org/wiki/Lossless_compression lossless]''' for all image formats supported by GimConv.exe}} | {{Boxinfo1|content='''GIM-to-GIM''' is the only conversion method that is '''[https://en.wikipedia.org/wiki/Lossless_compression lossless]''' for all image formats supported by GimConv.exe}} | ||
The word [https://en.wikipedia.org/wiki/Brute-force_search bruteforce] sounds a bit ridiculous | The word [https://en.wikipedia.org/wiki/Brute-force_search bruteforce] sounds a bit ridiculous used in this enviroment, but it defines pretty well how this identification method works. Consist in rebuilding the GIM file several times by using different GimConv settings until we generate a GIM file identical to the original. In other words... if you find how to create a GIM file exactly like the original you can be 100% sure the settings you are using are exactly the same used by sony to create that GIM | ||
The only way to create a GIM file exactly like the original | The only way (that works with all image formats) to create a GIM file exactly like the original is by making a GIM-to-GIM conversion, this is not so retarded as it sounds, GimConv really rebuilds the file when doing a GIM-to-GIM conversion and in the process is preserved the pixel data of DXT based image formats, there are other rebuild method that allows to create GIM files identical to the original such GMI-to-PNG-to-GIM but only works for rgba based image formats, the point is GIM-to-GIM is the only that preserves pixel info for DXT formats, adnd for this reason the GIM-to-GIM conversion superceedes all other methods | ||
In bruteforce is used a "dictionary" that contains the posible candidates that solves the "problem"... the good thing is our dictionary (with the GIM formats found in PS3) only contains 3 candidates, this means in the worst scenario you are going to need to rebuild the GIM file 3 times... if none of the 3 GIM files matches with the original we have a problem (please report back and we will add the rare format to this wiki page) | |||
*GIM--->GIM method (prefered) | |||
**Use gimconv with .gim files as input and output (this preserves dxt pixel info, because dxt images doesnt suffers a conversion) | |||
'''1st most common''' | '''1st most common''' | ||
{{Keyboard|content=<syntaxhighlight lang="bash">gimconv.exe original.gim -o try1.gim -ps3rgba8888</syntaxhighlight>}} | {{Keyboard|content=<syntaxhighlight lang="bash">gimconv.exe original.gim -o try1.gim -ps3rgba8888</syntaxhighlight>}} | ||
Line 450: | Line 453: | ||
{{Keyboard|content=<syntaxhighlight lang="bash">gimconv.exe original.gim -o try3.gim -dxt5</syntaxhighlight>}} | {{Keyboard|content=<syntaxhighlight lang="bash">gimconv.exe original.gim -o try3.gim -dxt5</syntaxhighlight>}} | ||
*GIM--->PNG--->GIM method (fails when there is involved a DXT conversion because DXT conversions are lossy, works fine for rgba**** image formats): | |||
**Use rcomagegui to make an extraction of the contents '''without''' conversion of images (this way the GIM are extracted as GIM) | |||
**Use rcomagegui to make another extraction of the contents '''with''' conversion of images (this way the GIM are extracted as PNG) | |||
**Use gimconv to convert a PNG ---to---> GIM by the old method of test-error by trying some of the options availables that appears in gimonv.cfg | |||
**Use a hexeditor to compare the original GIM extracted in step 1 with the rebuilt GIM from your test, there is no need to make accurate comparisons, just an overview of the first 0x80 bytes of the header, and how the pixel data is ordered starting at offset 0x80 | |||
**When the header and pixel data seems similar make a hash comparison, original GIM and rebuild GIM should be exactly the same hash (is posible to create a GIM exactly like the original) | |||
===GimConv.exe version patch=== | ===GimConv.exe version patch=== | ||
The reason to use this patch is because | The reason to use this patch is because when enabling the setting '''--update_fileinfo on''' is added a block of data named "fileinfo" (block id 0x00FF) at bottom of the GIM file, in a GIM-to-GIM conversion this block of data (from the original file) is preserved (added in the rebuild GIM file) but the version of GimConv.exe included in this block is updated. The original versions in PS3 retail GIM files are '''GimConv 1.20e''' and when you do the GIM-to-GIM conversion it changes to '''GimConv 1.20h''', is a single byte but this single bytes doesnt allows us to create a GIM file identical to the original (and this sucks). The last step of the bruteforce method is to make a hash comparison original GIM VS rebuilt GIM and should be identical. If you are using some external code you can modify this byte by other means (so you dont need this patch or you can solve it by other means) but for normal usage of GimConv.exe in command line this is handy because it allows to create identical GIM files | ||
GimConv.exe v1.20h original (MD5:425B2E4D9684BCE1FC79A37247618AC8) | GimConv.exe v1.20h original (MD5:425B2E4D9684BCE1FC79A37247618AC8) | ||
Line 460: | Line 468: | ||
GimConv.exe v1.20h patched to v1.20e (MD5:6C9B0E47273EFA6D34121A46E65EEDC6) | GimConv.exe v1.20h patched to v1.20e (MD5:6C9B0E47273EFA6D34121A46E65EEDC6) | ||
As far i know all the GIM files from PS3 retail firmwares that was created using '''--update_fileinfo on''' was build with GimConv.exe v1.20'''e''' | As far i know all the GIM files from PS3 retail firmwares that was created using '''--update_fileinfo on''' was build with GimConv.exe v1.20'''e''' so it should work for most of them... if at some point someone finds other GIM files that was made with with other GimConv.exe versions (c, d, f, g) and you want to use this bruteforce identification process you can make another GimConv.exe patched with different versions and rename them to GimConvC.exe, GimConvD.exe, GimConvE.exe, GimConvF.exe, GimConvG.exe etc... and keep all them in the same folder next to the original v1.20h | ||
==Examples== | ==Examples== |