Page 1 of 1

Not Removing Hardware Breakpoints?

PostPosted: Tue Dec 04, 2007 10:51 pm
by Shynd
About four hours ago, I was debugging a game and set a hardware breakpoint on its WSOCK32.dll:send instruction. I did my thing, whatever, closed the game, closed MHS. Now, four hours later, when I reopen the same game in OLLYDBG, that breakpoint still breaks:
Image

I didn't even know that's possible. I didn't re-set the breakpoint in OLLY. There's a few other breaks that hit on that game, too, that I didn't set at all. One is at 0x55789C (in the game executable module) and it doesn't have anything to do with anything. It seems to clear out if I restart my computer.

PostPosted: Tue Dec 04, 2007 10:59 pm
by Shynd
Update: The last time this happened, restarting fixed it. Now, it seems, restarting doesn't fix it. I have no idea, now, if this was an MHS problem or a my computer problem.

After restart, however, the breakpoint at WSOCK32.recv was no longer active. The others were, though. Weird.

PostPosted: Tue Dec 04, 2007 11:09 pm
by L. Spiro
OllyDbg resets breakpoints that it had set when you reload the process.
This is the only way you could get your breakpoints back after closing the game (unless the game never truly closed, which I assume is not a possibility).

All thread flags are cleared when the game closes, so it is impossible for the break to be there afterwards.


As for MHS’s working with the game, all breakpoints are removed as long as MHS closes normally (and it typically does).
But removing a hardware breakpoint does not require clearing the DR0-Dr3 registers; it requires only changing a single bit in the DR7, but when MHS closes for good it also unsets the respective Dr0-3 register.


Also note that if the hardware breakpoint is still set but no debugger is attached to the game, the game will crash on an unhandled trap exception.


L. Spiro

PostPosted: Tue Dec 04, 2007 11:09 pm
by Shynd
Update: I deleted Darkages.udd and Darkages.bak from my OLLYDBG folder and everything went back to normal. That's weird as hell. I don't know if that had something to do with OLLY and MHS or just OLLY or what. I apologize if this isnt' a bug with your program.