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 


Code Injection Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Crash Bash
How do I cheat?
Reputation: 0

Joined: 19 Jul 2014
Posts: 7

PostPosted: Tue Oct 06, 2015 9:18 am    Post subject: Code Injection Help Reply with quote

I have a problem regarding code injection. I really don't know how to solve it, so I ask for help.
This is the code:
Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:
mov [ecx],edx
xor eax,eax
mov [pcsx2-r5350.exe+528A64],eax

exit:
jmp returnhere

30278F5F:
jmp newmem
nop
nop
nop
nop
returnhere:


 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
30278F5F:
mov [ecx],edx
xor eax,eax
mov [pcsx2-r5350.exe+528A64],eax
//Alt: db 89 11 31 C0 A3 64 8A 55 01]


As you can see there is nothing in it because the problem occurs even if I didn't write anything! The only thing I added is the ENABLE and DISABLE section, but I managed to find the culprit in the code, and it is the DISABLE section. When I ENABLE the code in the cheat table it is working fine (and it should), but when I DISABLE it (unfreeze), it simply crashes the game.

Here is a screenshot of the disassembler that is viewing the code:
s28.postimg.org/3yg3n6w4t/2015_10_06_143156.png
(Sorry for the wrong highlighted code, it should be the first one)

Here is a screenshot that is taken when I disabled the code:
s16.postimg.org/urpf8itet/2015_10_06_143359.png
(So this is the moment when the crash happened)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Oct 06, 2015 9:28 am    Post subject: Reply with quote

i'd say use the alt line instead since it's there because for this reason
, but for some reason the last 2 bytes are wrong so no idea whats up with that

_________________
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
vng21092
Grandmaster Cheater
Reputation: 15

Joined: 05 Apr 2013
Posts: 644

PostPosted: Tue Oct 06, 2015 9:28 am    Post subject: Reply with quote

try replacing your disable code with
Code:
[Disable]

30278F5F:
db 89 11 31 C0 A3 64 8A 71 01
dealloc(newmem)

Another problem I see here is the injection point isn't static, so when you restart the game the instruction won't be in the same place, right now its at 30278F5F, when you restart it might not be. Either way, find the instruction again, and redo the script with my disable part, see how that goes.
Back to top
View user's profile Send private message
Crash Bash
How do I cheat?
Reputation: 0

Joined: 19 Jul 2014
Posts: 7

PostPosted: Tue Oct 06, 2015 10:12 am    Post subject: Reply with quote

vng21092 wrote:
try replacing your disable code with
Code:
[Disable]

30278F5F:
db 89 11 31 C0 A3 64 8A 71 01
dealloc(newmem)

Another problem I see here is the injection point isn't static, so when you restart the game the instruction won't be in the same place, right now its at 30278F5F, when you restart it might not be. Either way, find the instruction again, and redo the script with my disable part, see how that goes.


Yes I know is isn't static, don't worry about that.
Hmm... This time in the disassembler it shows the address 30278F68 instead of 30278F69, apparently that has been fixed. But it still crashes the game?

Edit: OK, never mind, it works now!
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