Users browsing this thread: 4 Guest(s)
[TUTORIAL] Making BMS Scripts; Post and get help with your BMS scripts!
Thanks Pingu, it works like a charm! Smile Could you please explain your script?
Reply
Thanked by:
Certainly!
So firstly I ignored the first byte, because it didn't really correspond to anything.

The next byte (One before the name you see there in the archive with the extension) corresponds to the length of each file name when you highlighted it. So i used the command:

getdstring NAME FNAMELENGTH

the fnamelength, being from the byte we grabbed from before.

now another issue we faced is that the offset data was weird. Because, it was padded/aligned data, so we needed to skip over those 0's until we got to the offset, which came after that "20" value. So, i wrote that little do while statement in order to skip over the zero's, until it grabbed the 20 byte and broke as the condition becomes false, as the byte grabbed is no longer a zero.


The script then starts off at the position one byte after the "20" byte, which would be the size value, followed by the offset value. The way i checked this was, the first value had an offset of 0x270 (it was in little endian). So i jumped to that position and the file began after the filenametable. From there, i took the last value and added it to the offset, to check if it was the size. It was, as it was 0x2 bytes under the next supposed offset in the data table.



Then i saved the file using the log command, then started again at the top with grabbing the null byte(the script loops). and continued to loop until it broke out to an incorrect file input size value, which ends after all the files have been read.
Reply
Thanked by:
Alright, I understand it a bit more now! But I'm a little confused as to how you got 0x270? Did you add up the total offset of the 20, 9F and 01 bytes?
Reply
Thanked by:
The 270 came after the 20 byte. The value in that spot was correspondant to that being an entry data slot that appeared in all the other entries > xmount of 0 bytes > 20 byte > Offset long
Reply
Thanked by:
Ah, I see it. Thanks again Smile
Reply
Thanked by:
Please help with this code for file 

https://yadi.sk/d/B7Bynf4G3HgLJL
Code:
get FILES long
get DATASTART long
get UNK long
for i = 1 <= FILES
   get NAME string
   get SIZE long
   log NAME OFFSET SIZE
   math OFFSET += SIZE
next i


its doing something wrong....files are broken
Reply
Thanked by:
(05-04-2017, 04:07 PM)Krantek Wrote: Please help with this code for file 

https://yadi.sk/d/B7Bynf4G3HgLJL
Code:
get FILES long
get DATASTART long
get UNK long
for i = 1 <= FILES
   get NAME string
   get SIZE long
   log NAME OFFSET SIZE
   math OFFSET += SIZE
next i


its doing something wrong....files are broken

Code:
get FCOUNT long
get OFFSET long
get NULL long

for i = 0 < FCOUNT
get NAME string
get SIZE long
log NAME OFFSET SIZE
math OFFSET += SIZE
next i


Your DATASTART variable should be logged, you never assigned anything to the variable labeled "OFFSET".
Reply
Thanked by: Krantek
Thank you very much Pingu! You are the best!
Reply
Thanked by:
And one more question, please, why reimport give me an error...as I understand right we need to use the same script...is it right?


Attached Files Thumbnail(s)
   
Reply
Thanked by:
The data file you could be trying to import may be bigger than the original size allocated/there's no data values to shift the entries
Reply
Thanked by:
Hello Pingu!;

Looking for help discovered this page, hope you can help me...

I'm working on the english translation for Puyo Puyo Tetris for Wii U and I have extracted the required textures from ".narc" files, but I found out that the game didn't use the ".narc" files...  I suspect that the used textures are in other files with the ".tzip" extension.

I have reviewed the .tzip files in the HEX editor but can't find anything.  Can you help me to read these files?

Here are three files that I suspect have textures on them: Download


Thank in advance!


zL
Reply
Thanked by:
(05-05-2017, 09:58 PM)zADAN Wrote: Hello Pingu!;

Looking for help discovered this page, hope you can help me...

I'm working on the english translation for Puyo Puyo Tetris for Wii U and I have extracted the required textures from ".narc" files, but I found out that the game didn't use the ".narc" files...  I suspect that the used textures are in other files with the ".tzip" extension.

I have reviewed the .tzip files in the HEX editor but can't find anything.  Can you help me to read these files?

Here are three files that I suspect have textures on them: Download


Thank in advance!


zL

Code:
comtype COMP_UNZIP_DYNAMIC
get ZSIZE long
get NAME basename
string NAME += ".narc"
get ASIZE asize
math ASIZE - 4
clog NAME 4 ASIZE ZSIZE

Here you go. It decompresses the TZIP into NARC files
Reply
Thanked by: zADAN
(05-05-2017, 11:53 PM)ThatTrueStruggle Wrote:
Code:
comtype COMP_UNZIP_DYNAMIC
get ZSIZE long
get NAME basename
string NAME += ".narc"
get ASIZE asize
math ASIZE - 4
clog NAME 4 ASIZE ZSIZE

Here you go. It decompresses the TZIP into NARC files

Wow! What kind of sorcery was that?  The ".tzip" file was a 644 KB size and the code extracted a few ".narc" files, one of 6 MB.  
Awesome and thanks!  You will be in the credits for this translation.

Here is the work in action:
[Image: giphy.gif]

I have another request (I want to bother the less I can)...

I want to extract the text (I can't find the strings in the files) from these ".mtx" files: Download

It is possible to extract the text in a ".txt" file to be able to inject the translated text later?

Someone else has done this before time ago, but never shared the tools, don't know if was done with QuickBMS.  Here is the extracted text from that person.

Thanks in advance!

zL
Reply
Thanked by:
(05-06-2017, 04:46 AM)zADAN Wrote:
(05-05-2017, 11:53 PM)ThatTrueStruggle Wrote:
Code:
comtype COMP_UNZIP_DYNAMIC
get ZSIZE long
get NAME basename
string NAME += ".narc"
get ASIZE asize
math ASIZE - 4
clog NAME 4 ASIZE ZSIZE

Here you go. It decompresses the TZIP into NARC files.

Wow! What kind of sorcery was that?  The ".tzip" file was a 644 KB size and the code extracted a few ".narc" files, one of 6 MB.  
Awesome and thanks!  You will be in the credits for this translation.

It's called compression  Tongue  It compressed it pretty well and made the file smaller.

Here you go. I wrote this in about an hour and wasn't too hard. Usage below:
Code:
MTX2TXT -d inputMTX outTXT : This decodes an MTX into a TXT file. Replace inputMTX with the path to the MTX file and outTXT with the name you want to it be.
MTX2TXT -e inputTXT outMTX: This encodes a TXT file into a MTX file. Replace inputTXT with the path to the TXT file and outMTX with the name you want to it be.

When you want to encode a text file, make sure you have the setup like the decoded MTX files (text on new lines for each one)

This was a fun little project and I haven't had so much fun writing something like this in a while. Hope you enjoy!  Big Grin
(I can provide source code to this if you'd like to look at how it works, it's pretty simple)
Reply
Thanked by: zADAN
(05-07-2017, 09:16 PM)ThatTrueStruggle Wrote: Here you go. I wrote this in about an hour and wasn't too hard. Usage below:
Code:
MTX2TXT -d inputMTX outTXT : This decodes an MTX into a TXT file. Replace inputMTX with the path to the MTX file and outTXT with the name you want to it be.
MTX2TXT -e inputTXT outMTX: This encodes a TXT file into a MTX file. Replace inputTXT with the path to the TXT file and outMTX with the name you want to it be.

When you want to encode a text file, make sure you have the setup like the decoded MTX files (text on new lines for each one)

This was a fun little project and I haven't had so much fun writing something like this in a while. Hope you enjoy!  Big Grin
(I can provide source code to this if you'd like to look at how it works, it's pretty simple)

Hello ThatTrueStruggle, first of all thank you very much for your time, it works!
I was working with the SLog option from QuickBMS without any satisfactory result, also trying to code but I was far from this yet.

Here is the result:
[Image: giphy.gif]


Notes:

1.- When you decode (-d) you need to add the path to the .txt file too (Maybe I misunderstood the instructions but I thought the .txt file would be created just specifying it's name).  Not a problem.

2.- When open the extracted .txt file, notepad shows the text all together, without line separation per text section.  This was solved in Notepad++.

[Image: notepad_vs_notepad_01.png]

3.- The line break symbol is unknown (), but I just copied it and paste where was requiered, it worked.

4.- Not sure if all text were extracted for one file... Is there a way to prove that all text were extracted?  The file "mainmenuJapanese.mtx" just have twelve lines in the extracted .txt file and it not cover all the main menu text in the game, also the text extraction made by another person some time ago (review here) includes more line covering all main menu text (39 lines).

That mainmenuJapanese It could be a compilation of various files, I'll explore the files to see if I can find the othee parts, or if there is a way to review the .mtx file and see if that's all the text I'll appreciate that.


I'm glad that you enjoyed doing something that was a nightmare for me (Not that bad, but I was so far).  And of course I enjoyed the result, thanks again!! I'll share the english patch with you once it get done (Based in your dumps, I assume that you own a Wii U, hope you enjoy this puzzle game too).

Edit:
Related to the source code, I'll return as one of your padawan to become a Jedi on this like Pingu! did.  For the moemnt, I'll concentrate to finish this translation.

zL
Reply
Thanked by:


Forum Jump: