ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Aug 04, 2020 2:00 am

All times are UTC




Post new topic  Reply to topic  [ 440 posts ]  Go to page Previous 118 19 20 21 22 Next
Author Message
PostPosted: Sun Feb 09, 2020 1:24 pm 

Joined: Fri Dec 15, 2017 1:42 pm
Posts: 35
Issue with the "continue" instruction:
Code:
set Flag long 0
set i long 0
set j long 0
for i = 0 < 3
   print "i = %i%"
   if Flag == 0
      math Flag = 1
      continue
   else
      math Flag = 0
   endif
   print "*** Message before embedded loop ***"
   for j = 0 < 4
      print "\tj = %j%"
   next j
next i

Image

Of course it's easy to bypass it by placing the code withing an If...EndIf.


Top
   
PostPosted: Sun Feb 09, 2020 4:46 pm 

Joined: Fri Dec 15, 2017 1:42 pm
Posts: 35
aluigi wrote:
The problem is related to the pre-allocation of the arrays like "putarray 0 totalFileNum 0 # fileID" that indeed adds a new element in the array.
...
If you remove pre-allocation everything is ok...

Usually pre-allocation is not necessary for arrays.

Sorry that I didn't see this in time. It's just that the doc of QuickBMS says "it's highly suggested to pre-allocate the array if you know the max value, example: PutArray 0 FILES 0". I've tested that if you allocate (totalFileNum - 1) elements and adjust the counter afterward it can produce the correct result. So for performance reasons is this routine still necessary?


Top
   
PostPosted: Fri Feb 14, 2020 3:11 am 

Joined: Tue Dec 20, 2016 8:18 pm
Posts: 24
BCGhost wrote:
Issue with the "continue" instruction:
Code:
set Flag long 0
set i long 0
set j long 0
for i = 0 < 3
   print "i = %i%"
   if Flag == 0
      math Flag = 1
      continue
   else
      math Flag = 0
   endif
   print "*** Message before embedded loop ***"
   for j = 0 < 4
      print "\tj = %j%"
   next j
next i

You can use this solution: break to label.
Code:
set Flag long 0
for i = 0 < 3
   print "i = %i%"
   if Flag = 0
      math Flag = 1
      break here
   else
      math Flag = 0
   endif
   print "*** Message before embedded loop ***"
   for j = 0 < 4
      print "\tj = %j%"
   next j
here:
next i

Though labels are also broken in some cases, for example, when you use them in functions then jump backwards doesn't work properly.


Top
   
PostPosted: Tue Mar 03, 2020 3:14 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
@Nameless
"continue" and break to label are some sort of experiment, I know.

Instead regarding the problem you reported about CRC calculation, do you have any script for replicating the problem?
And is it related to NameCRC or to "Encryption crc"?


Top
   
PostPosted: Tue Mar 03, 2020 3:18 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
@GHOST DEAD
MEMORY_FILEs aren't touched in reimport mode because they are usually used for moving data from the original archive to a temporary location.
Reimporting can only work from real file to archive and (experimentally) from some MEMORY_FILEs to archive.


Top
   
PostPosted: Wed Mar 04, 2020 8:06 pm 

Joined: Tue Dec 20, 2016 8:18 pm
Posts: 24
aluigi wrote:
Instead regarding the problem you reported about CRC calculation, do you have any script for replicating the problem?
And is it related to NameCRC or to "Encryption crc"?

It is related to encryption. I didn't check namecrc, so I can't tell whether it is also affected.
And here is the test script you asked. Feed any standard text file to it, you will see that error rate is very high.


Attachments:
heck.7z [1.79 KiB]
Downloaded 213 times
Top
   
PostPosted: Thu Mar 05, 2020 5:00 pm 

Joined: Thu Mar 05, 2020 4:48 pm
Posts: 1
An error occurs while trying to unpack the .archive file using https://aluigi.altervista.org/bms/deus_ex_mankind_divided.bms script
Quote:
$ quickbms_4gb_files.exe deus_ex_mankind_divided.bms "C:\Program Files (x86)\Steam\steamapps\common\Deus Ex Mankind Divided\DLC\runtime\DLC02.layer.0.all.archive" outdir

... some time later ...

- error in src\extra\xalloc.c line 703: xdbg_realloc()
Error: memory allocation problem


Top
   
PostPosted: Tue Mar 10, 2020 10:40 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
@Daftendirekt
That's game-related, probably the script is not updated or doesn't support that specific archive. Or you are using an old version of quickbms.
In any case you should post in the topic of the game, not here.


Top
   
PostPosted: Fri Mar 20, 2020 10:35 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 294
i found two problem in QuickBMS

1: -e command will make quickbms slow (not a problem, but i reported it anyway)
2: xmath cant handle x as well, [xmath VAR "15 x 16]


Top
   
PostPosted: Sat Mar 21, 2020 2:13 pm 
User avatar

Joined: Sat Mar 14, 2020 7:17 pm
Posts: 29
recently i use a script name assassin_creed_raw.bms for decompress assassin creed odyssey data file (i export data from forge with Ubisoft_Forge_Tool)
script Successfully extracts DATA files and give me 2 DAT file
but when i try to import dat file into data again (with reimport.bat) it failed
Image
. can anyone make a new script (for decompress and compress data file again) for assassin creed odyssey?
A tool already built for this task (Ubisoft_DATA_Tool_By_Delutto) but it cant import file again into data (also it looks like its developer has stopped working on this program)


Top
   
PostPosted: Thu Mar 26, 2020 8:28 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
@saeid0034 and @greenlemonade1:
Off-topic

@sergop
Regarding tar.bms you don't need to use quickbms for that job, it's just the classical tar supported by tons of utilities and obviously tar itself :D

The technical reason behind quickbms refusing to reimport the files is that tar.gz (tgz) is a compressed tar archive, so quickbms must first decompress it in memory and then extract the files.
In reimport mode you need to directly work on the archive on the disk, no MEMORY_FILE, or the changes can't go on the original archive.


Top
   
PostPosted: Sat Mar 28, 2020 8:42 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
@Shokoniraya

1)
the only two things done by the -e command is zeroing the memory of the output buffer and then returning the output size in case of errors.
I suspect that the slowness you are experiencing is caused by zeroing the output memory which may be time consuming with some large files.

