script dont work with reimport2

Doubts, help and support about QuickBMS and other game research tools
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

script dont work with reimport2

Post by gameside »

Hi, I'm just started working with QuickBMS, so I don't know much about it
I create this script to extract sound from uexp files from a game, it can export and import files with less or equal size, but I cant import bigger files
i know its very messy :) sorry about that

Code: Select all

GETDSTRING UNKNOW 143
GET TEXT_NUM byte
GETDSTRING UNKNOW 87

for i = 1 <= TEXT_NUM
   GET GUID_long  long
   if GUID_long == "33"
      GETDSTRING GUID GUID_long
      GET STRING_long long
      GETDSTRING STRING_text STRING_long
      GETDSTRING UNKNOW 72
   else
      GETDSTRING UNKNOW 67
   endif
next i

GETDSTRING UNKNOW 26
GET OGG_SIZE long
GET OGG_SIZE long
GET UNKNOW longlong
Savepos OFFSET

LOG "file.ogg" OFFSET OGG_SIZE


anyone can help me?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: script dont work with reimport2

Post by aluigi »

In that specific case you may try reimport3, it's a special mode that you can activate using -r -r -r at command-line.
If you don't know how to do it, use this bat file:

Code: Select all

quickbms.exe -G -w -r -r -r

In short it's made for enlarging the whole archive for putting the new file back in the original position.
saeid0034
Posts: 40
Joined: Sat Mar 14, 2020 7:17 pm

Re: script dont work with reimport2

Post by saeid0034 »

aluigi wrote:In that specific case you may try reimport3, it's a special mode that you can activate using -r -r -r at command-line.
If you don't know how to do it, use this bat file:

Code: Select all

quickbms.exe -G -w -r -r -r

In short it's made for enlarging the whole archive for putting the new file back in the original position.

i test it, and its worked well
one other thing, as you know file size repeat two time in uexp files
Image
how can I update both of them in re-import
Last edited by saeid0034 on Wed Nov 25, 2020 6:12 pm, edited 1 time in total.
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

Re: script dont work with reimport2

Post by gameside »

aluigi wrote:In that specific case you may try reimport3, it's a special mode that you can activate using -r -r -r at command-line.
If you don't know how to do it, use this bat file:

Code: Select all

quickbms.exe -G -w -r -r -r

In short it's made for enlarging the whole archive for putting the new file back in the original position.

thanks its worked
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: script dont work with reimport2

Post by aluigi »

saeid0034 wrote:one other thing, as you know file size repeat two time in uexp files
how can I update both of them in re-import

That's the only problem of the reimport feature when we have a table supporting compression and we meed a comparison of the compressed and uncompressed size for handling the file.
Usually there is often another field saying if a file is compressed, probably also here, but in case there is none the following solution may work:

Code: Select all

get ZSIZE long
get SIZE long
comtype copy
clog "output.dat" OFFSET ZSIZE SIZE
There are two different variables because if you use the same, only the second field will be changed.

Another solution is using the optional field of Log instead of CLog:

Code: Select all

get ZSIZE long
get SIZE long
log "output.dat" 8 SIZE 0 SIZE

It's a particular situation that can't be automatically handled by quickbms because the reimport mode just work on the arguments of Log and Clog.
saeid0034
Posts: 40
Joined: Sat Mar 14, 2020 7:17 pm

Re: script dont work with reimport2

Post by saeid0034 »

aluigi wrote:Another solution is using the optional field of Log instead of CLog:

Code: Select all

get ZSIZE long
get SIZE long
log "output.dat" 8 SIZE 0 SIZE

Thank you, its did the job
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

Re: script dont work with reimport2

Post by gameside »

I face another problem, I hope someone help me again
I successfully get string and ogg from most of my uexp files
Image
but in some files, QuickBMS give me following error
Image
text string are different in these files
Image

what can I do to get text from these files too?
Thanks
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: script dont work with reimport2

Post by aluigi »

It's a feature of the Unreal Engine for storing utf16 strings, replace the following:

Code: Select all

      GET STRING_long long
      GETDSTRING STRING_text STRING_long
with:

Code: Select all

      GET STRING_long signed_long
      if STRING_long < 0
        math STRING_long n STRING_long
        math STRING_long * 2
        GETDSTRING STRING_text STRING_long
        set STRING_text unicode STRING_text
      else
        GETDSTRING STRING_text STRING_long
      endif
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

Re: script dont work with reimport2

Post by gameside »

aluigi wrote:It's a feature of the Unreal Engine for storing utf16 strings, replace the following:

Code: Select all

      GET STRING_long long
      GETDSTRING STRING_text STRING_long
with:

Code: Select all

      GET STRING_long signed_long
      if STRING_long < 0
        math STRING_long n STRING_long
        math STRING_long * 2
        GETDSTRING STRING_text STRING_long
        set STRING_text unicode STRING_text
      else
        GETDSTRING STRING_text STRING_long
      endif

thanks, its worked perfect
I found something else I could not understand in QuickBMS
why this script print same?

Code: Select all

set SIGN_1      binary "\x0A"  
set SIGN_2      binary "\x09" 

if SIGN_1 == SIGN_2
   print "same"
else
   print "different"
endif
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: script dont work with reimport2

Post by aluigi »

Definitely a bug, I'm going to check and fix it in the upcoming version of quickbms.

*edit* In short is myisdechex_string() that invokes readbase() which ignores the non-textual chars and therefore says that it's a number.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: script dont work with reimport2

Post by aluigi »

Just fixed in the beta.
The new beta quickbms.exe is here:
https://aluigi.altervista.org/beta/quickbms_exe.zip