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 


Memory editing doesnt work with games coded in python?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Question2
Newbie cheater
Reputation: 0

Joined: 13 Nov 2013
Posts: 15

PostPosted: Wed Nov 13, 2013 12:46 pm    Post subject: Memory editing doesnt work with games coded in python? Reply with quote

This is what someone else told me, but for games coded in python, apparently the addresses will change everytime you do something, so memory scanning does not work (mostly).

E.G. Let's say you search for 100 gold, then buy something so your gold drops to 95. In a normal game you can just search for 95 and narrow down the addresses to find which one is the gold value, but with a game in python the address cahnges the moment you buy something, so your initial address list (From searching for 100) no longer has the gold value in it.

Im trying to do memory editing for a python game now and this appears to be correct...i simply cannot find values the normal way.

Does anyone know how to do memory editing for python games other than hoping you get the address on the first try?

Edit : OK i searched and found some posts suggesting that you decompile the game scripts for renpy games.

So this is what i did.

I managed to decompile the scripts, first from a file called scripts.rpa. This gave me a folder full of .rypc files, and then i decompiled some of those into .rpy files, which i could then edit with notepad.

I then deleted the .rypca files which i had decompiled from scripts.rpa (because having both .rypca and .rpy would make the game refuse to run).

Trying to run the game gave me this rather odd error then :

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/battle.rpy", line 813: expected statement.
<<<UNKNOWN NODE Screen>>>
^

File "game/battle.rpy", line 815: expected statement.
<<<UNKNOWN NODE Screen>>>
^

File "game/battle.rpy", line 817: expected statement.
<<<UNKNOWN NODE Screen>>>
^

File "game/battle.rpy", line 819: expected statement.
<<<UNKNOWN NODE Screen>>>
^

File "game/battle.rpy", line 821: expected statement.
<<<UNKNOWN NODE Screen>>>
^

File "game/battle.rpy", line 823: expected statement.
<<<UNKNOWN NODE Screen>>>
^

Ren'Py Version: Ren'Py 6.15.7.374


I then noticed that trying to decompile battle.rpy gave me a rather odd message :

D:\DemonMasterChris\renpy\python.py:33: DeprecationWarning: the sets module is d
eprecated
import sets
Decompiling game\unrpa\battle.rpyc to game\unrpa\battle.rpy...
Unknown AST node: Screen
Unknown AST node: Screen
Unknown AST node: Screen
Unknown AST node: Screen
Unknown AST node: Screen
Unknown AST node: Screen
Decompilation of 1 script file successful

Which i guess means the decompiler doesnt know how to decompile this particular renpy version. Any ideas?

The game title is "Demon Master Chris" btw.


Last edited by Question2 on Wed Nov 13, 2013 1:54 pm; 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: Wed Nov 13, 2013 1:32 pm    Post subject: Reply with quote

Try a pointerscan for value on a nonstatic base of max 2 or 3 levels

Alternatively, recompile python so it doesn't do that, or make it generate a list of variables on command

_________________
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
Question2
Newbie cheater
Reputation: 0

Joined: 13 Nov 2013
Posts: 15

PostPosted: Wed Nov 13, 2013 2:33 pm    Post subject: Reply with quote

Im not familiar with pointer scanning, but according to a tutorial i am looking at, you need to find the addresses first right?

The problem is that without being able to narrow down the addresses by searching for changed values, i usually get thousands of addresses....so im not sure how it would help?

How do you recompile python?

I found an updated renpy decompiler (cant post the URL though, its on github)

However the game is still running into an error the moment i enter combat :

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/dungeon.rpy", line 20, in script call
File "game/dungeon.rpy", line 20, in script call
File "game/dungeon.rpy", line 103, in script call
File "game/dungeon.rpy", line 20, in script call
File "game/dungeon.rpy", line 103, in script call
File "game/battle.rpy", line 17, in script call
File "game/battle.rpy", line 22, in script
Exception: Required parameter talk has no value.

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "D:\DemonMasterChris\renpy\execution.py", line 288, in run
node.execute()
File "D:\DemonMasterChris\renpy\ast.py", line 666, in execute
values = apply_arguments(self.parameters, renpy.store._args, renpy.store._kwargs)
File "D:\DemonMasterChris\renpy\ast.py", line 593, in apply_arguments
raise Exception("Required parameter %s has no value." % name)
Exception: Required parameter talk has no value.

