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 


Trouble with Code Injection...

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

Joined: 05 Aug 2009
Posts: 15
Location: Georgia, Kutaisi

PostPosted: Mon Sep 28, 2009 5:28 am    Post subject: Trouble with Code Injection... Reply with quote

Hi!
I made Assembler script for Empire Total War:
Code:
[enable]
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

00AFE857:
jmp newmem
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
add [esi+000003cc],1000

originalcode:
sub [esi+000003cc],eax

exit:
jmp returnhere

[disable]
dealloc(newmem)
00AFE857:
sub [esi+000003cc],eax

(it add money when you buy unit or building)

then I made trainer and put this code there and relaunched game using this trainer. everything was ok, no problems, I used it, made some saves in game and closed it, but now when I am trying to load my save game(which I made while playing with my trainer) I get error and game closes. I guess that this is of my code, so please check it and tell me if I wrote it correct.
(sorry for my english)

_________________
I am Georgia!
Stop Russia!
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Mon Sep 28, 2009 7:29 am    Post subject: Reply with quote

perhaps the value in the save is out of range
why are you increasing with 4096 each time it's called instead of just setting it to 4096 ?

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

Joined: 05 Aug 2009
Posts: 15
Location: Georgia, Kutaisi

PostPosted: Mon Sep 28, 2009 7:46 am    Post subject: Reply with quote

Embarassed I don't know, I am noob at Assembler, I wrote it like here forum.cheatengine[.]org/viewtopic.php?t=4868, so what should I do..
and Thank you for reply!

_________________
I am Georgia!
Stop Russia!
Back to top
View user's profile Send private message Send e-mail
kickclock
Advanced Cheater
Reputation: 0

Joined: 15 Jan 2008
Posts: 73

PostPosted: Tue Sep 29, 2009 2:29 am    Post subject: Reply with quote

test this script

[enable]
00AFE857:
db 90 90 90 90 90 90
[disable]
00AFE857:
sub [esi+000003cc],eax

_________________
Love CE
Back to top
View user's profile Send private message
ChainRule
Cheater
Reputation: 1

Joined: 21 Jan 2008
Posts: 40

PostPosted: Mon Oct 05, 2009 12:10 am    Post subject: Reply with quote

Quote:
test this script

[enable]
00AFE857:
db 90 90 90 90 90 90
[disable]
00AFE857:
sub [esi+000003cc],eax


Quick question there:

Wouldn't it be the same if we were to simply remove the "sub [esi + 3ccc], eax" under the originalcode label and then put nop under newmem label? What is the point using [enable] ... [disable] ?
Back to top
View user's profile Send private message
noko_112
Grandmaster Cheater
Reputation: 0

Joined: 09 Jun 2009
Posts: 585

PostPosted: Mon Oct 05, 2009 8:30 am    Post subject: Reply with quote

I thuink it just is this code that corrupt the save. Maybe if you disable it before saving Wink
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