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 


how to save address or addresses from debugger

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

Joined: 17 Feb 2016
Posts: 40

PostPosted: Sun Mar 27, 2016 2:01 pm    Post subject: how to save address or addresses from debugger Reply with quote

how to save address or addresses from the debugger
function debugger_onBreakpoint()
money=EDI + 0x35
SavedAddress =readDouble(money)
return 1
end

debug_removeBreakpoint()
if (isKeyPressed(VK_F2)) then
writeDouble(SavedAddress,9999)
end
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Mar 27, 2016 6:50 pm    Post subject: Reply with quote

Code:
function debugger_onBreakpoint()
  SavedAddress = EDI
  return 1
end

Code:
if (isKeyPressed(VK_F2)) then
  writeDouble(SavedAddress + 0x35, 9999)
end
Back to top
View user's profile Send private message
HyberCode
Cheater
Reputation: 0

Joined: 17 Feb 2016
Posts: 40

PostPosted: Tue Mar 29, 2016 3:07 am    Post subject: Reply with quote

Zanzer wrote:
Code:
function debugger_onBreakpoint()
  SavedAddress = EDI
  return 1
end

Code:
if (isKeyPressed(VK_F2)) then
  writeDouble(SavedAddress + 0x35, 9999)
end


are you sure this working ? cuz if i remove the breakpoint and press F2 nothing happen
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Tue Mar 29, 2016 8:36 am    Post subject: Reply with quote

Do you have that if statement in a timer? If you're only running it once, then it's only going to check the f2 key once.
_________________
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
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Mar 29, 2016 5:31 pm    Post subject: Reply with quote

Don't keep executing the function.
Code:
createHotkey(function()
  writeDouble(SavedAddress + 0x35, 9999)
end, VK_F2)
Back to top
View user's profile Send private message
HyberCode
Cheater
Reputation: 0

Joined: 17 Feb 2016
Posts: 40

PostPosted: Tue Mar 29, 2016 5:58 pm    Post subject: Reply with quote

Zanzer wrote:
Don't keep executing the function.
Code:
createHotkey(function()
  writeDouble(SavedAddress + 0x35, 9999)
end, VK_F2)


how to make SavedAddress local ?
for example
writeDouble(local = SavedAddress + 0x35, 9999)
ps : not working
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Mar 29, 2016 6:20 pm    Post subject: Reply with quote

Sounds like you're using the wrong address/offset. My code's perfect. Smile
Your 0x35 offset sounds completely wrong.
Back to top
View user's profile Send private message
HyberCode
Cheater
Reputation: 0

Joined: 17 Feb 2016
Posts: 40

PostPosted: Tue Mar 29, 2016 6:37 pm    Post subject: Reply with quote

Zanzer wrote:
Sounds like you're using the wrong address/offset. My code's perfect. Smile
Your 0x35 offset sounds completely wrong.

yep it works fine ... the problem is it always choose the first address and save it to "SavedAddress" ... if i changed "SavedAddress" to local variable ... it will take all the addresses and save it to "SavedAddress" and changing them together

i need way to change global variable to local variable ... do you know how to do that ?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Mar 29, 2016 6:52 pm    Post subject: Reply with quote

Not sure I understand what you want.
That breakpoint will keep overwriting SavedAddress every time its code is executed.
So when you press the hokey, it will update the LAST address touched by the breakpoint.

Do you only want SavedAddress to use the very first address it touches?
Code:
SavedAddress = 0
function debugger_onBreakpoint()
  if SavedAddress == 0 then
    SavedAddress = EDI
  end
  return 1
end


Do you want your hotkey to update all addresses that the instruction has ever touched?
Code:
SavedAddress = {}
function debugger_onBreakpoint()
  SavedAddress[EDI] = true
  return 1
end

Code:
createHotkey(function()
  for i in pairs(SavedAddress) do
    writeDouble(i + 0x35, 9999)
  end
end, VK_F2)
Back to top
View user's profile Send private message
HyberCode
Cheater
Reputation: 0

Joined: 17 Feb 2016
Posts: 40

PostPosted: Tue Mar 29, 2016 7:04 pm    Post subject: Reply with quote

Zanzer wrote:
Not sure I understand what you want.
That breakpoint will keep overwriting SavedAddress every time its code is executed.
So when you press the hokey, it will update the LAST address touched by the breakpoint.

Do you only want SavedAddress to use the very first address it touches?
Code:
SavedAddress = 0
function debugger_onBreakpoint()
  if SavedAddress == 0 then
    SavedAddress = EDI
  end
  return 1
end


Do you want your hotkey to update all addresses that the instruction has ever touched?
Code:
SavedAddress = {}
function debugger_onBreakpoint()
  SavedAddress[EDI] = true
  return 1
end

Code:
createHotkey(function()
  for i in pairs(SavedAddress) do
    writeDouble(i + 0x35, 9999)
  end
end, VK_F2)


thanks for helping mate )
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