Windows-7-6.1.7601-SP1
Ren'Py 6.15.7.374
DMC 1.10

Im not sure whats going on here, but from testing it sems i get this error the moment i decompile battle.rpy from battle.rpyc so i think the decompiler is still failing somehow....

D:\DemonMasterChris>unrpyc.py --clobber "game\battle.rpyc"
D:\DemonMasterChris\renpy\ast.py:33: DeprecationWarning: the md5 module is depre
cated; use hashlib instead
import md5
D:\DemonMasterChris\renpy\python.py:33: DeprecationWarning: the sets module is d
eprecated
import sets
Decompiling game\battle.rpyc to game\battle.rpy...
Decompilation of 1 script file successful
Back to top
View user's profile Send private message
Chaos_DA
Cheater
Reputation: -1

Joined: 22 Nov 2008
Posts: 44
Location: Dying Earth,

PostPosted: Mon Jan 27, 2014 1:25 pm    Post subject: Reply with quote

I want to help a little! For the ETHER; I found that if you don't change the value thru buy and sell of items, the address don't change.

I started with a 4bytes search,
I search for the value (ex 316),
where will a few searched like 80+ address,
change the value of the all the searched address; from 1 to 80
then enter the shop,
once I found the address I change the other address back to the original value (ex 316) (It cause error if i don't change the address back)

Hope this will help ^_^

_________________

Evil is define by its act not by its appearance!
Back to top
View user's profile Send private message Yahoo Messenger
CMoose
How do I cheat?
Reputation: 0

Joined: 22 Jun 2016
Posts: 3
Location: Australia

PostPosted: Wed Jun 22, 2016 3:38 am    Post subject: Reply with quote

I know this is a bit of a necro post, but I found this topic when I was searching for how to cheat in this game. I've decompiled the script and put in some code to basically drop the party damage to zero, while keeping damage against enemies normal.

Will be looking through the battle.rpy to see if I can increase the clothing strip rate, but at the moment, this should work.


Instructions for installing:
Install python2.7, and make sure your paths are set.

All commands should be run from Demon Master Chris/Game directory

Download UnRPA (https[colon]//github[dot]com/Lattyware/unrpa) and use:
Code:
python unrpa scripts.rpa

to extract the file scripts.rpa (then rename scripts.rpa to scripts.rpa.old)

Next, you will need to download and install UnRPYC (https[colon]//github[dot]com/CensoredUsername/unrpyc) and use:
Code:
python unrpyc battle.rpyc

and rename battle.rpyc to battle.rpyc.old


Unfortunately I can't upload the file due to attachment restrictions, but you can find the file battle.rpy at: https[colon]//github[dot]com/crystalmoose/dmc

(Change colons and dots in the URLs, as I can't post them yet)

Let me know if you find any problems or bugs, and I will see what I can do to fix them.



Update: (Jeez that was quick!) Managed to make it so that enemies strip faster (always 'critical' vs enemies) and increased ether gain by 5. Cuz cheetz!
Back to top
View user's profile Send private message
NightEnd
How do I cheat?
Reputation: 0

Joined: 12 Jul 2016
Posts: 1

PostPosted: Tue Jul 12, 2016 5:20 am    Post subject: Reply with quote

Can you make a video please?

Somehow, all those file i downloaded. when i click in those file and press run with python. they all appear, say "too few arguement" then disappear, i cant type any command. help please?
Back to top
View user's profile Send private message Yahoo Messenger
CMoose
How do I cheat?
Reputation: 0

Joined: 22 Jun 2016
Posts: 3
Location: Australia

PostPosted: Tue Jul 12, 2016 5:23 am    Post subject: Reply with quote

NightEnd wrote:
Can you make a video please?

Somehow, all those file i downloaded. when i click in those file and press run with python. they all appear, say "too few arguement" then disappear, i cant type any command. help please?


I'll see what I can do, but I am in the middle of searching for a new job, so that is taking up a good chunk of time.

Which part were you getting the too few arguments on? I recall getting that error myself, might help jog my memory if you point out which part you are up to.

Edit: Oh, wait, I think I see what you are saying. You need to run these commands through your command prompt, not through windows explorer. That would be the reason you are getting the too few arguments response, I believe.
Back to top
View user's profile Send private message
SturmovikRules
How do I cheat?
Reputation: 0

Joined: 19 Mar 2017
Posts: 2
Location: Canada

PostPosted: Sun Mar 19, 2017 3:16 pm    Post subject: Reply with quote

I'm sorry to bother you since it's been months since you made the post but no one seems to have any cheats from what I can find. Yours was the only one I found and I'm too stupid to figure out how to get it working. Would you still be able to make that video? I understand if you don't want too but I'm stuck.
Back to top
View user's profile Send private message
CMoose
How do I cheat?
Reputation: 0

Joined: 22 Jun 2016
Posts: 3
Location: Australia

PostPosted: Sun Mar 19, 2017 8:10 pm    Post subject: Reply with quote

Sure, I've been thinking of doing a video on python and RenPy hacking for a while now.

I will work on it over the next few days.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Mar 19, 2017 9:16 pm    Post subject: Reply with quote

It can be a pain sometimes, but memory editing is still possible. There are a few save-game editors online that can be used as an alternative:

Basic Save-Game Editor
Advanced Save-Game Editor
Back to top
View user's profile Send private message
SturmovikRules
How do I cheat?
Reputation: 0

Joined: 19 Mar 2017
Posts: 2
Location: Canada

PostPosted: Mon Mar 20, 2017 8:00 am    Post subject: Reply with quote

CMoose wrote:
Sure, I've been thinking of doing a video on python and RenPy hacking for a while now.

I will work on it over the next few days.



Thanks a lot.
Back to top
View user's profile Send private message
Cth
Newbie cheater
Reputation: 0

Joined: 18 Apr 2014
Posts: 23

PostPosted: Tue May 16, 2017 2:58 pm    Post subject: Reply with quote

CMoose wrote:
I know this is a bit of a necro post, but I found this topic when I was searching for how to cheat in this game. I've decompiled the script and put in some code to basically drop the party damage to zero, while keeping damage against enemies normal.

Will be looking through the battle.rpy to see if I can increase the clothing strip rate, but at the moment, this should work.


Instructions for installing:
Install python2.7, and make sure your paths are set.

All commands should be run from Demon Master Chris/Game directory

Download UnRPA (https[colon]//github[dot]com/Lattyware/unrpa) and use:
Code:
python unrpa scripts.rpa

to extract the file scripts.rpa (then rename scripts.rpa to scripts.rpa.old)

Next, you will need to download and install UnRPYC (https[colon]//github[dot]com/CensoredUsername/unrpyc) and use:
Code:
python unrpyc battle.rpyc

and rename battle.rpyc to battle.rpyc.old


Unfortunately I can't upload the file due to attachment restrictions, but you can find the file battle.rpy at: https[colon]//github[dot]com/crystalmoose/dmc

(Change colons and dots in the URLs, as I can't post them yet)

Let me know if you find any problems or bugs, and I will see what I can do to fix them.



Update: (Jeez that was quick!) Managed to make it so that enemies strip faster (always 'critical' vs enemies) and increased ether gain by 5. Cuz cheetz!


This is cool, but you forgot to mention how to compile it back. lol. It's the first time I use decompiler for a language I never decompiled before.

And why don't you just upload compiled scripts.rpa with modified battle?

Okay, wasted a few hours. I don't want to know how the whole bloody ren'py works to compile a few scripts.

Lol. Decided to read more ren'pys documentation and found out that you don't need to compile the script files. You can leave them in the script folder.

Ok, now everything works. Thanks!
Back to top
View user's profile Send private message
YukoValis
Newbie cheater
Reputation: 0

Joined: 17 Jul 2012
Posts: 16

PostPosted: Tue Aug 15, 2017 11:41 pm    Post subject: Reply with quote

I sort of have a work around when it comes to Python games.

Step 1: Search 4 byte "Unknown Initial Value"

Step 2: change the value in game. Gold for example. (do not change this again)

Step 3: Search for "Changed value"

Step 4: Fiddle around without changing that value, and search for "Unchanged value" a few times to narrow it down.

Step 5: Search for exact number.

Hopefully you will only get between 1 and 5 results give or take. If it is 1 result, then there you go.

This might not work on all games, but I found it works on a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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