Jump to content

Hardware Bkpoint


Rumour

Recommended Posts

How can set hardware bkpoint by asm code? (masm)

Google find only in C:

//Set your context flags like this
this->cx.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;//Creates a Hardware Break on Execute Breakpoint
bool DebugEngine::SetBreakOnExecute(DWORD addr)
{ if (!this->UpdateContext())
{
return false;
}
cx.Dr0 = addr; // set Bp addr
cx.Dr7 = 0x1; //activate it if(!this->SetContext())
{
return false;
} return true;
}

But I need in masm, google not find.

I ask in ARTeam too. No answer.

This perhaps somebody here have know how?

Thank for all tip.

Link to comment

omfg please leave asm if you dont know how to use it. seems its not for you.

its pure winapi not some ****ty mfc so what you want more, just write code with invoke.

go to msdn.com and read about context structure and those winapi's that are in other functions like SetContext

or is it too hard to write

mov cx.dr0,addr

and change cx to some other name due its asm, and cx is reg so is reserved word

so proper will be

mov context.dr0,addr

invoke SetThreadContext,pinfo.hThread,o context

in my unsafecast you have in masm how to use context and getthreadcontext so change g to s and you have set

Edited by human
Link to comment

Thank human. Will try him. Please accept I not superman. Need learn.

Sorry if this stupid question was, perhaps so noone answer at ARTeam.

I do what you say. Thank again.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...