Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


getDissectCode: any return codes? ~ Closed

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 152

PostPosted: Sat May 29, 2021 6:55 am    Post subject: getDissectCode: any return codes? ~ Closed Reply with quote

I've added this functionality to my CE template now, as I recently found out about: > getDissectCode()'s purpose
(in case one can not place this ~> View ~ Reference Functions/Strings)

The main reason why I have added this functionality now: it takes a very long time to run... and needed to rerun with every relaunch of the game (which was pretty unpractical, I felt)... untill I realised that one could actually save that analysis...
(iow one only need to run this once per EXE version !)

By now I got most situations covered so that a 'built dissectCode file' would not easily be overwritten by mistake. Still i have a few questions on the subject:
1) is there any return code upon finishing a 'Saving/loading' of such dissectCode file' ?
Usually it takes about 10~30 secs to save/load the file - so not really an issue - but it would make things a bit more userfriendly.
2) "force" a rebuild? untill one reloads the game, CE detects that the process has run already and will show its current status...
-EDIT- (i just checked CELUA), and I can probably do this by first 'Clear()'-ing its status?! ~ will test/verify/update when done...
3) check if process has already run?
Reason: if a dissect_file does not exist yet, CE will save a "dummy" file (a few bytes in size). Thereafter, I then wind up in situation 2) mentioned above...
CELUA: tells me there is a 'getReferencedStrings()' method; which probably returns an empty table in such cases...? ~ will test/verify/update when done...

ps: I got most situations covered already. Plus: this kind of stuff is for Tablemakers anyways, who can handle them bumps in the road just fine. It would just be "icing on the cake"...


Last edited by paul44 on Mon May 31, 2021 3:25 am; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sat May 29, 2021 8:46 am    Post subject: Reply with quote

1:
savetoFile and loadFromFile return true on success, and false on failure

You should be able to save/load it in a separate thread while showing the user a wait message but for the rest keeps active

2:
clear and rescan

3: You can store an identifier and use that to check if it's already parsed
e.g : md5memory(process,4096) and then check if that md5 matches the dissected list

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 152

PostPosted: Sun May 30, 2021 4:12 am    Post subject: progress status... Reply with quote

-EDIT- in an attempt to see whether I could call the Dissect applet directly, i did a search on Github... and found out that this particular form was also called by another MenuItem. Revisting MemViewer confirmed that: [Tools - Dissect code]... my bad.

Topic closed
ps: will do some testing with getReferences() later this week to see if i can use that to evaluate "already run"...
-EDIT2-
if ( getDissectCode().getReferencedStrings() == nil ) then "No Dissect Code analysis active/present !"


Prenote: I got most covered by now. So unless somebody has some additional info/suggestions to add/try out, I will be closing this topic some time next week... If i can get pt 2) resolved, that would be swell Cool

1) got it (see also timing stats below)
2) if you mean with 'rescan', run 'getDissectCode().dissect(mod)' then that is a no-go for me... (see below why)
(btw: clear() does it job pronto Smile)
3) I might interpret your suggestion incorrectly here. I assumed that I needed to get the md5 value BEFORE running the routine, then AFTER and compare both values...?!
Tried that (see info below ~ no change); also figured: perhaps getModuleSize() could help me out here; but nop...
If my assumption is incorrect, clarify 'dissected list' please?

ps: I assume this is a feature of VEH debugger, and info shown in MemViewer "sits" in some related struct?!
(i did check mem_opcode before/after with no change whatsoever ~ also why md5 is returning the same values, i guess ~ plus: what about the game's offsets if it did...?!)
ps2: I forgot to mention this, but i'm calling the routine via 'getMemoryViewForm().Referencedstrings1.doClick()' ~ for its gui features obviously.


**********
Some stats:
CE Start_mem:400000 - Size:E1E000 => End:121E000

4096:
Before load: 8be04946997e71b6b4487c77171c0813
After load: 8be04946997e71b6b4487c77171c0813

8192:
Before build: b22448691195b5dbe0e973fe7496876b
After build: b22448691195b5dbe0e973fe7496876b

100000:
af68977576842782c10d07e7fccb9103
af68977576842782c10d07e7fccb9103

Timing:
====== Build: === Save time: = Load time: = Size exe: ======= File size (MB):
CE = : == 30s ==== < 5s ===== < 5s ===== 14.586.808 bytes == 5.2
ACBF : == 4~5min = <10s ===== < 10s ==== 45.036.488 bytes == 22.7
Mmax: == 21.5min = <15s ===== < 15s ==== 76.814.792 bytes == 22.2
(it is pretty obvious now why you'd want to save that analysis...)

ps:
* getDissectCode().dissect() will always run; but gives no progress status
(even in its seperate thread, it would still be unpractical in my book ~ no offense)
* you need to close/reload CE in order to run the Dissect routine again (even when/after attaching to different exe; and whether or not you ran 'clear()')
(will always show latest build result; or empty windows ~ see Referenced fn/strings)
(have not find a way yet to bypass that; basically call the routine applet itself directly)
(or perhaps reset some flag ~ CE is definitely not checking the Dissect file on disk when accessing the Build routine again)
* if you [Stop] the routine, you need to close/reload CE to restart (same behaviour as above)
* 'estimated time left' far from accurate; 'progress bar' status pretty much nails it !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites