The HED file, which I expect contains information for extracting the data from the MRG file, is quite confusing. In the MRG file I see only various "MZX0" strings. What's the python script you are currently using?
aluigi wrote:The HED file, which I expect contains information for extracting the data from the MRG file, is quite confusing. In the MRG file I see only various "MZX0" strings. What's the python script you are currently using?
set MEMORY_FILE10 string " // https://github.com/Hintay/PS-HuneX_Tools/blob/master/tools/mzx/decomp_mzx0.py int mzx0_decompress(unsigned char *f, int fsz, unsigned char *dout, int exlen) { unsigned char ringbuf[128]; int ring_wpos = 0; int clear_count = 0; int offset = 0; int last1 = 0, last2 = 0; unsigned char *max = f + fsz; int i, k;
for(i = 0; i < sizeof(ringbuf); i++) ringbuf[i] = 0;
#codepage 932 idstring "mrgd00" get number_of_entries short for i = 0 < number_of_entries get sector_offset short get offset short get sector_size_upper_boundary short get size short xmath OFFSET "(sector_offset * 0x800) + offset" putarray 0 i OFFSET next i savepos BASE_OFF
get OFFSET asize math OFFSET - BASE_OFF putarray 0 i OFFSET sortarray 0 1
# the first file contains the names math END_NAMES = 0 for i = 1 < number_of_entries if END_NAMES == 0 getdstring NAME 32 if NAME == "" math END_NAMES = 1 else string NAME + . endif else set NAME string "" endif getarray OFFSET 0 i math i + 1 getarray SIZE 0 i math SIZE - OFFSET math OFFSET + BASE_OFF
savepos TMP goto OFFSET getdstring SIGN 4 if SIGN u== "MZX0" get XSIZE long math OFFSET + 8 math SIZE - 8 clog NAME OFFSET SIZE XSIZE else log NAME OFFSET SIZE endif goto TMP next
Basically I ignore the *size fields because they look confusing and difficult to calculate, the only downside is that you are probably going to have few (less than 8) padding bytes at the end of each file.
The names are chaotic because there are less names available than files, I used a work-around.