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 


{SCRIPT PROBLEM}CodeCave
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
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Tue Nov 24, 2015 5:10 am    Post subject: {SCRIPT PROBLEM}CodeCave Reply with quote

is created code cave in several forms?
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Tue Nov 24, 2015 8:55 pm    Post subject: Reply with quote

please help me in making code cave scripts.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Nov 24, 2015 10:27 pm    Post subject: Reply with quote

In the Auto Assemble window,
Template > AOB Injection
Click OK twice
Code cave created
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Wed Nov 25, 2015 9:25 pm    Post subject: Reply with quote

In some game such as castle crashers when making simple script and use it game crashed.why?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4717

PostPosted: Wed Nov 25, 2015 9:37 pm    Post subject: Reply with quote

You probably made the script wrong. If you post it we might be able to help fix it.

It might also be some sort of anti-cheat.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Wed Nov 25, 2015 9:47 pm    Post subject: Reply with quote

no I'm not probaly in making script.but what code cave work?
Back to top
View user's profile Send private message
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Thu Nov 26, 2015 2:45 pm    Post subject: Reply with quote

sjl002 wrote:
no I'm not probaly in making script.but what code cave work?


Code caves are old school spot in memory you can write to. These things are a relic nowdays. Use an injection and alloc newmem if need space for new.codel

_________________
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4717

PostPosted: Thu Nov 26, 2015 4:51 pm    Post subject: Reply with quote

akumakuja28 wrote:
Code caves are old school spot in memory you can write to. These things are a relic nowdays. Use an injection and alloc newmem if need space for new.codel

What's the difference between a code cave and a code injection? In terms of what CE does, it's pretty much the same thing from my understanding. A code cave is a spot in memory the real application jumps to then jumps right back from after the code cave is done running. A code injection more or less refers to the same process.

I'm not sure on this, though, so anyone feel free to correct me if I'm wrong.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Thu Nov 26, 2015 7:26 pm    Post subject: This post has 1 review(s) Reply with quote

@ParkourPenguin: A code cave is a unused spot inside the game's code like the int3/nop padding between each function, or the (usually) large block between the end of the last function and the end of the memory region that holds the code. It was called a cave because it's sort of a hole between 2 parts of original code.

CE's injection allocates memory into the game so you are adding new usable memory space instead of repurposing some bytes that are already present.

And yes, I'm well aware that I've labelled "CodeCave" some memory that I've allocated in some of my scripts. That wasn't the proper term, but it's too late/not worth the bother to fix that.

@akumakuja28: code caves are still very useful when you want to hardcode your hacks into the exe instead of launching a trainer/CE each time you play.
Still I'm not sure many people beside me do hardcodable hacks...

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
Studio80
Advanced Cheater
Reputation: 2

Joined: 12 Sep 2012
Posts: 83

PostPosted: Sun Dec 13, 2015 6:21 pm    Post subject: Reply with quote

I can understand your frustration I was in the same boat as you. One my of first games I wanted to train drove me crazy because my code injection always crashed the game.

It's very simple. What we want is to manipulate the code, we do this by jumping from the adress where the instruction is to an empty space. We inject our hacked code, we restore the original code and we jump back to after where the original code was. A code cave is just an empty space in the file.

Lets say you have the following code below:

Code:
[b]100030142 - FF 8B 88 07 00 00        - dec [rbx+00000788][/b]
100030148 - 48 8D 4D 88           - lea rcx,[rbp-78]


Every time I click the button some value gets decreased. The value is stored in [rbx+00000788]. So DEC [rbx+00000788] makes sense right?

So now we want to inject our code. How do we do this? We need to jump from the adress (which is 100030142) to an empty space (the cave), write our instruction. After we write our instruction we also need to write the original instruction which is DEC [rbx+00000788]. And then we need to jump back to the next instruction after the jump to the cave which is 100030148. I'm going to try to explain it more. Lets inject our codes.

Code:
100030142 - E9 B9 FE FB FF           - jmp FFFF0000
100030147 - 90                            - nop


FFFF0000 - C7 83 88 07 00 00 64 00 00 00    - mov [rbx+00000788],00000064
FFFF000A - FF 8B 88 07 00 00              - dec [rbx+00000788]
FFFF0010 - E9 33 01 04 00                - jmp 100030148


Now I'm going to explain you every line in details.

Code:
100030142 - E9 B9 FE FB FF           - jmp FFFF0000 <---- JUMPS TO CAVE
100030147 - 90                            - nop <- NOPS THE LAST BYTE


We make the jump to the cave which is located at FFFF0000. And you have noticed the NOP. We nop this byte because the original code uses 6 bytes (which are FF 8B 88 07 00 00) and the JMP uses only 5 bytes (which are E9 B9 FE FB FF). So thats why we need to NOP the last byte. Else it might crash.

Lets move to the next part.

Code:
FFFF0000 - C7 83 88 07 00 00 64 00 00 00    - mov [rbx+00000788],00000064 <---- It puts 100 into [rbx+00000788] 64 in hex is 100 in decimals


FFFF0000 is the adress of our cave aka empty space. Here we write our modified code. We move our new value into the pointer [rbx+00000788]. We write our new values always in hex. 64 in hex is 100 in decimals.

Lets move to the next line

Code:
FFFF000A - FF 8B 88 07 00 00              - dec [rbx+00000788] <----- Restores the original code


This is our original code. We need to include this else the game might crash.

Code:
FFFF0010 - E9 33 01 04 00                - jmp 100030148 <---- Jumps back to the adress that comes after the jump of the jump to the cave


We need to jump back to the line that comes after the first jump we made so the game can continue else it will crash. Which is the jump to the cave. 100030148 comes after the JUMP TO CAVE instruction. Just check this:

Code:
100030142 - E9 B9 FE FB FF           - jmp FFFF0000 <--- Jump to cave
100030147 - 90                            - nop
[b]100030148 [/b]- 48 8D 4D 88           - lea rcx,[rbp-78] <---- the adress that comes after the jump to cave



The reason why your game crashes is because you're doing it wrong. I never was a script guy I started with trainer maker kit and it drove me crazy because I had to write the code manually and I made the mistake of not nopping one byte. Maybe you are doing the same. An another possible scenario is that you aren't restoring the original instruction. Or you are writing a wrong code.

I just use Ollydbg to write my code injections and these I implement in my trainer. If you're going to write your own trainers then its better to use Olly and just use the caves located around 10ABF. If you have any other questions just ask.
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Sun Dec 13, 2015 6:43 pm    Post subject: Reply with quote

Castle crashes isn't a simple game. You are making it crash because it accesses several different functions from one single instruction.

Look in the table section for tables for this game and learn what you are doing wrong. Or read the previous replies to your earlier threads, they already answer your questions.

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
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 Dec 13, 2015 11:35 pm    Post subject: Reply with quote

Gniarf wrote:
I'm not sure many people beside me do hardcodable hacks...
-I do. But not for cheats. Mr. Green

It's important to note, also, that, codecaves are also used in rare cases that the desired, hard-coded modification is different in size, and all original code that follows be kept intact.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Mon Dec 14, 2015 6:27 am    Post subject: Reply with quote

in total . games like castle crashers ghost recon advanced warfighter2 should be how to build script that the game suffers trouble.
GH*master can help me in making script for ammo in ghost recon advanced warfighter2.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Tue Dec 15, 2015 6:18 am    Post subject: Reply with quote

Please help me.
Back to top
View user's profile Send private message
Studio80
Advanced Cheater
Reputation: 2

Joined: 12 Sep 2012
Posts: 83

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

sjl002 wrote:
Please help me.

People can help you if you explain more. If it is an online game than there is a chance that there is some kind of anti cheat program. You need to tackle that one but thats a complicated process.

I havent checked the game out but I assume that its an online game. Many online games store their data on their servers, so it's kinda impossible to make a trainer for them because you need to hack their servers in order to change the data which is stored on their servers.

With cheatengine you could possibly only change the numbers on your screen but they won't be saved on the server.
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