- 1 year ago
How to suspend another process before it executes main
Comment
1 / 1
To suspend another process before it executes main
, you can use a debugger to attach to the process and set a breakpoint at the beginning of main
. Here's an example using WinDbg:
- Start WinDbg as an administrator.
- Open the executable you want to debug:
File
>Open Executable
or pressCtrl+E
. - Set the breakpoint at
main
:bp main
. - Start the process with the
g
command:g
. - The process will pause at the breakpoint at the beginning of
main
. You can now examine the state of the process and modify it as needed.
Note that this technique requires that you have access to the source code of the executable, and that you are able to compile it with debugging information.