| View previous topic :: View next topic |
| Author |
Message |
Griffin Cheater
Reputation: 0
Joined: 17 Feb 2008 Posts: 46
|
Posted: Sat Feb 23, 2008 5:54 am Post subject: Debugger help |
|
|
Hello I was wondering if it is possible to set a breakpoint when any register is equal to a specific value, or the value pointed to by a register is equal to a value. Failing that if it is possible with just one register, or either just the value or the pointed to value.
I'm trying to get this code (only the relevant part):
| Code: | for(int i = 0; i < 11; i++) ;
if(i == 10)
cout << "i == 10";
|
To give me "i == 10" so I want to set a breakpoint for when i == 10 during the loop but want it to work if I were to change i to a pointer to an int.
I'm sure there might be better ways but I really only want to do it my way, any help is appreciated.
|
|
| Back to top |
|
 |
Labyrnth Moderator
Reputation: 10
Joined: 28 Nov 2006 Posts: 6301
|
Posted: Sat Feb 23, 2008 1:06 pm Post subject: |
|
|
You would have to trace it in a debugger and see how it works.
Use olly and do a step method.
|
|
| Back to top |
|
 |
Griffin Cheater
Reputation: 0
Joined: 17 Feb 2008 Posts: 46
|
Posted: Sat Feb 23, 2008 1:15 pm Post subject: |
|
|
| Labyrnth wrote: | You would have to trace it in a debugger and see how it works.
Use olly and do a step method. |
I was hoping that wouldn't be the case, my only computer that runs windows is rather old and slow.
If anyone thinks of a way to avoid the long method please do tell, else tomorrow will be one long day.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Feb 24, 2008 6:42 am Post subject: |
|
|
| You could inline patch some code to compare to 10 then jump to a certain instruction when that is the case, else continue. ie. JE. Then set a BP on the instruction the JE goes to. A pretty intrusive method but it'd do the job although it might slow things down a little. So you would compare the register's value to 10 on each iteration.
|
|
| Back to top |
|
 |
|