Jump to content
Tuts 4 You

Patching with threading?


high6

Recommended Posts

If I patch code that a thread could be executing, should I pause the thread first? Or is it safe as long as I use "REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS:[ESI]"? I know using a forloop would definitely cause problems.

Link to comment

I think you should pause first. Not sure what happens when you pause, patch and resume the thread while it's executing that code.

Link to comment

Agree to K, and I'm not sure about the second part - though I remember something about the CPU caching the instruction currently being executed (that theory is supported by the existence of a FlushInstructionCache API).

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...