What Posted March 6, 2008 Share Posted March 6, 2008 I have been looking into setting hardware breakpoints, I googled the hell out of it, anyway, every site I go to says set dr7 to 101, which although it works, it isnt very helpful, I was wondering if anyone could explain how to set the dr7 right especially when there is more then 1 hardware breakpoint and where to put the settings for type (access, write, execute) for each breakpoint. Thank you for you time. Link to comment
GaBoR Posted March 6, 2008 Share Posted March 6, 2008 See Intel 64 and IA-32 Architectures Software Developer’s Manual, System Programming Guide:http://www.intel.com/design/processor/manuals/253668.pdfhttp://download.intel.com/design/processor...uals/253669.pdf Link to comment
Killboy Posted March 6, 2008 Share Posted March 6, 2008 Found a pretty good source in C++ which doesnt seem to edit DR7 just hardcoded but somehow calculates it. I dont have a clue about that myself so I couldnt tell you why it is done which way. http://www.morearty.com/code/breakpoint/breakpoint.zip Especially look at that piece of code: SetBits(cxt.Dr7, 16 + (m_index*4), 2, when);SetBits(cxt.Dr7, 18 + (m_index*4), 2, len);SetBits(cxt.Dr7, m_index*2, 1, 1); where 'when' decides whether its hwbp on write (3) or read (1). Not sure about execute, should be either 2 or 0 Look at breakpoint.h for the implementation of SetBits Link to comment
What Posted March 7, 2008 Author Share Posted March 7, 2008 (edited) Well, that was confusing as hell, but I think I got it, I guess you have to place 32 bits of info into 1 dword and reset the regflag. For instance if you just want to set all for breakpoints to execute on execution, you set dr7 to 257. Still a little confused. Thanks for the Intel manual and example. Edited March 8, 2008 by What Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now