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 


Count instructions / clock cycles between breakpoints

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Corruptor
Advanced Cheater
Reputation: 3

Joined: 10 Aug 2011
Posts: 84

PostPosted: Wed Jun 06, 2012 12:16 pm    Post subject: Count instructions / clock cycles between breakpoints Reply with quote

Well, headline sums it up pretty well i guess, is there any way to count them? (like, except for step-by-steping manually, which usually takes a lot of time)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Wed Jun 06, 2012 12:50 pm    Post subject: Reply with quote

Breakpoints take way to long:
Bp interrupt fires, windows checks where to pass it off to. Wait till the debugger thread gets a cpu slice, handle the breakpoint, do stuff...
Mark process as executable again and wait
Then finally the process that the breakpoint happened in gets to continue

In short the breakpoint itself would most likely take up more time than the number of cpu ticks the code would have taken normally

Go with small code injections instead. Do a code injection at point 1 and a code injection at point 2

in code injection 1 do a rdtsc to store the current timestamp

in code injection 2 call rdtsc again, take the difference, and you'll have something that resembles the clock cycles between the two points

Note though that this can be variable due to task-switches occurring between the two spots

The only perfect way to count all instructions is to single step every single one of them, including kernelmode

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Corruptor
Advanced Cheater
Reputation: 3

Joined: 10 Aug 2011
Posts: 84

PostPosted: Thu Jun 07, 2012 9:34 am    Post subject: Reply with quote

thx, worked perfectly again Very Happy
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