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 


[SOLVED] Aobscanmodule not activating

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

Joined: 30 Aug 2014
Posts: 12
Location: Johannesburg, South Africa

PostPosted: Sat Apr 28, 2018 7:56 am    Post subject: [SOLVED] Aobscanmodule not activating Reply with quote

Hi Guys,

Could anyone please explain why this code won't activate e.g. the checkbox won't tick

Code:

[ENABLE]

//-----------------------------------------------------------
// Ammo
//-----------------------------------------------------------
aobscanmodule(aobAmmo,FC_m64.dll,8B 43 0C 48 8B 5C 24 30)
registersymbol(aobAmmo)
alloc(varAmmoMemory,1024,FC_m64.dll)

label(lblAmmoCode)
label(lblAmmoSkip)
label(lblAmmoReturn)
globalalloc(varAmmo,4)

varAmmo:
  dd 0

//-----------------------------------------------------------
 
varAmmoMemory:
  cmp [varAmmo],1
  jne lblAmmoSkip


lblAmmoCode:
  // Activated Code
  mov eax,(int)99
  mov rbx,[rsp+30]
  jmp lblAmmoReturn

lblAmmoSkip:
  // Deactivated Code
  mov eax,[rbx+0C]
  mov rbx,[rsp+30]
  jmp lblAmmoReturn

aobAmmo:
  jmp varAmmoMemory
  nop
  nop
  nop

lblAmmoReturn:

//-----------------------------------------------------------

[DISABLE]

//-----------------------------------------------------------
// Ammo
//-----------------------------------------------------------
aobAmmo:
  db 8B 43 0C 48 8B 5C 24 30

unregistersymbol(aobAmmo)
dealloc(varAmmoMemory)


But this code does activate

Code:

[ENABLE]
aobscanmodule(aob_Ammo,FC_m64.dll,8B 43 0C 48 8B 5C 24 30)
registersymbol(aob_Ammo)
alloc(newmem_Ammo,1024,FC_m64.dll)
label(return_Ammo)

newmem_Ammo:
  mov eax,[rbx+0C]
  mov rbx,[rsp+30]
  jmp return_Ammo

aob_Ammo:
  jmp newmem_Ammo
  nop
  nop
  nop
return_Ammo:

[DISABLE]
aob_Ammo:
  db 8B 43 0C 48 8B 5C 24 30

unregistersymbol(aob_Ammo)
dealloc(newmem_Ammo)


I'm pretty sure I'm missing something here but I can't see it.


Last edited by Maniac088 on Sat Apr 28, 2018 9:15 am; edited 2 times in total
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Apr 28, 2018 8:28 am    Post subject: Reply with quote

Didn't really see a reason why it wouldn't activate.
try pressing Ctrl+Alt+A put the enable code there and execute, this tends to give better error messages.

_________________
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sat Apr 28, 2018 8:36 am    Post subject: Reply with quote

The cmp instruction is attempting to directly address a memory location that could be outside the range RIP-relative addressing allows.

Instead of using globalalloc, you could define it as a label inside the allocated memory and register the symbol.
Code:
...
label(varAmmo)
registersymbol(varAmmo)

varAmmoMemory+300:
varAmmo:
  dd 0
...
Don't forget to unregister the symbol in the disable section.
_________________
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
Maniac088
Newbie cheater
Reputation: 0

Joined: 30 Aug 2014
Posts: 12
Location: Johannesburg, South Africa

PostPosted: Sat Apr 28, 2018 9:06 am    Post subject: Reply with quote

TheyCallMeTim13 wrote:
Didn't really see a reason why it wouldn't activate.
try pressing Ctrl+Alt+A put the enable code there and execute, this tends to give better error messages.


@TheyCallMeTim13 Thank you for your reply, is that for the API Hook Template?

ParkourPenguin wrote:
The cmp instruction is attempting to directly address a memory location that could be outside the range RIP-relative addressing allows.

Instead of using globalalloc, you could define it as a label inside the allocated memory and register the symbol.
Code:
...
label(varAmmo)
registersymbol(varAmmo)

varAmmoMemory+300:
varAmmo:
  dd 0
...
Don't forget to unregister the symbol in the disable section.


@ParkourPenguin Thank you, that is exactly what was stopping it from activating. weird I've used that code on quite a few games without problem
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Apr 28, 2018 9:48 am    Post subject: Reply with quote

It's for any Auto Assembler code.
_________________
Back to top
View user's profile Send private message Visit poster's website
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