Possible next features of QuickBMS

Doubts, help and support about QuickBMS and other game research tools
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

thank you sir aluigi,
you made a Worthful program and that's great
i want to say thank you for everything and i hope quickbms turn to biggest programming tool

bms is a file scripting language and it's fast, clear, and have more possibility that other ones don't know and thank you for make it possible

best regards, who Believe in future of your work

i wish sir aluigi get too many success in his life and some day make quickbms studio to compile bms to exe based on main quickbms.exe parts

sorry for my bad grammar
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

Thanks! :D

In theory bms files can already be embedded in quickbms.exe, it's a feature I introduced some versions ago.
It's not like compiling the script but it worked well.
For info search the following section in quickbms.txt:
C] Modkit distribution of quickbms.exe
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

i have a idea!
maybe you can make a QuickBMS runtime!

first, download this zip file: DOWNLOAD

in zip file, there is two exe file (TellTale_export_landb.exe & TellTale_import_landb.exe)
and there is a bms_runtime.exe for installing and a choice_notification_english.landb for test
before you click on bms_runtime.exe, click on TellTale_export_landb.exe and it will gives you a error!
if you install bms_runtime.exe, it will extract quickbms in appdata folder
and test the tools aftert installing and it will extract text .landb file and TellTale_import_landb.exe will create a new one!


and creating a batch file with -s script line, and compile it to exe can works like a tool with a runtime
if you create a studio with this idea, it will possible to create tools with QuickBMS Runtime! you can make a runtime!
note: bat files compiled with Bat To Exe Converter
ducan012456
Posts: 64
Joined: Mon Apr 08, 2019 8:20 am

Re: Possible next features of QuickBMS

Post by ducan012456 »

When I use reimport2, the SIZE_TEXT doesn't divided by 2.
How can I solve this problem ?
Here is my example script.

Code: Select all

xmath SIZE_TEXT "SIZE_TEXT*2"
slog NAME OFF_TEXT SIZE_TEXT unicode
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

ducan012456 wrote:When I use reimport2, the SIZE_TEXT doesn't divided by 2.
How can I solve this problem ?
Here is my example script.

Code: Select all

xmath SIZE_TEXT "SIZE_TEXT*2"
slog NAME OFF_TEXT SIZE_TEXT unicode


you have done two things wrong

wrong 1: in xmath, you should add a space between every variable and math glyph, which means you should write it like this: xmath SIZE_TEXT "SIZE_TEXT * 2"

wrong 2: in xmath, you will create a new variable, for such times, you should just use math, not xmath, because it should be in a direct math operation way, if you get a variable with available name again, your current variable will be lost and new variable will replace with old one, you should do it like this: math SIZE_TEXT * 2, beacuse you will get problem in reimporting
ducan012456
Posts: 64
Joined: Mon Apr 08, 2019 8:20 am

Re: Possible next features of QuickBMS

Post by ducan012456 »

Shokoniraya wrote:
ducan012456 wrote:When I use reimport2, the SIZE_TEXT doesn't divided by 2.
How can I solve this problem ?
Here is my example script.

Code: Select all

xmath SIZE_TEXT "SIZE_TEXT*2"
slog NAME OFF_TEXT SIZE_TEXT unicode


you have done two things wrong

wrong 1: in xmath, you should add a space between every variable and math glyph, which means you should write it like this: xmath SIZE_TEXT "SIZE_TEXT * 2"

wrong 2: in xmath, you will create a new variable, for such times, you should just use math, not xmath, because it should be in a direct math operation way, if you get a variable with available name again, your current variable will be lost and new variable will replace with old one, you should do it like this: math SIZE_TEXT * 2, beacuse you will get problem in reimporting

Thank you very much !! :D
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

Shokoniraya wrote:
ducan012456 wrote:When I use reimport2, the SIZE_TEXT doesn't divided by 2.
How can I solve this problem ?
Here is my example script.

Code: Select all

xmath SIZE_TEXT "SIZE_TEXT*2"
slog NAME OFF_TEXT SIZE_TEXT unicode


you have done two things wrong

wrong 1: in xmath, you should add a space between every variable and math glyph, which means you should write it like this: xmath SIZE_TEXT "SIZE_TEXT * 2"

wrong 2: in xmath, you will create a new variable, for such times, you should just use math, not xmath, because it should be in a direct math operation way, if you get a variable with available name again, your current variable will be lost and new variable will replace with new one, you should do it like this: math SIZE_TEXT * 2, beacuse you will get problem in reimporting
cai_miao
Posts: 3
Joined: Sun Dec 08, 2019 7:35 pm

Re: Possible next features of QuickBMS

Post by cai_miao »

Hello aluigi,
big thank you for your powerful tool.

I'm recently using ff4 ssam script to extract another *.mass archive from NDS game Avalon Code (using JP ver, also developed by Matrix software).
It's also a mixture of plain files and *.lz compressed files, and so far the file decompression is good,
but when I try to reimport, the game just don't recognize it and get crashed.

I did a simple inspect, vanilla header of compressed files (for example .NCGR.lz) starts with

Code: Select all

10 B0 04 00 00 then `RGCN`

while reimport header is

Code: Select all

40 B0 04 00 00 then `RGCN`

and I also tried:
1. Change the `comtype` to `lz77wii_raw10`, but it simply won't let me extract/import.
2. Change the header bit from `0x40` to `0x10`, same result in crashing the game. Only confirmed the algorithm QuickBMS defaultly used for lz77wii is imcompatible for my case.
3. Using `comtype NTCOMPRESS` (tried to get clue from src) but it just tell me

