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 


AA script not activating, I'm sure I've done something wrong

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
bhfff
Cheater
Reputation: 0

Joined: 19 Jan 2017
Posts: 30

PostPosted: Sun Aug 13, 2017 6:53 pm    Post subject: AA script not activating, I'm sure I've done something wrong Reply with quote

I was trying to learn the compare function and I've decided to open the tutorial (step 2)

I want to use a value that I can toggle with a button at any given time.

I hope someone can tell me what's missing, here's the code:

Code:
[ENABLE]

aobscanmodule(test,Tutorial-i386.exe,89 83 80 04 00 00 8D 55 D4 E8 12) // should be unique
alloc(newmem,$1000)

label(code)
label(return)
label(hack)
label(value)

registersymbol(value)

value:
dd 0

newmem:
cmp [value],1
je hack

code:
  mov [ebx+00000480],eax
  jmp return

hack:
mov [ebx+00000480],#1000
jmp return

test:
  jmp newmem
  nop
return:
registersymbol(test)
[DISABLE]

test:
  db 89 83 80 04 00 00

unregistersymbol(value)
dealloc(newmem)


If that helps:
Cheat Engine 6.7 64bit
Tutorial 32bit
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Sun Aug 13, 2017 7:14 pm    Post subject: Reply with quote

"value" is a label. It's used to define an address relative to a previous address. There is no previous address above "value" in that script.

Code:
alloc(newmem,2048)
label(value)

value:  // wrong: CE doesn't know where "value" is
  dd 0

newmem:
 // code...

Code:
alloc(newmem,2048)
label(value)

newmem:
 // code...

value:  // OK: "value" is an address somewhere after the code stored at "newmem"
  dd 0


Alternatively, declare "value" using alloc instead of label.
Code:
alloc(newmem,2048)
alloc(value,4)

value:  // OK: CE allocated memory specifically for "value"; it stands on its own
  dd 0

newmem:
 // code...

_________________
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
bhfff
Cheater
Reputation: 0

Joined: 19 Jan 2017
Posts: 30

PostPosted: Sun Aug 13, 2017 7:25 pm    Post subject: Reply with quote

ParkourPenguin wrote:

Alternatively, declare "value" using alloc instead of label.
Code:
alloc(newmem,2048)
alloc(value,4)

value:  // OK: CE allocated memory specifically for "value"; it stands on its own
  dd 0

newmem:
 // code...


Got it! Many thanks :)

p.s. I saw a lot of your posts on this forum and I appreciate a lot what you do.
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