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 


find out what address access this instruction in lua

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

Joined: 29 May 2014
Posts: 14
Location: Jupiter

PostPosted: Thu May 29, 2014 1:45 am    Post subject: find out what address access this instruction in lua Reply with quote

Hi
i was wondering if it's possible to use the "find out what address access this instruction" function on an aobscan result.
for example:
[ENABLE]
alloc(newmem,2048)

label(AddressToHack) <---- The address which access the AoBresult
registersymbol(AddressToHack)

aobscan(AoBresult,F3 0F 7E 4A 30 66 0F 2E D9)

AddressToHack:
Find_out_what_address_access_this_instruction(AoBresult) <---- thats what im trying to do

[DISABLE]
dealloc(newmem)
unregistersymbol(AddressToHack)


sorry if i made any programming mistakes, im a complete noob in using lua.
and thanks
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu May 29, 2014 2:05 am    Post subject: Reply with quote

You don't need LUA for this. The addresses don't access the instruction, the instruction accesses the addresses. To find the instruction, just search for that array of bytes. When you have found the instruction, right-click on it to see which addresses it accesses.
Back to top
View user's profile Send private message
omax
Newbie cheater
Reputation: 0

Joined: 29 May 2014
Posts: 14
Location: Jupiter

PostPosted: Thu May 29, 2014 2:19 am    Post subject: Reply with quote

i know this already. im trying to make a trainer, but the address which i want to hack changes when ever i select another level and pointers won't work, so i wanted to use the aob of the instruction which access the address i want to hack and then reverse the process in the script of the trainer in order to find that address
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu May 29, 2014 3:08 am    Post subject: Reply with quote

So, then what's the problem? Write a script with AOB and load the register that is holding your value in to a custom address...it will give you the address every time, even if it changes. The only thing you might have to do is filter out any unwanted addresses.
Back to top
View user's profile Send private message
omax
Newbie cheater
Reputation: 0

Joined: 29 May 2014
Posts: 14
Location: Jupiter

PostPosted: Thu May 29, 2014 2:11 pm    Post subject: Reply with quote

no that's not the case. the array of byte of the address i want to find and its surrounding AoB are not constant and disappear as soon as i change my level or reset the game, and pointers wouldn't work either. the only way to find that address is to find it through an instruction (i already have its AoB) which writes on to the address. my question is if it's possible to use the "Find out what address access this instruction" function in a script to make it an automatic process since i'm making a trainer

and thanks a lot for the fast reply METHOS
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu May 29, 2014 3:31 pm    Post subject: Reply with quote

And what I'm saying is...use the AOB of the instruction to find its location in memory viewer, from there, write a script (let CE build it) that incorporates AOB that makes use of a custom address that will give you the address from the register.

In other words...instead of using AOB to find the location of the address that holds the value that you want to manipulate, use AOB to find the instruction that writes/accesses that address.

This is what I've been saying the whole time.
Back to top
View user's profile Send private message
omax
Newbie cheater
Reputation: 0

Joined: 29 May 2014
Posts: 14
Location: Jupiter

PostPosted: Thu May 29, 2014 4:40 pm    Post subject: Reply with quote

never mind. i found a constant AoB ,a bit far away from the address i was looking form, and it also changed it's place by the same amount the address did when i change levels. so now im using AoB scan and then add the offset to reach the address i was looking for.
thanks a lot METHOS for your precious time Smile
Back to top
View user's profile Send private message
omax
Newbie cheater
Reputation: 0

Joined: 29 May 2014
Posts: 14
Location: Jupiter

PostPosted: Thu Jun 26, 2014 7:50 am    Post subject: Reply with quote

Sorry for my stupid replies. at that time i didn't really know much on assembly language an how it works so i didn't understand what you meant. but now my problem is that i not sure how are you supposed to toggle break points in auto assemble. what im trying to do it to find the address saved in the esi registry at a particular point and to do that you need to use toggle break points but i'm not sure how would you do that using auto assembly.

EDIT:
ok i solved the problem myself. i used the following code:
Code:

debugProcess()  -- Attach Debugger to the process.
debug_setBreakpoint("on_ground_instruction")  -- Address where to set breakpoint
function debugger_onBreakpoint()
  local OnGround_address=ESI
  print (OnGround_address);
  debug_removeBreakpoint("on_ground_instruction")
end

but im having two problems now. the first one is that the process gets paused and i cannot unpause it using the unpause() function... the only way to unpause is by pressing f9 on cheat engine's debugger which i don't want to do. the second problem is that when i print the OnGround_address it is shown in decimal not in hex.
Back to top
View user's profile Send private message
Rissorr
Master Cheater
Reputation: 3

Joined: 17 Sep 2013
Posts: 273
Location: Israel!

PostPosted: Thu Jun 26, 2014 3:09 pm    Post subject: Reply with quote

I think you just need to understand how all the:
AoB = instruction bytes ->{accssesing to} -> address
is working.
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu Jun 26, 2014 4:08 pm    Post subject: Reply with quote

Quote:
debugProcess() -- Attach Debugger to the process.
debug_setBreakpoint("on_ground_instruction") -- Address where to set breakpoint
function debugger_onBreakpoint()
local OnGround_address=ESI
print (OnGround_address);
debug_removeBreakpoint("on_ground_instruction");
return 1;
end

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
omax
Newbie cheater
Reputation: 0

Joined: 29 May 2014
Posts: 14
Location: Jupiter

PostPosted: Thu Jun 26, 2014 4:28 pm    Post subject: Reply with quote

@DaSpammer. thank you so much (for another awesome informative spam Wink ) it actually worked, although i don't know why it did ... thanks to my noobishness Very Happy i never understood what return does Laughing .

@mixmax35 . thanks a lot for the reply. but how would you do : accessing to, in a lua or auto assembler script. i'm really sorry for repeating the same question again and again for the 917382813th time. and also is it possible for the OnGround_address' value to be saved in hex instead of decimal.
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 Lua Scripting 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