Code: Select all

Error: unsupported compression -1 in reimport mode

4. Using CrystalTile2's embedded lz77 compress to get the file compressed, and directly overwrite to corresponding address of *.mass archive, and it simply works. (output file also with header bit 0x10) But that would be asspain if I want to do a massive import.

Based on my inspection, I'm here asking for help with:
1. A fix on the lz77wii compression
2. A temporary fix for the script to extract/import untouched/compressed *.lz files (raw out)

Sadly, I have limited ability on coding, and it is a bit complicated for me to understand the bms script. I tried to make a raw output script, but can't just get pass unknown errors.

Can you help me out? Ty in advance. I can send you related files through email.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

The problem is that lz77wii is a container of N algorithms, in reimport mode it's not possible to know what algorithm was used during extraction and therefore quickbms selects just one of them hardcoded in the tool
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

sir aluigi, can make possible to find some unknow bits in findloc?
like \xAD\x?E\xCE or \xBD\x??\xCA\xFC
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

I thought about it but it was complicated to implement so I don't think there will ever be such feature.
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: Possible next features of QuickBMS

Post by chrrox »

Can you add this to the next version of quickbms
https://github.com/DragonMinded/bemaniu ... ol/lz77.py
It fixed dance evolution arcade decompression i tested it and it works.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

Ok, do you know if it's really a custom lz77 or something already in use in quickbms under different name?
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: Possible next features of QuickBMS

Post by chrrox »

I tried compscan and nothing matched the output.
cai_miao
Posts: 3
Joined: Sun Dec 08, 2019 7:35 pm

Re: Possible next features of QuickBMS

Post by cai_miao »

aluigi wrote:The problem is that lz77wii is a container of N algorithms, in reimport mode it's not possible to know what algorithm was used during extraction and therefore quickbms selects just one of them hardcoded in the tool


then how can i force the script to use that algorithm? ty in advance
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

You can do it by replacing "comtype lz77wii"+"clog..." with something like this:

Code: Select all

savepos OLD_OFFSET
goto OFFSET
get LZ77WII_TAG byte
get LZ77WII_SIZE threebyte
math OFFSET + 4
math SIZE - 4
comtype lz77wii_raw10
clog NAME OFFSET SIZE LZ77WII_SIZE
goto OLD_OFFSET
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

sir aluigi, since QuickBMS is a powerful generic tool, do you have any plan to compile bms scripts as assembly exe files? i think its possible and it's better... because it is possible to write some seperated bms scripts to create a complete tool and compile it to exe, actually, your job is great sir aluigi, but i think quickbms is not fast... and i think it's not wierd, because quickbms works with many functions and sure it's a hard coded system, but if you create a programming studio for bms language and rewrite system from beginnig, it can be very fast, great and powerful than this, because it directly using C functions, so a standalone exe without any other unused codes can be a best programming language, and with developing this system, you can even make gui systems with that, your job can turn to a nificent thing if you develop it, nothing is hard, it just requeste time. complexily is just a set of simple things

don't leave it behind, you can make it, just like drawing, we can't see more colors with our own eyes, but we can use it in best way with these limited colors (limitions is not a bad thing always, because it can make us deep and masterful)
(sometimes, we must fall if we want to rise)

sorry for my bad grrammar, my original language is totaly different than english or any other latin ciphers
and if someone thinks this words is nothing but stupied things, then i can tell that can you are right and not right too (not hard to understand, we live with it right now) i hate emojis, i could use it in such time if it was okay for me
wattostudios
Posts: 20
Joined: Fri Jun 02, 2017 2:15 pm

Re: Possible next features of QuickBMS

Post by wattostudios »

Hi Aluigi,

I've been playing with BMS scripting, and noticed that I couldn't specify a compression type as a variable.

For example, lets say a file has the compression type "ZLIB" listed as a string within it. If I have this piece of script...

Code: Select all

GetCT COMPRESSIONTYPE STRING 0x20
ComType COMPRESSIONTYPE


I would expect this to read the string "ZLIB" into a variable COMPRESSIONTYPE, and then use the Value of COMPRESSIONTYPE in the next line.However, if I run the above, it says something like "Compression type COMPRESSIONTYPE unrecognized"

To make the script work, I had to hard-code the compression types, like this...

Code: Select all

GetCT COMPRESSIONTYPE STRING 0x20
If COMPRESSIONTYPE = ZLIB
  ComType ZLIB
ElIf COMPRESSIONTYPE = DEFLATE
  ComType DEFLATE
EndIf


The readme certainly doesn't mention the ability for ComType to use Variables. Is there something I need to do here, any tricks that I could use, or is this something that you could implement in the future?

Thanks.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

@Shokoniraya
I already answered some posts ago. It's not possible to do that.

@wattostudios
Yeah, comtype must be a string so variables aren't supported.
Just remember to use "zlib" and "deflate" (with quotes) when doing comparison, it's not necessary but it's a good thing.
I don't think comtype will ever be implemented as variable, I don't remember the original reasons if it's something related to conflicts with other variables and names probably.
In the over 2000 scripts I made I never had this necessity.
wattostudios
Posts: 20
Joined: Fri Jun 02, 2017 2:15 pm

Re: Possible next features of QuickBMS

Post by wattostudios »

Thanks Aluigi, just thought I'd ask, no worries.
I wouldn't say it's a necessity, but just something I thought about. I have seen some archives that list the compression method directly in the archive, which would be convenient to just pass straight in to QuickBMS, but it's not too hard to work around it 8-)