ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Fri Nov 27, 2020 3:19 am

All times are UTC




Post new topic  Reply to topic  [ 496 posts ]  Go to page Previous 121 22 23 24 25
Author Message
PostPosted: Sat Nov 14, 2020 1:49 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 353
importing based on id's works
and there is a problem, when a text file is missing, slog gives error

- error in src\file.c line 2113: dumpa_slog()
Error: No such file or directory


can you ignore it for missing files of slog?


Top
   
PostPosted: Sat Nov 14, 2020 7:49 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11814
Great, thanks for testing.

Ok I will remove the slog error later.
Since the slog text is just like the other extracted files, there should be no error displayed in reimport mode if missing.


Top
   
PostPosted: Tue Nov 17, 2020 2:59 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 353
sir aluigi, text importing with id's has three problems
1) empty lines can't be passed (or even lines with unused texts)
2) i think some id's that include = character can't be import as well. maybe = should replace with something like \x3D in id's

3) can't import unsorted id's (if they unsorted by hand)
for example
Code:
1=text_1
3=text_3
2=text_2


Attachments:
slog_problem.rar [540 Bytes]
Downloaded 15 times
Top
   
PostPosted: Tue Nov 17, 2020 11:39 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11814
Exactly, the strings must keep the original order.
Empty lines are just considered strings.
And no, the ID can't contain the = character (why an id should have it?).

So let's say the original slog was:
Code:
1=text_1
2=text_2
3=text_3

The new slog can be:
Code:
2=text_2
3=text_3

The code is exactly the same sequential code for both with and without IDs, the only difference is that quickbms will not go forward until it finds the expected id.
So in the example you provided (1,3,2) it will import the strings 1 and 3 but will ignore 2.
If you used 1,3,2,4 it would have ignored both 2 and 4.
The correct one was 1,3,4.

The reason why I can't change this behaviour is that you can have multiple slog with different settings for the ID.
Everything works if you just delete original line without altering the original structure of the slog file.


Top
   
PostPosted: Tue Nov 17, 2020 2:59 pm 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 247
Not an actual error, but I wonder if syntax errors handling can be improved. Currently, in most cases you can only see c_structs message somewhere in the header and the script continue to work, but with unexpected results. I think it's worth to make it more noticeable.
For example, script like this will actually read SIZE, but starting from second byte, which is not obvious:
Code:
string NAME "test"
get SIZE long
print "Size: %SIZE|hex%"

For data like 0x0102030405 it will be "Size: 0x0000000005040302".


Top
   
PostPosted: Tue Nov 17, 2020 4:05 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11814
I agree, the c_structs messages are almost invisible.
Maybe I can use a red color for those c_structs message so that they will be immidiately visible.

The idea of using console colors is not new and I think it would be useful for me too, as long as I will not make quickbms an xmas tree :D

Do you think the color may be helpful with that c_structs issue?


Top
   
PostPosted: Tue Nov 17, 2020 7:47 pm 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 247
The problem is not the color, but the fact, that you can't tell it's some kind of error. If you don't know what it is exactly, you can think that it's a part of header message (this error is laughable, but a good example), along with used script and input/output folders. In all programming languages you usually expect that code stop working at syntax error, but quickbms just ignores them when possible, which can confuse you at some point, especially with big complicated scripts, if an accident typo will slip in.

_________________
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 Nov 17, 2020 8:21 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11814
I understand.
A part from the colors I don't think there is a possible solution.

The support for the structures is quite useful sometimes even if it's experimental, but there is no way to understand if it's an error or it's meant to be that way.

I'm open to ideas.


Top
   
PostPosted: Tue Nov 17, 2020 11:10 pm 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 247
I don't quite understand - is there a situation when you would see "structs" message, but the script will work as expected? I thought that any "structs" appearance would imply some kind of error in the script or while parsing the data. If that the case, it's probably possible to add "error" / "warning" prefix to this message, along with some highlighters, like this:
---------------------
error: c_structs ...
---------------------

This way it surely will be noticeable. Ideally, position in the script when it appeared would be nice too. For example, "error at line 10: c_structs ...". It's just a suggestion though.

_________________
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: Wed Nov 18, 2020 2:08 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 353
sir aluigi, i understand that importing function forwards with .txt while it's about to be reading
but maybe you can use a different solution. i mean read a .txt from beginning (form first line each time when slog importing function starts)
i know maybe it's a dummy idea and make it slower, but it works
or you could upload txt files in memory and make a binary table (TOC) with id strings and offsets in memory from those txt files to read it faster


Top
   
PostPosted: Wed Nov 18, 2020 8:00 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11814
@spiritovod
This is an example of where I found the c_structs feature very useful:
http://aluigi.org/bms/parse_exe.bms

@Shokoniraya
There is not much to do.


Top
   
PostPosted: Wed Nov 18, 2020 11:44 am 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 247
Actually it's the first time I see its proper usage. Then maybe it's possible to add command-line option that will let quickbms know that structs are expected in the script - otherwise they will be considered as errors/warnings. Default state will be without structs (I believe they're rarely used).

_________________
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: Wed Nov 18, 2020 12:08 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11814
I don't know how many people use it in their scripts.
An additional command-line option would make their scripts no longer working.

The alternative to the colors would be to a warning asking the user to confirm if going forward, something like already happens when using calldll.
It's a bit annoying for users.


Top
   
PostPosted: Wed Nov 18, 2020 12:54 pm 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 247
Why though? You can simply add additional message, so by default (with structs disabled) it will be like this:
"error: c_structs ...
If you're using structs in you script, launch quickbms with [-option]"
or something and terminate script execution after the first error like this. This way they will be aware of the change even if they didn't read updated docs.

_________________
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: Sat Nov 21, 2020 6:07 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11814
Ok I released the new beta which asks if going forward if there is a syntax error.
For avoiding the message I used the -c option in quickbmsver, it's not documented yet since it's just a test, on command-line that option is used to display the list of commands therefore it's unused in quickbmsver.

I also added a new argument for the Get command.
Even if I don't like to make the commands too complicated, I think this new argument may be interesting since it's the offset where we want to use the Get command.

Example with the normal savepos+goto+get+goto:
Code:
get NAME_OFF long
savepos TMP
goto NAME_OFF
get NAME string
goto TMP
Now:
Code:
get NAME_OFF long
get NAME string 0 NAME_OFF


Top
   
PostPosted: Sat Nov 21, 2020 9:30 pm 

Joined: Sat Sep 28, 2019 7:00 pm
Posts: 247
Thank you, that new errors handling is much clearer, I hope it will be helpful for newcomers.

_________________
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
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 496 posts ]  Go to page Previous 121 22 23 24 25

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