ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Jul 13, 2020 4:41 am

All times are UTC




Post new topic  Reply to topic  [ 432 posts ]  Go to page Previous 118 19 20 21 22
Author Message
PostPosted: Tue Jun 09, 2020 8:37 pm 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 141
@Shokoniraya: This script doesn't make much sense to me. Usual construction will look like this (aside from that you're trying to add the same file to itself or something):
append -1
for ...
log ...
next i
append

Also, consider using MEMORY_FILE or TEMPORARY_FILE before writing actual file if possible. Otherwise you may be stuck with core logic of how quickbms is working with files. You may take a look at existing scripts using "append" for better understanding.
Anyway, proper example script and expected results would be nice.

_________________
You can request AES keys on rin forums (the list with keys is also there)
AES keys finder and latest UE4 bms scripts: in this post


Top
   
PostPosted: Tue Jun 09, 2020 8:54 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 289
append - 1 should add binary to strat of file but it has problem

and i can't dump a huge file in memory file (my system is low end), however, test it with a small file (40-byte) and you will see that binary will overwrite (not overwrite actually, a kind of problem in file enlarging)


Top
   
PostPosted: Wed Jun 10, 2020 11:24 am 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 141
Now I see what you mean, "append -1" only works for a single iteration, because it's allocating additional memory only once - on the 2nd iteration and the rest it stop allocating and start to rewrite file (like in "append 1" mode). Not sure, but it may be actually related to position checks for memfile. If you allocate required memory manually, it works fine though.

I hope aluigi will take a look at that when he has time. Also, some basic example would be appreciated, since I'm also confused with how "append 1" works - in documentation it's stated that you can choose position where to write stuff in rewrite mode with goto, but you expect that goto will work on current file. You may expect that you should open result file as 1, then something like "goto OFFSET 1" and then "log ..." into that file from memfile, but that doesn't work as expected.

_________________
You can request AES keys on rin forums (the list with keys is also there)
AES keys finder and latest UE4 bms scripts: in this post


Top
   
PostPosted: Fri Jun 19, 2020 5:17 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 289
there is two problem that i've found

1) codepage problem
when codepage used in a script, some empty folders will be create with none-codepaged names, but it just a junk folder and codepage works correctly

2) unicode names for input file
it's clear that cmd can't support unicode as well, but for %%x can be used in any file, no matter file names has space character or unicode names and quickbms can't support unicode in input name


Attachments:
problems.zip [2.09 KiB]
Downloaded 19 times
Top
   
PostPosted: Mon Jun 22, 2020 4:56 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11380
Shokoniraya wrote:
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#"

The problem is not in the string, I guess it's quickbms that uses parenthesis as escape so using " or \( doesn't solve it.

I'm quite sure there is a reason behind that behavior but I will check it when I will work on the next release

(I will slowly try to answer to all the posts, just wait)


Top
   
PostPosted: Mon Jun 22, 2020 5:00 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11380
Shokoniraya wrote:
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

Are you using strings with invalid escapes? And why?
Are you talking about the Slog command?

I probably need a complete example for understanding if it's a problem or not.

The error is necessary because people need to know if something failed.


Top
   
PostPosted: Mon Jun 22, 2020 5:02 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11380
Shokoniraya wrote:
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...

I don't know what you mean.
And that's not unicode.
Clearly a format like splitted strings for manual reassembling in different ways and not a string.


Top
   
PostPosted: Mon Jun 22, 2020 5:08 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11380
Shokoniraya wrote:
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

Ok, here I guess it's a bug because I tried 10 Log of 3 bytes each but the output is 6 bytes instead of 30.
Added to the list of things to check.

Ah, it works perfectly with MEMORY_FILE so it's only related to log to file.

Likely "append -1" is never used ;)


Top
   
PostPosted: Mon Jun 22, 2020 5:20 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11380
spiritovod wrote:
Now I see what you mean, "append -1" only works for a single iteration, because it's allocating additional memory only once - on the 2nd iteration and the rest it stop allocating and start to rewrite file (like in "append 1" mode). Not sure, but it may be actually related to position checks for memfile. If you allocate required memory manually, it works fine though.

I hope aluigi will take a look at that when he has time. Also, some basic example would be appreciated, since I'm also confused with how "append 1" works - in documentation it's stated that you can choose position where to write stuff in rewrite mode with goto, but you expect that goto will work on current file. You may expect that you should open result file as 1, then something like "goto OFFSET 1" and then "log ..." into that file from memfile, but that doesn't work as expected.

Append 1 is meant to be used on MEMORY_FILEs because you can't move on output files on disk.

The following scripts use "append 1" if interested:
http://aluigi.org/bms/bsc.bms
http://aluigi.org/bms/clutch.bms
http://aluigi.org/bms/gh_pak_chnk.bms
http://aluigi.org/bms/marvel_ultimate_alliance_2.bms (there is also a comment explaining why it gets used)
http://aluigi.org/bms/ravioli_reimporter.bms
http://aluigi.org/bms/spiderman_pcpack_nch.bms
http://aluigi.org/bms/the_order_1886.bms
http://aluigi.org/bms/zombiu.bms

Regarding the script of Shokoniraya, it's necessary to use "append" without any argument for resetting the append mode, so "append -1" + log + "append".


Top
   
PostPosted: Mon Jun 22, 2020 5:34 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11380
Shokoniraya wrote:
there is two problem that i've found

1) codepage problem
when codepage used in a script, some empty folders will be create with none-codepaged names, but it just a junk folder and codepage works correctly

2) unicode names for input file
it's clear that cmd can't support unicode as well, but for %%x can be used in any file, no matter file names has space character or unicode names and quickbms can't support unicode in input name


I will check what causes that "Ianei" folder to be created.

Regarding the second problem I can check why the name isn't correctly handled as utf8 when quickbms points to the folder, probably a bug in the function that scans the folders.


Top
   
PostPosted: Mon Jun 22, 2020 6:23 pm 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 141
^ Thanks for those examples, now I see how "append 1" should be used in different situations. Also not sure, if "append 1 -- -- append 1" is correct construction in bsc script, can you please check it?
As for the "append -1" problem, if you'll use it just once (append -1 / log to file / append) it will work as expected, so it looks more like positioning/allocating issue for multiple iterations.

_________________
You can request AES keys on rin forums (the list with keys is also there)
AES keys finder and latest UE4 bms scripts: in this post


Top
   
PostPosted: Fri Jun 26, 2020 9:06 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11380
"append 1 -- append" is the correct one.


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

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