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 


Q: Only one toggle of my script is working - [solved]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Zaladine
Expert Cheater
Ban
Reputation: 3

Joined: 14 Oct 2012
Posts: 129
Location: Djokdja, Indonesia

PostPosted: Sun Jan 05, 2014 12:35 pm    Post subject: Q: Only one toggle of my script is working - [solved] Reply with quote

In Game.exe module, the original code snippet in disassemble window was:
Code:
Game.exe+345591 - D9 96 90020000        - fst dword ptr [esi+00000290]
Game.exe+345597 - D9 44 24 20           - fld dword ptr [esp+20]
Game.exe+34559B - D9C9                  - fxch st(1)
Game.exe+34559D - DFF1                  - fcomip st(0),st(1)
Game.exe+34559F - DDD8                  - fstp st(0)
Game.exe+3455A1 - 72 16                 - jb Game.exe+3455B9


So i created a script which meant to act as a cheat toggle to alter both Game.exe+345591 and Game.exe+3455A1. My script was:
Code:
[ENABLE]
"Game.exe"+39295F:
nop
nop
nop
nop
nop
nop

"Game.exe"+3455A1:
jmp Game.exe+3455B9


[DISABLE]
"Game.exe"+39295F:
fst dword ptr [esi+00000290]

"Game.exe"+3455A1:
jb Game.exe+3455B9


As i toggled the script on, only the first target code was altered. The disassembler was like this:
Code:
Game.exe+345591 - 90                    - nop                   <-- successfully modified
Game.exe+345592 - 90                    - nop
Game.exe+345593 - 90                    - nop
Game.exe+345594 - 90                    - nop
Game.exe+345595 - 90                    - nop
Game.exe+345596 - 90                    - nop
Game.exe+345597 - D9 44 24 20           - fld dword ptr [esp+20]
Game.exe+34559B - D9C9                  - fxch st(1)
Game.exe+34559D - DFF1                  - fcomip st(0),st(1)
Game.exe+34559F - DDD8                  - fstp st(0)
Game.exe+3455A1 - 72 16                 - jb Game.exe+3455B9    <-- this one was somehow kept intact


I should have made mistake because when i rewrote my script to throw away the first modification part to this:
Code:
[ENABLE]
"Game.exe"+3455A1:
jmp Game.exe+3455B9


[DISABLE]
"Game.exe"+3455A1:
jb Game.exe+3455B9

still, the code remained intact. The code at "Game.exe"+3455A1 didn't change from JB to JMP.

What did i do wrong? How to solve this? Thank you very much in advance for replies.

_________________
... to boldly go where no eagle has gone before ...


Last edited by Zaladine on Mon Jan 06, 2014 5:25 am; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Jan 05, 2014 1:41 pm    Post subject: Reply with quote

In cheat engine disassembler press ctrl+g and go to "Game.exe"+3455A1
Confirm that the address is what you expect

Also, the first script address is wrong and should never have worked for the first part

And i doubt it helps but instead of jmp Game.exe+3455B9 try jmp "Game.exe"+3455B9

_________________
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
Zaladine
Expert Cheater
Ban
Reputation: 3

Joined: 14 Oct 2012
Posts: 129
Location: Djokdja, Indonesia

PostPosted: Sun Jan 05, 2014 2:21 pm    Post subject: Reply with quote

Thanks, Dark Byte...

The offsets are the problem. They have somehow shifted from the real address...
I double-checked the addresses as you've told and found that the problem was it...

It was merely my silly mistake... Embarassed


Anyhow, it is solved now.


Edit:
Just additional info: It was the 'Show Symbol' option in the disassembler view menu
which screwed up my addresses interpretation and script...

_________________
... to boldly go where no eagle has gone before ...
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Sun Jan 05, 2014 5:12 pm    Post subject: Reply with quote

Zaladine wrote:
It was the 'Show Symbol' option in the disassembler view menu which screwed up my addresses interpretation and script...


I've had some problems lately, too, with symbols not resolving with the locations I expect. I can highlight a line of code, start the code injection macro, and find that the symbol for the address it picks up doesn't match the address I have selected. It's weird.
Back to top
View user's profile Send private message
Zaladine
Expert Cheater
Ban
Reputation: 3

Joined: 14 Oct 2012
Posts: 129
Location: Djokdja, Indonesia

PostPosted: Mon Jan 06, 2014 5:36 am    Post subject: Reply with quote

When 'Show Symbol' turned off, the target address was like:
Game.exe+123456

but when it turned on (it was unintentionally), the target address changed
to something like:
Game.System::blabla+21321

Anyhow, both of them pointed at the exactly same address... that's when
i got confused...

_________________
... to boldly go where no eagle has gone before ...
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Mon Jan 06, 2014 10:42 pm    Post subject: Reply with quote

Zaladine wrote:
When 'Show Symbol' turned off, the target address was like:
Game.exe+123456

but when it turned on (it was unintentionally), the target address changed
to something like:
Game.System::blabla+21321

Anyhow, both of them pointed at the exactly same address... that's when
i got confused...


Yeah, they are supposed to point at the same address. In most cases, it's useful to use the symbols instead of the base+offset pair because if the game gets patched, your code will likely still work unless the specific function or perhaps module you're hacking has also been altered.
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