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 


Issue with CMP

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
KalasDev
Master Cheater
Reputation: 1

Joined: 29 May 2016
Posts: 311

PostPosted: Mon Oct 02, 2017 3:26 pm    Post subject: Issue with CMP Reply with quote

Code:
{ Game   : FoL.exe
  Version:
  Date   : 2017-10-02
  Author : Kalas

  This script does blah blah blah
}

[ENABLE]

aobscan(Health,89 47 4C 85 C0)
alloc(newmem,$100,Health)

alloc(PlayerHealth, 1)
registersymbol(PlayerHealth)
PlayerHealth:
  db 0

alloc(EnemyHealth, 1)
registersymbol(EnemyHealth)
EnemyHealth:
  db 0

label(code)
label(return)
label(PlayerCheck)
label(EnemyCheck)

newmem:
  cmp [rdi+88], 1
  je PlayerCheck
  cmp [rdi+88], 0
  je EnemyCheck
  jmp code

PlayerCheck:
  cmp byte ptr [PlayerCheck], 1
  jne code
  mov eax, #5
  jmp code

EnemyCheck:
  cmp byte ptr [EnemyCheck], 1
  jne code
  mov eax, #0
  jmp code

code:
  mov [rdi+4C],eax
  test eax,eax
  jmp return

Health:
  jmp newmem
return:
registersymbol(Health)

[DISABLE]

Health:
  db 89 47 4C 85 C0

unregistersymbol(Health)
unregistersymbol(PlayerHealth)
unregistersymbol(EnemyHealth)
dealloc(newmem)
dealloc(PlayerHealth)
dealloc(EnemyHealth)


I'm trying to make this work as when I get hit It will write 5 or Max Health to me and 0 to enemies.

It won't work.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Oct 02, 2017 3:54 pm    Post subject: Reply with quote

Code:

  cmp byte ptr [PlayerCheck], 1


Code:

  cmp byte ptr [EnemyCheck], 1


will never be true

you probably want to use PlayerHealth and EnemyHealth instead

_________________
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
KalasDev
Master Cheater
Reputation: 1

Joined: 29 May 2016
Posts: 311

PostPosted: Mon Oct 02, 2017 4:16 pm    Post subject: Reply with quote

Oh my god, I'm so embarrassed.
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