Advertisement
Guest User

Untitled

a guest
Jul 7th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <BPatch.h>
  2. int main()
  3. {
  4.     BPatch bpatch;
  5.     int mutateePid = fork();
  6.  
  7.     if(mutateePid == 0)
  8.     {
  9.         char *args[3] = {NULL};
  10.         args[0] = "/usr/lib/firefox/firefox";
  11.         args[1] = "-h";
  12.         execvp("/usr/lib/firefox/firefox", args);
  13.     }
  14.  
  15.     BPatch_process *proc = bpatch.processAttach(NULL, mutateePid);
  16.     proc->continueExecution();
  17.  
  18.     while (!proc->isTerminated()) {
  19.         bpatch.waitForStatusChange();
  20.     }
  21.     proc->detach(true);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement