CTools and SZS Modifier can only handle U8 files. Wexos's Toolbox and Wiimms SZS Tools can (de)compress any kind of Yaz0-compressed files.
#Szs modifier mario kart how to#
#Szs modifier mario kart code#
This code example is taken from Wiimms SZS Tools: SVN repository lib-szs.c line 162 Tools some assertions to find errors in debugging mode they don't work with self referencing chunks. don't use memcpy() or memmove() here because N = *src++ + 0x12 // N=0 -> read third byteĪSSERT( n >= 3 & n data || dest + n > dest_end ) *** bit in group header byte is not set -> run length encodingĬonst u8 * copy_src = dest - (( b1 & 0x0f ) > 4 U8 * dest_end = // pointer to end of destination (last byte +1) U8 * dest = // pointer to start of destination For example if RRR=1 (go back 1+1=2) and SIZE=10 the previous 2 bytes are copied 10/2=5 times.ĭecoding data groups and chunks is done until the end of the destination data is reached.Ĭonst u8 * src = // pointer to start of sourceĬonst u8 * src_end = // pointer to end of source (last byte +1) It is important to know, that a chunk may reference itself.SIZE is calculated from N (see above) and declares the number of bytes to be copied.Go back RRR+1 bytes in the output stream to find the start of the data to be copied. Technically, I can just hack Mario Sports Mixs.
![szs modifier mario kart szs modifier mario kart](https://pm1.narvii.com/7262/fcd8d2e66f49d92d48d6ebe5ad162dbc0761d260r1-1200-1647v2_hq.jpg)
xml files but its about the same method of replacing, so yeah. szs modifier to modify menu contents, karts, characters, and the like), different files, and different. RRR is a value between 0x000 and 0xfff. Mario Kart Wii hacking works the same way, right.A cleared bit (=0) defines, that the chunk is 2 or 3 bytes long interpreted as a backreference to already decompressed data that must be copied. This byte must be copied to the output stream 1:1. The LSB (lowest significant bit, 0x01) corresponds to chunk 8Ī set bit (=1) in the group header means, that the chunk is exact 1 byte long.
![szs modifier mario kart szs modifier mario kart](https://i.ytimg.com/vi/FbjxMVRddek/maxresdefault.jpg)
The MSB (most significant bit, 0x80) corresponds to chunk 1.Each data group consists of 1 group header byte and 8 chunks.Įach bit of the group header corresponds to one chunk: The complete compressed data is organized in data groups. Always 0 in Mario Kart Wii.īe32_t uncompressed_size // total size of uncompressed dataīe32_t reserved // two unsigned integers reserved for special use All numeric values are stored as big endian. The header of a Yaz0 file is always 16 bytes long.