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 


debug

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

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Mon Oct 17, 2016 8:03 am    Post subject: debug Reply with quote

It's been a good time to use debuggers, bad I have trouble debugging of more than one address.
Code:

base_addressA = "2fd4657"
base_addressB = "1aef345"

How can I debug these two addresses, wherein:
addressA = EAX
addressB = EDI

If it were only 1 for me is quiet 2 more, I can not properly.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Oct 17, 2016 4:19 pm    Post subject: Reply with quote

You're going to have to give a bit more context if you want help.
Show the instruction(s) you're debugging and the code you've got.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Mon Oct 17, 2016 7:02 pm    Post subject: Reply with quote

I managed to solve the problem.
I tried that. however there was no time address to be debugged.
Code:

function scanArray(findValue, protectionFlags)

   if foundlist then foundlist.destroy() end
    if memscan then memscan.destroy() end

   memscan = createMemScan()
   foundlist = createFoundList(memscan)


  memscan.firstScan(soExactValue, vtByteArray, rtTruncated, findValue, nil,
               "00000000", "7fffffff", protectionflags,
               fsmAligned,"1",
               true, false, false, false)


  memscan.waitTillDone()
  foundlist.initialize()

  resultScan = foundlist.Address[0]

  memscan.Destroy()
  foundlist.Destroy()

     return resultScan
end

address_1 = scanArray("F3 0F 7E 51 20 F2 0F 59 D0", "-W+X-C")
address_2 = scanArray("66 0F D6 47 20 8B 53 60", "-W+X-C")

debug_setBreakpoint(address_1)
function debugger_onBreakpoint()
         adr1 = ECX

         return 1
end
debug_removeBreakpoint(address_1)

debug_setBreakpoint(address_2)
function debugger_onBreakpoint()
         adr2 = EAX

         return 1
end
debug_removeBreakpoint(address_2)

print(adr1)
print(adr2)


But I managed to solve so if you know a better way tell me.
Code:

function scanArray(findValue, protectionFlags)

   if foundlist then foundlist.destroy() end
    if memscan then memscan.destroy() end

   memscan = createMemScan()
   foundlist = createFoundList(memscan)


  memscan.firstScan(soExactValue, vtByteArray, rtTruncated, findValue, nil,
               "00000000", "7fffffff", protectionflags,
               fsmAligned,"1",
               true, false, false, false)


  memscan.waitTillDone()
  foundlist.initialize()

  resultScan = foundlist.Address[0]

  memscan.Destroy()
  foundlist.Destroy()

     return resultScan
end

address_1 = scanArray("F3 0F 7E 51 20 F2 0F 59 D0", "-W+X-C")
address_2 = scanArray("66 0F D6 47 20 8B 53 60", "-W+X-C")



function debugger_onBreakpoint()
         adr1 = ECX
         debug_removeBreakpoint(address_1)

         function debugger_onBreakpoint()
                  adr2 = EAX
                  debug_removeBreakpoint(address_2)
         return 1
         end
         debug_setBreakpoint(address_2)

         return 1
end
debug_setBreakpoint(address_1)

print(adr1)
print(adr2)
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Oct 17, 2016 7:13 pm    Post subject: Reply with quote

debug_setBreakpoint() can accept a function parameter so that it executes a different function entirely just for that breakpoint.
Code:
debug_setBreakpoint(address_1, 1, bptExecute, function()
  adr1 = ECX
  debug_removeBreakpoint(address_1)
  debug_continueFromBreakpoint(co_run)
  return 1
end)

debug_setBreakpoint(address_2, 1, bptExecute, function()
  adr2 = EAX
  debug_removeBreakpoint(address_2)
  debug_continueFromBreakpoint(co_run)
  return 1
end)
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