2)
'x' can't be directly used in xmath because alphabetic characters may be misinterpreted with variables, that's why exist an alternative way for specifying tons of operators by using the '?' prefix, for example ?add instead of +.
What I noticed is that ?align and the other alternative operators don't seem to work correctly for reasons I will investigate.
Thanks for reporting.


Top
   
PostPosted: Fri Apr 03, 2020 9:12 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
Nameless wrote:
aluigi wrote:
Instead regarding the problem you reported about CRC calculation, do you have any script for replicating the problem?
And is it related to NameCRC or to "Encryption crc"?

It is related to encryption. I didn't check namecrc, so I can't tell whether it is also affected.
And here is the test script you asked. Feed any standard text file to it, you will see that error rate is very high.

Sorry for the late reply.
What I can say in the meantime is that this issue happens only when using the "e/E" operators of the String command.
Using "log" works perfectly.
Even using "string CHSTR E CHSTR" (VAR1 same as VAR2) produces the correct result, even when calling MYCRC32 before it (just to avoid issues).

I will better investigate when I will work on the next version but it's clearly a bug in the length used for performing the encryption since it uses the length of the first variable instead of the second one:
Code:
            case 'E': {
                if(len1 < len2) {
                    len1 = len2;
                    ...
                }
                memcpy(var1, var2, len1);
                fixed_len = perform_encryption(var1, len1);


Top
   
PostPosted: Sun Apr 05, 2020 6:19 am 

Joined: Tue Dec 20, 2016 8:18 pm
Posts: 24
aluigi wrote:
Even using "string CHSTR E CHSTR" (VAR1 same as VAR2) produces the correct result, even when calling MYCRC32 before it (just to avoid issues).

Interesting... Good to know. Too bad that readme doesn't specify it, I always thought that VAR2 will be destroyed in such case.


Top
   
PostPosted: Sun Apr 05, 2020 10:08 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11383
Nameless wrote:
Interesting... Good to know. Too bad that readme doesn't specify it, I always thought that VAR2 will be destroyed in such case.

Because it's a bug :D
The plan was to copy the encrypted content of VAR2 in VAR1 but the bug took the lenght of VAR1 instead of VAR2


Top
   
PostPosted: Sun Apr 05, 2020 10:47 am 

Joined: Tue Dec 20, 2016 8:18 pm
Posts: 24
Glad that it will be fixed.


Top
   
PostPosted: Tue Jun 02, 2020 10:26 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 294
when i want to run a exe with a none-standard cstring name like ( or ) that should used " in beging and end of name, in execute command in bms script, command not working fine

"zlib(v2.4).exe -c #INPUT# #OUTPUT#"
or even this one: "\"zlib(v2.4).exe\" -c #INPUT# #OUTPUT#"
or this: ""zlib(v2.4).exe" -c #INPUT# #OUTPUT#"


Top
   
PostPosted: Thu Jun 04, 2020 11:19 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 294
sir aluigi

there is a problem in QuickBMS that always making some problem in text importing
there is some string like \n or \f or \e
but can you skip none cstring error? like \:

Error: cstring() failure, your input string has some wrong escape sequences or
it's not a valid escaped string


i know i should use \\:
but \: not used in cstring, right? becuase there is not any \: or \k too, so error and stop the process can't helping, then simply ignore unavailable escapes

and i know if i export that text again, it will turned to \\:
but there is no problem with that, so can you please ignore wrong escapes in next version?

thank you


Top
   
PostPosted: Fri Jun 05, 2020 2:12 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 294
sir aluigi, about cstring errors, i know there is some problems for that if you ignore it as default, but it's better to make a command option to ignore incorrect \* cstring

and about unicode converting that skips at zero, normaly if we want to read a 64 bytes that stored a name in it, it will stop at zero (null). so there must be a option to ignore zero bytes too
because of such cases
Code:
63 6F 6D 6D 6F 6E 5C 00 00 00 00 00 75 69 5C 00 common\.....ui\.
00 00 00 00 00 00 00 74 65 78 74 00 00 00 75 72 .......text...ur
00 00 65 00 00 00 5C 00 00 00 66 6E 74 5F 00 00 ..e...\...fnt_..
00 00 00 30 2E 00 00 00 00 00 66 6E 74 00 00 00 ...0......fnt...


Top
   
PostPosted: Tue Jun 09, 2020 4:11 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 294
another problem, but i don't know that if it's a QuickBMS feature or not

append -1 not working as well, i think it should add binary to start of file but has problem

please test it on a 40 byte file (you can see it better in a small file)
Code:
get SIZER asize

for i = 0 < 5
append -1
log FILE_APPEND 0 SIZER
append -1
next i


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 440 posts ]  Go to page Previous 118 19 20 21 22 Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited