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 


City Car Driving crashing way to often when modifying code.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Mon Dec 14, 2015 5:28 pm    Post subject: City Car Driving crashing way to often when modifying code. Reply with quote

So, City Car Driving, (32 bit game) When i try to change any opcode in any way the game crashes. Some opcodes takes longer than others to make the game crash. (Between 1 - 4 seconds)

I've tried using stealthedit but same problem occurs. And yes the opcodes i was trying to modify only accesses the thing i want so ONE address only.

I also tried using the Brake and trace function to find the root of (In this case the game timer) and change that instruction but that didn't work either.

The only thing that works is if i use the injectioncopy/globalalloc function that I've seen in one of Rydians tutorials. That works if i enable the script and then deactivating it really fast. It points to the right address and the game doesn't crash. If i leave it on for more than 3 seconds it eventually crash.

So right now I'm thinking that the game might have some memory integrity check. It's pretty much a "shitty" game so to speak. Not any big developers have made it, It is also 100% offline so i really don't know why they would put in such a check but still.

I've never dealt with memory checks before and i don't know where to start. Does anyone know any good tutorial that shows how i can look for it/change it? I understand that it is different in every game but i just need someplace to start.

Any tips are appreciated what might cause this.

Edit: "Change Register at this location" Does work. But i can't put that in a script.

Thanks! Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Dec 14, 2015 11:52 pm    Post subject: Reply with quote

Not likely to be a memory check, in my opinion. I would let the debugger run to see if something else is actually being accessed when the game crashes. If letting the debugger run is not practical, then create a breakpoint inside a segment of code that only gets accessed if the address of the register is not the address for your timer.

To verify if the problem is being caused by a memory integrity check routine, you can simply write a script at that injection point that doesn't change anything, and leave it enabled for an extended period of time while having nothing else enabled and while making no other modifications to any values during that time.
Back to top
View user's profile Send private message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Tue Dec 15, 2015 9:11 am    Post subject: Reply with quote

++METHOS wrote:
Not likely to be a memory check, in my opinion. I would let the debugger run to see if something else is actually being accessed when the game crashes. If letting the debugger run is not practical, then create a breakpoint inside a segment of code that only gets accessed if the address of the register is not the address for your timer.

To verify if the problem is being caused by a memory integrity check routine, you can simply write a script at that injection point that doesn't change anything, and leave it enabled for an extended period of time while having nothing else enabled and while making no other modifications to any values during that time.


Thanks for your answer. I just tried making a script without modifying the code at all, The game still crashes. It also crashes in the menu. I don't actually have to be ingame at all for the game to crash.

"I would let the debugger run to see if something else is actually being accessed when the game crashes. If letting the debugger run is not practical, then create a breakpoint inside a segment of code that only gets accessed if the address of the register is not the address for your timer."

could you explan this in a little more detail on how you mean? Cheers! Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 9:52 am    Post subject: Reply with quote

If the game is still crashing, and you know, for certain, that nothing is being modified other than your harmless injection, then the part about creating a breakpoint 'trap' is not necessary. I only mentioned it because it's less intrusive during game-play and it can help when attaching the debugger for a particular instruction causes the target process to lag too much.

The process is simple. Just create your harmless script, and inside your script, compare the address of the register with your timer address and if it doesn't match, have the code jump to a copy of the original code (trap). Once you activate the script, follow the jump to your codecave and set a breakpoint inside the section of code that only executes when the address of the register is not the same as your timer address. Doing this will freeze the target if/when the breakpoint gets executed, allowing you to verify, with certainty, that another address is being accessed by that particular instruction. You can play the game without any interference from the debugger while you check to see if anything catches.
Back to top
View user's profile Send private message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Tue Dec 15, 2015 10:33 am    Post subject: Reply with quote

++METHOS wrote:
If the game is still crashing, and you know, for certain, that nothing is being modified other than your harmless injection, then the part about creating a breakpoint 'trap' is not necessary. I only mentioned it because it's less intrusive during game-play and it can help when attaching the debugger for a particular instruction causes the target process to lag too much.

The process is simple. Just create your harmless script, and inside your script, compare the address of the register with your timer address and if it doesn't match, have the code jump to a copy of the original code (trap). Once you activate the script, follow the jump to your codecave and set a breakpoint inside the section of code that only executes when the address of the register is not the same as your timer address. Doing this will freeze the target if/when the breakpoint gets executed, allowing you to verify, with certainty, that another address is being accessed by that particular instruction. You can play the game without any interference from the debugger while you check to see if anything catches.


Alright i will try that Smile

Btw, the opcode that writes to the timer is kind of weird. I've never seen an opcode /function like that. Originalscript:


"compare the address of the register with your timer address" Could give me small example? Feeling kind of stupid today haha. Cheers Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 10:56 am    Post subject: Reply with quote

Are you working within the main module? If not, try to see if anything is 'accessing' your timer address from within the main module before you proceed.
Back to top
View user's profile Send private message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Tue Dec 15, 2015 11:06 am    Post subject: Reply with quote

++METHOS wrote:
Are you working within the main module? If not, try to see if anything is 'accessing' your timer address from within the main module before you proceed.


Yes iam, everything that accesses the address points to that ".dll" file.

Also. I just noticed that when i "check what this instruction accesses" = debugging the opcode. The timer address doesn't pop up. Timer address =

14C4F67C

Address that pops up = 14C4F678.. :S And if i freeze that one the timer doesn't freeze.

When i debug timer address:


red = the actual timer.
Green = what's being debugged. and it's not the timer.. weird
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 11:23 am    Post subject: Reply with quote

By main module, I mean game.exe.

If none exist, try finding a different timer value (if possible).

Before doing anything, make sure your timer address actually works. Before doing injection, you should always test. If manually freezing the timer address, without injection, works, then your next test would be to see if it causes the game to crash at a later time while it's frozen. If it does, then I would try to find a different address/value.

The other issues that you are experiencing are probably due to the fact that the value being manipulated is 8 byte.
Back to top
View user's profile Send private message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Tue Dec 15, 2015 11:33 am    Post subject: Reply with quote

++METHOS wrote:
By main module, I mean game.exe.

If none exist, try finding a different timer value (if possible).

Before doing anything, make sure your timer address actually works. Before doing injection, you should always test. If manually freezing the timer address, without injection, works, then your next test would be to see if it causes the game to crash at a later time while it's frozen. If it does, then I would try to find a different address/value.

The other issues that you are experiencing are probably due to the fact that the value being manipulated is 8 byte.


Yes, When i freeze the address the timer stops so i know that it is the right one. Thanks for the tip, it is true. That 8 byte thing hehe. Will keep looking then. I thought that i have experience in cheat engine and now i feel like a pure noob haha Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 11:36 am    Post subject: Reply with quote

Regarding the timer address...don't be so sure. Oftentimes, there are multiple addresses for things. Some 'seem' to work, but there may be a better option. I would say, if freezing the timer does not cause the game to crash, and works as intended, then it's probably okay to proceed. It would be better to work within the main module, but as long as the external modules are game files, you should be fine for trainer purposes.
Back to top
View user's profile Send private message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Tue Dec 15, 2015 11:43 am    Post subject: Reply with quote

Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 12:52 pm    Post subject: Reply with quote

Regarding the link, CE automatically calculates the module entry point. The OP in that thread either didn't know that, or, was wanting to know how to duplicate that function using C#.

It could be that the dll for this target is encrypted or has shifting code etc..

I grabbed the game, but I can't complete the stupid tutorial to do anything. Very Happy Hopefully, I can try something soon. I will report back.
Back to top
View user's profile Send private message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Tue Dec 15, 2015 12:55 pm    Post subject: Reply with quote

++METHOS wrote:
Regarding the link, CE automatically calculates the module entry point. The OP in that thread either didn't know that, or, was wanting to know how to duplicate that function using C#.

It could be that the dll for this target is encrypted or has shifting code etc..

I grabbed the game, but I can't complete the stupid tutorial to do anything. Very Happy Hopefully, I can try something soon. I will report back.


Oh nice! Thank you. Torrented or bought? Since i use the bought version. Game version is 1.5 Smile

If you got the original version. To make stuff easier:

Penalty base address: "pdd.dll"+56E214

So you don't have to look for it hehe Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 1:09 pm    Post subject: Reply with quote

Something just came up with my work, so I will not be able to look at this until some other time. Although, if I cannot complete the tutorial, I may just give up. Cool
Back to top
View user's profile Send private message
XaneXXXX
Expert Cheater
Reputation: 0

Joined: 29 Nov 2012
Posts: 212

PostPosted: Tue Dec 15, 2015 2:27 pm    Post subject: Reply with quote

++METHOS wrote:
Something just came up with my work, so I will not be able to look at this until some other time. Although, if I cannot complete the tutorial, I may just give up. Cool


Aw too bad. lol. I can just send you my save if you want haha
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
Goto page 1, 2  Next
Page 1 of 2

 
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