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 


Patch code analyser

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
zxuiji
Advanced Cheater
Reputation: 1

Joined: 26 Sep 2016
Posts: 66

PostPosted: Wed Oct 24, 2018 4:55 am    Post subject: Patch code analyser Reply with quote

I have work to go now and since I'm making this to be a template for public usage I thought I'd post it here. The current form has errors in both the code producing stage and the thread destruction stages so if anyone feels like trying to fix it before I next get 'round to it I would suggest looking at Patch() first to fix the thread issue then work your way up from BuildPatchList(), I included my list of codes from FF12 since I'm going resolve a problem I recently found out about (namely an abysmally low attack). Apparently the forums didn't like just my lua code being directly in the post so uploaded my CT file instead:
https://drive.google.com/file/d/11y4-MN2-wNrRwEHJW4KIVUoWuiE1QZte/view?usp=sharing

Edit: Fixed the issue with patch codes being incorrectly analysed, now just need to resolve the hanging that occurs when I try to destroy the threads (I've just been deleting all memory records but probably happens on singular too), will take my thread code to a previously created thread to get help with that

https://forum.cheatengine.org/viewtopic.php?p=5743423#5743423

Edit 2: The hang is fixed and I've re-uploaded the file. Aside from forgetting to add the BaseAddress variable when setting memory record addresses it's now good for any PS2 code list using the raw format used here:
https://gamehacking.org/wiki/Code_Types_%28Playstation_2%29

Master codes are not implemented because I don't know how just yet however they will not be treated as invalid codes so feel free to include them when dumping your list into the pc variable, right now the only purpose of this makeshift template is for testing along side pcsx2 codes that are reported buggy and hopefully fix them with the help of CE's memory browser/editor since it's most likely gonna be an offset or value issue

Edit 3: Finally got round to actually trying to use the codes this morning and found a bunch of errors (all of which I have now fixed) ranging from imense slow down of the PC (could't cope with a thread per patch code so switched to single thread that is enabled/disabled by the root memory record)
to mishandled byte retrieval in Write Always codes. Also changed the values written by the max stats code now that I could see them as the floats I new them to be, will come back to this either tomorrow evening or monday.

Edit 4: Aside from a mishandling of comparison codes (still trying to fix that) and some unsupported code types like master codes and deadface codes, the table works as it should now. I've now enabled usage of code lines directly although to be safe it best to only activate the codes that write bytes such as slide writes, everything else should be handled by the thread. Final note the "Patch Codes" memory record needs to be activated to allow any codes to run at all, in case wanted a quick deactivate of all codes

_________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel.
Back to top
View user's profile Send private message
zxuiji
Advanced Cheater
Reputation: 1

Joined: 26 Sep 2016
Posts: 66

PostPosted: Tue Oct 30, 2018 6:10 am    Post subject: Reply with quote

Unless the "Patch Codes" record is active nothing besides thet individual code lines will work, the point of it operating that way is to provide a quick way to disable all without deactivating the named codes. As far as that typo goes I've now fixed that and the malfunctioning of comparison code handling.

As long as there is not a master code or other complicated codes then you can just replace the list with a different one if you wanna play a different game. Anyway I've now tested a few codes on both the comparisons and individual code line records and my game is showing the changes also so you should have no further problems in that regard from now on.

If you know how to implement the master codes, pointer codes and any others I've missed then feel free to post it, I will give credit where credit is due.

_________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel.
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 17

Joined: 08 Oct 2015
Posts: 414

PostPosted: Tue Oct 30, 2018 6:41 am    Post subject: Reply with quote

If I understand correctly, the master code is for creating a hook that redirects program flow on the actual console to the cheat instructions because users have no other means for direct modification of game memory? So not sure if you want to replicate that on PC since you can directly modify it using CE. Plus it probably would not work since PCSX2 probably translates PS2 assembly into x86/64 assembly.

Pointer should be implementable. Not sure where you are stuck at.
Back to top
View user's profile Send private message
zxuiji
Advanced Cheater
Reputation: 1

Joined: 26 Sep 2016
Posts: 66

PostPosted: Tue Oct 30, 2018 7:15 am    Post subject: Reply with quote

Well yeah if the master code was only a jmp instruction or comparison or delay then I could just implement that easy but I don't know what to do with the "special bytes" mentioned in the code types link. As for the pointer one I'm not quite sure I'm understanding the description given for it properly so I've ignored it for now.
I'll be busy for a while now so will not reply until a few hours later.

_________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel.
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 17

Joined: 08 Oct 2015
Posts: 414

PostPosted: Tue Oct 30, 2018 9:58 am    Post subject: Reply with quote

6WXXXXXX BBBBBBBB
ZZZZZZZZ YYYYYYYY

Hmm.... my interpretation is

Add BBBBBBBB to XXXXXX to get the address the pointer is stored at.
Read pointer off that address and add offset ZZZZZZZZ to the DWORD PTR read.
Finally write YYYYYYYY to the address pointed to by the resultant pointer.

But it seems this AR code type is not a universal format across Gameshark and Codebreaker.
Back to top
View user's profile Send private message
zxuiji
Advanced Cheater
Reputation: 1

Joined: 26 Sep 2016
Posts: 66

PostPosted: Tue Oct 30, 2018 12:32 pm    Post subject: Reply with quote

That was the same interpretation I had but I'd like to see an existing one first (will do it when I need to, until then I leave it in user hands), as far as universal GS should be using the same given it is just another name for the same software, or rather it was orginally named action replay since it belonged to datel at the time, I don't image mad catz would have changed the format, well either way I was planning on seperating out the pointer analysis into another function anyway
_________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel.
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 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