QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Doubts, help and support about QuickBMS and other game research tools
GarryOlsen
Posts: 11
Joined: Sun May 02, 2021 5:45 am

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by GarryOlsen »

Hi all,

Has anyone else been having some issues getting the "Sacred 3" QuickBMS script to work properly? I'd be happy to upload some samples if required. I should mention my machine has 56gb of memory, so I don't think lack of memory is the issue.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

@GarryOlsen
Probably the script is not fully compatible with that version of the game.
I guess there are better tools for Sacred 3, I can't help much.
Please note that you are off-topic here because this topic is only for bugs and errors in the quickbms tool (not the scripts)
GarryOlsen
Posts: 11
Joined: Sun May 02, 2021 5:45 am

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by GarryOlsen »

aluigi wrote:@GarryOlsen
Probably the script is not fully compatible with that version of the game.
I guess there are better tools for Sacred 3, I can't help much.
Please note that you are off-topic here because this topic is only for bugs and errors in the quickbms tool (not the scripts)


Ah sorry, I posted that at 3am in my timezone, wasn't thinking straight, I'll be sure to post it in another topic! I only came here because unfortunately the "Sacred 3" community is practically non-existent, and this is the only script/tool I could find that is capable of unpacking "Sacred 3"'s archives.
falta
Posts: 23
Joined: Fri Jun 08, 2018 12:57 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by falta »

Image

is there any solution?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

@falta
Yes, the solution is posting in the topic viewtopic.php?f=9&t=1005 because you are off-topic here...
falta
Posts: 23
Joined: Fri Jun 08, 2018 12:57 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by falta »

aluigi wrote:@falta
Yes, the solution is posting in the topic viewtopic.php?f=9&t=1005 because you are off-topic here...



I didn't see any explanation about it there.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by spiritovod »

It seems there is an issue with allocation in latest quickbms. Attached script is producing access violation error for this file. Previous version (0.10.1) doesn't produce this error and it can be also avoided by commenting second putvarchr.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by spiritovod »

And another access violation error issue - if you'll extract this package and run get_content.bat from it. Previous version (0.10.1) doesn't produce this error. Also, you'll run the script in a usual way (by opening quickbms, etc), this error will not pop up either.
Last edited by spiritovod on Sat Nov 27, 2021 10:36 pm, edited 1 time in total.
ticky
Posts: 1
Joined: Sun Jul 11, 2021 7:31 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by ticky »

Currently seeing errors building 0.11.0 on either Linux or macOS, where it can't find symbols from libtcc. I suspect there's potentially a step missing from the Makefile as it stands?

Code: Select all

gcc-11 quickbms.c -m32 -s -O2 -fstack-protector-all -fno-unit-at-a-time -fno-omit-frame-pointer -fno-pie -fPIC -w -o quickbms \
\
-D_7ZIP_ST -DE_INVALIDARG=-1 \
\
-Ilibs/zlib libs/zlib/*.c compression/*.c* encryption/*.c* libs/lzma/LzmaDec.c libs/lzma/Lzma2Dec.c libs/lzma/Bra86.c libs/lzma/LzFind.c libs/lzma/LzmaEnc.c libs/lzma/Lzma2Enc.c libs/mspack/*.c libs/ppmd_7zip/*.c libs/ppmd/*.cpp libs/aplib/src/depacks.c libs/aplib/lib/coff/aplib.lib -Ilibs/brieflz/include libs/brieflz/src/depacks.c libs/brieflz/src/brieflz.c compression/jcalg1_static.lib libs/zziplib/*.c libs/bcl/*.c libs/szip/*.c libs/lzhl/*.cpp libs/tdcb/*.c extra/mem2mem.c libs/libkirk/*.c libs/7z_advancecomp/*.cc libs/iris/*.cpp libs/old_cabextract/lzx.c libs/mrci/*.cpp libs/lz4/*.c libs/snappy/snappy.cc libs/snappy/snappy-c.cc libs/snappy/snappy-stubs-internal.cc libs/snappy/snappy-sinksource.cc libs/mmini/mmini_huffman.c libs/mmini/mmini_lzl.c libs/clzw/lzw-dec.c libs/clzw/lzw-enc.c libs/lzlib/lzlib.c libs/blosc/blosclz.c libs/blosc/fastcopy.c libs/gipfeli/*.cc libs/liblzg/src/lib/decode.c libs/liblzg/src/lib/encode.c libs/liblzg/src/lib/checksum.c libs/doboz/*.cpp libs/sphlib/c/*.c libs/shadowforce/*.cpp libs/zstd_aluigi/common/*.c libs/zstd_aluigi/compress/*.c libs/zstd_aluigi/decompress/*.c libs/zstd_aluigi/dictBuilder/*.c libs/zstd_aluigi/legacy/*.c -Ilibs/zstd_aluigi -Ilibs/zstd_aluigi/common -Ilibs/zstd_aluigi/legacy libs/azo/unAZO.cpp libs/azo/Decoder/MainCodeD.cpp libs/azo/Common/x86Filter.cpp libs/nintendo_ds/*.c libs/ctw/*.c libs/grzip/libgrzip.c libs/heatshrink/heatshrink_decoder.c libs/heatshrink/heatshrink_encoder.c libs/libzling/*.cpp -Ilibs/ecrypt/include -Ilibs/libcsc -D_7Z_TYPES_ libs/libcsc/csc_dec.cpp libs/libcsc/csc_default_alloc.cpp libs/libcsc/csc_filters.cpp libs/libcsc/csc_memio.cpp -DDENSITY_FORCE_INLINE=inline -Drestrict=__restrict__ libs/density/src/*.c libs/density/src/algorithms/*.c libs/density/src/algorithms/chameleon/core/*.c libs/density/src/algorithms/cheetah/core/*.c libs/density/src/algorithms/lion/core/*.c libs/density/src/algorithms/lion/forms/*.c libs/density/src/buffers/*.c libs/density/src/structure/*.c libs/spookyhash/*.c -Ilibs/brotli/include libs/brotli/dec/*.c libs/brotli/enc/*.c libs/brotli/common/*.c libs/libbsc/adler32/adler32.cpp libs/libbsc/bwt/bwt.cpp libs/libbsc/coder/coder.cpp libs/libbsc/coder/qlfc/qlfc.cpp libs/libbsc/coder/qlfc/qlfc_model.cpp libs/libbsc/filters/detectors.cpp libs/libbsc/filters/preprocessing.cpp libs/libbsc/libbsc/libbsc.cpp libs/libbsc/lzp/lzp.cpp libs/libbsc/platform/platform.cpp libs/libbsc/st/st.cpp libs/shoco/shoco.c libs/ms-compress/src/*.cpp libs/lzjody/lzjody.c libs/lzjody/byteplane_xfrm.c disasm/disasm.c disasm/cmdlist.c disasm/assembl/assembl.c -DMYDOWN_SSL -DMYDOWN_GLOBAL_COOKIE libs/mydownlib/mydownlib.c libs/TurboRLE/trlec.c libs/TurboRLE/trled.c libs/TurboRLE/ext/mrle.c libs/lhasa/lib/*_decoder.c libs/lhasa/lib/crc16.c libs/dipperstein/*.c libs/liblzf/lzf_d.c libs/liblzf/lzf_c_best.c libs/zopfli/*.c libs/lzham_codec/lzhamcomp/*.cpp libs/lzham_codec/lzhamdecomp/*.cpp libs/lzham_codec/lzhamlib/*.cpp -Ilibs/lzham_codec/include -Ilibs/lzham_codec/lzhamcomp -Ilibs/lzham_codec/lzhamdecomp -DLZHAM_ANSI_CPLUSPLUS libs/dmsdos/*.c libs/tornado/Tornado.cpp libs/tornado/Common.cpp libs/PKLib/*.c extra/mybits.c libs/lz5/lz5*.c libs/lizard/*.c libs/ppmz2/*.c* libs/libdivsufsort/*.c libs/xxhash/*.c extra/xalloc.c libs/lzfse/src/*.c libs/hsel/myhsel.cpp libs/hsel/HSEL.cpp libs/glza/GLZAmodel.c -Ilibs/lzo/include libs/lzo/src/*.c -Ilibs/ucl -Ilibs/ucl/include libs/ucl/src/n*.c libs/ucl/src/alloc.c libs/liblzs/lzs-compression.c libs/liblzs/lzs-decompression.c libs/bzip2/*.c libs/zlib/contrib/infback9/*.c libs/lzw-ab/lzw-lib.c libs/cryptohash-sha1/*.c -Ilibs/capstone/include libs/capstone/*.c -DCAPSTONE_X86_ATT_DISABLE -DCAPSTONE_USE_SYS_DYN_MEM -DCAPSTONE_HAS_ARM -DCAPSTONE_HAS_ARM64 -DCAPSTONE_HAS_MIPS -DCAPSTONE_HAS_X86 -DCAPSTONE_HAS_POWERPC -DCAPSTONE_HAS_SPARC -DCAPSTONE_HAS_SYSZ -DCAPSTONE_HAS_XCORE libs/capstone/arch/AArch64/*.c libs/capstone/arch/ARM/*.c libs/capstone/arch/Mips/*.c libs/capstone/arch/PowerPC/*.c libs/capstone/arch/Sparc/*.c libs/capstone/arch/SystemZ/*.c libs/capstone/arch/X86/*.c libs/capstone/arch/XCore/*.c libs/lua/src/*.c extra/quickrva.c libs/tiny-regex-c/re.c \
\
 \
\
-static-libstdc++ -lstdc++ -lm -lpthread -static-libgcc -lssl -lcrypto -DDISABLE_MCRYPT -DDISABLE_TOMCRYPT -ldl
ld: /tmp/cc56sg2y.o: in function `os_tmpname':
loslib.c:(.text+0x1e6): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
ld: /tmp/ccDr1osw.o: in function `TCC_libtcc_symbols':
quickbms.c:(.text+0x4b117): undefined reference to `__ashldi3'
ld: quickbms.c:(.text+0x4b12a): undefined reference to `__ashrdi3'
ld: quickbms.c:(.text+0x4b13d): undefined reference to `__divdi3'
ld: quickbms.c:(.text+0x4b150): undefined reference to `__lshrdi3'
ld: quickbms.c:(.text+0x4b163): undefined reference to `__moddi3'
ld: quickbms.c:(.text+0x4b176): undefined reference to `__udivdi3'
ld: quickbms.c:(.text+0x4b189): undefined reference to `__umoddi3'
ld: /tmp/ccDr1osw.o: in function `perform_compression':
quickbms.c:(.text+0x61e31): undefined reference to `packfire'
ld: quickbms.c:(.text+0x61e94): undefined reference to `DMSUNP'
ld: quickbms.c:(.text+0x61ee2): undefined reference to `LhDecode'
ld: quickbms.c:(.text+0x61f15): undefined reference to `UTSQ80'
ld: quickbms.c:(.text+0x61f48): undefined reference to `UTSQ61'
ld: quickbms.c:(.text+0x64a0a): undefined reference to `crunchmania_FastDecruncherHuff'
ld: quickbms.c:(.text+0x64a55): undefined reference to `crunchmania_FastDecruncher'
ld: quickbms.c:(.text+0x64a9a): undefined reference to `UCRMAS'
ld: quickbms.c:(.text+0x64ae2): undefined reference to `stonecracker403'
ld: quickbms.c:(.text+0x64b3d): undefined reference to `stonecracker3'
ld: quickbms.c:(.text+0x64ba5): undefined reference to `stonecracker2'
ld: quickbms.c:(.text+0x64c0f): undefined reference to `pp_DecrunchBuffer'
ld: quickbms.c:(.text+0x64c58): undefined reference to `crunchmania_17b'
ld: quickbms.c:(.text+0x64cb1): undefined reference to `ByteKiller2'
ld: quickbms.c:(.text+0x64d2d): undefined reference to `DeCr00'
ld: quickbms.c:(.text+0x64da9): undefined reference to `UPHD'
ld: quickbms.c:(.text+0x64e15): undefined reference to `UPCOMP'
ld: quickbms.c:(.text+0x64e5c): undefined reference to `ISC3P'
ld: quickbms.c:(.text+0x64ea3): undefined reference to `ISC2P'
ld: quickbms.c:(.text+0x64eea): undefined reference to `ISC1P'
ld: quickbms.c:(.text+0x64f4a): undefined reference to `IAMATM'
ld: quickbms.c:(.text+0x64fa7): undefined reference to `IAMICE'
ld: quickbms.c:(.text+0x64feb): undefined reference to `UFLSP'
ld: quickbms.c:(.text+0x6503b): undefined reference to `BYTUNP'
ld: quickbms.c:(.text+0x65400): undefined reference to `UTETR'
ld: quickbms.c:(.text+0x65447): undefined reference to `USPIKE'
ld: quickbms.c:(.text+0x6548e): undefined reference to `PACIT'
ld: quickbms.c:(.text+0x654d5): undefined reference to `UMEGA'
ld: quickbms.c:(.text+0x65518): undefined reference to `MAX12'
ld: quickbms.c:(.text+0x6555b): undefined reference to `UMAST31'
ld: quickbms.c:(.text+0x655a1): undefined reference to `LIGHT15'
ld: quickbms.c:(.text+0x655fc): undefined reference to `UNDIMP'
ld: quickbms.c:(.text+0x65641): undefined reference to `TRY101'
ld: quickbms.c:(.text+0x65686): undefined reference to `time_decrunch'
ld: quickbms.c:(.text+0x656cc): undefined reference to `UTUC'
ld: quickbms.c:(.text+0x6bcc5): undefined reference to `UCMAT'
ld: /tmp/ccDr1osw.o: in function `amiga_unsquash':
quickbms.c:(.text+0x2a71a): undefined reference to `UnSquash'
collect2: error: ld returned 1 exit status
make: *** [Makefile:54: all] Error 1


On aarch64 macOS, specifically, there are some issues caused by the way architectures are detected in at least two files (I have yet to successfully compile due to a similar issue to that above), where compression/prelude.h line 93 should be changed to

Code: Select all

#if (defined (__64BIT__) || defined (__x86_64__) || defined (__aarch64__))
and libs/tornado/Common.h line 30 should be changed to

Code: Select all

#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__)|| defined (__aarch64__)
to properly detect this architecture. With those files patched, the error becomes as follows:

Code: Select all

Undefined symbols for architecture arm64:
  "___ashldi3", referenced from:
      _TCC_libtcc_symbols in ccN7ge8i.o
  "___ashrdi3", referenced from:
      _TCC_libtcc_symbols in ccN7ge8i.o
  "___divdi3", referenced from:
      _TCC_libtcc_symbols in ccN7ge8i.o
  "___lshrdi3", referenced from:
      _TCC_libtcc_symbols in ccN7ge8i.o
  "___moddi3", referenced from:
      _TCC_libtcc_symbols in ccN7ge8i.o
  "___udivdi3", referenced from:
      _TCC_libtcc_symbols in ccN7ge8i.o
  "___umoddi3", referenced from:
      _TCC_libtcc_symbols in ccN7ge8i.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make: *** [all] Error 1


Hoping you can help! :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

@spiritovod
Thanks, added to the list of things to check.

@ticky
Yeah the Makefile is still far from being universal but it worked very well here on Linux, MacOSX, and Android, obviously it's enough that some settings or compiler versions differ to raise compatibility issues.
So for amiga it should be enough to enable it in the Makefile.

While for the __* references it's caused by src/utils.c at 4205 where the "#if defined(i386)" and relative "#endif" should include the whole libtcc.a section (which I will do in next version).
ATIMKOS
Posts: 1
Joined: Sun Jul 18, 2021 12:57 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by ATIMKOS »

I have this error when try unpack GAME8.DAT from Lego Marvel Super Heroes 2
Image
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by Shokoniraya »

hello sir aluigi, i want to report two problem


1) reimporting a file again with same name
normally, there is no such problem at all in normal using, but i attached a file in this comment to show the problem

extract zip file and put quickbms_4gb_files.exe in folder and click on run.bat
as you can see, last printed filesize is 0, but why? this happens only if a name like TEXT_SLOT used before in same operation (by operation i mean same running process)

now, import_again.bin file is corrupted, right? well extract from zip again. and open import_again.bms and goto line 38 and remove that append command (anyway, you can left other append command in line 40, no problem with that. maybe not?)
and click on run.bat again, see? it works, but why? this command shouldn't involved with current procces because it is in a else<>endif that not used, i think it's a bug




2) replacing with putdstring
i'm not going to say that it's a problem, let me explain

for example, we have a binary file, binary is "123456789"
and this is script file wity -w option

Code: Select all

goto 0
append -1
putdstring "NEW_DATA" 4


result is "NEW_123456789"
it can inject bytes as well in real file or MEMORY_FILE, no problem with that
but what about removing or replacing some bytes? i mean not just inject them with append -1
i have a idea, maybe you should change it to get such result "NEW_DATA56789", i think current way is totally wrong, maybe you should make a repdstring "NEW_DATA" 4 to do the job or you can use negative number like putdstring "NEW_DATA" -4 to get "NEW_DATA56789" if append -1 used, otherwise there will be a allocation problem and i know it, that's way that i said if append -1 used
Nameless
Posts: 25
Joined: Tue Dec 20, 2016 8:18 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by Nameless »

Using array bigger than 4092 bytes in a C function throws error:
tcc: error: undefined symbol '__chkstk'

Example:

Code: Select all

set MEMORY_FILE binary "
void test()
{
   char huh[8192] = {0};
}"

calldll MEMORY_FILE "test" "tcc" ""
mbc07
Posts: 12
Joined: Sun Oct 13, 2019 7:19 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by mbc07 »

(deleted)
mandogy
Posts: 1
Joined: Thu Sep 02, 2021 10:48 am

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by mandogy »

Is there an issue with the script for 1KAP (Run Sackboy Run)?
I attempted running it on both the 1.01 file as well as the latest update file, neither work.
(The obb is the 1kap file)
I never found a 1.00 OBB download, only the APK.
Image

Sorry if this is a stupid error, I couldn't find anything when googling.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

@ATIMKOS
Does it happen with quickbms 0.10.1 too?

@Shokoniraya
Maybe it's something I will check when I will work on new version but it takes too much time to understand if there is any problem at all... definitely something I want to avoid

@mandogy
Please open a topic in the Game Archive section and upload/link that file, if the obb file is too big (over 500Mb) it's better if you upload only the two files generated by the filecutter script http://aluigi.org/bms/filecutter.bms
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

@spiritovod
I was trying to access two files you linked above months ago but I get a "Sign-in" request, could you please make them available again?
https://drive.google.com/file/d/1_0b2DE ... sp=sharing
https://drive.google.com/file/d/15_wCEG ... sp=sharing

(I'm slowly trying to check some quickbms bugs for a possible beta, yeah)
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by spiritovod »

aluigi: I'm afraid those uploads can't be restored. I've updated link for the second issue, but for the first one I can't remember which package caused such issue and currently there are 5+ games with this package format, so it will take a while to find problem one. Sorry for the inconvenience.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

*edit* I was totally wrong, checking the bug again...

So bad for the other file.
The script is quite simple and the only compression algorithms are zlib, lz4 and lzma that usually don't cause crash.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

Ok the problem with -F was that the pak archive was loaded as list of files (first tentative as file, second as string) and there was a "for(i = 0; ret[i]; i++)" invoked on a NULL ret.

I can add a check on NUL bytes in the filter in case the -F FILE is not a proper text file.

I found an apk for that DragonRaja game but I get no errors on its PNG archives.