I am currently writing some debugging tools for personal use, and I am trying to write a software breakpoint to msvcrt.dll's printf function. As I have done error checking, my program tells me that the access is denied. How can I fix that ? With VirtualProtectEx ? That is not working.
WriteProcessMemory fails, too.
if (WriteProcessMemory(h, (void*)address, "\xcc", 1, NULL))
{
printf("set breakpoint..\n");
}
else
printf("Failed setting breakpoint..\n");
this code fails and I think it has to do with access rights. Maybe VirtualProtectEx ?