On the qrc can we not edit the file sizes in the file table or does that cause problems?
Yes, is very convenient, actually we have been doing it before in other frankentests (inside lines.qrc trying to replace a couple of files inside it named spline.elf and particles.elf)
That 2 boys was specially picky in the experiments and was refusing to work, so in one of the tests i had to adjust well the file length values in the index "just incase"... but not luck, the test failed for other reasons
Anyway... What we do to remap files inside the .qrc structure is to change that values of the index, is very straightforward, in the index you can see 2 values for every file for the "offset" and "length", with 4 bytes each, and consecutivelly
This values are what you can see in the xml generated by the CXML decompiler, as example...
Code:
<?xml version="1.0" encoding="utf-8"?>
<qrc>
<file-table>
<file src="Offset=0x00001860, Length=0x00000121.bin" id="earth/presets/0/earth/CLOUDS_4M.mnu" />
</file-table>
</qrc>
Copy together the 2 hex values that appears in the xml
So the... Offset=0x00001860, Length=0x00000121.bin ... becomes ... 0x
0000186000000121
If you search for that in the .qrc this is going to highlight it in the index... the firmware reads that value and then it "jumps" to load the file ... by changing that values we cheat the firmware into loading a different file... or a file in the same offset but with a different size
Loading different files is something we have been doing many times in the experiments with other .qrc files
Changing the size works... but we have made it only to convert the .MNU files to dummies (reducing his size to 9 bytes in the index), to corrupt .MNU files (reducing them to zero), or the experiment i mentioned about spline.elf and particles.elf (because i was using .elf files from older firmwares and had smaller sizes)
But the point is we have full freedom to change all that values of the index, and by doing this we can reorganize the contents of the whole filetable
The restriction we have is the total size of the filetable, it can be calculated this way:
Total size of the file table = end offset of the last file - start offset of the first file
The reason why we cant change the total size of the filetable is because if we do it will be needed to rebuild other parts of the .QRC structure that are
out of the filetable... and that could be tricky
The good thing is the filetable is located at the end of the .QRC ...so incase of making it bigger there is not going to be other data located after the filetable displaced by it
--------------
And yeah... i mentioned it before... for this kind of mods replacing the textures of the earth most of the times the custom files are going to be smaller,, so is better to adjust his size in the index
As example, with the value i mentioned before... 0000186000000121
You need to search for that... and change the 121 (original size) by the real size of the custom file (that usually is going to be smaller)