Permalink
Browse files

better debug output in mach_inject

  • Loading branch information...
albertz committed Sep 7, 2011
1 parent 555faca commit 5cfbabe69b568b20c91540aa2eded31716e79204
Showing with 2 additions and 4 deletions.
  1. +2 −4 mach_inject/mach_inject.c
@@ -79,7 +79,6 @@ mach_inject(
if( !err ) {
err = task_for_pid( mach_task_self(), targetProcess, &remoteTask );
#if defined(__i386__) || defined(__x86_64__)
- MACH_ERROR("mach_inject failing..", err);
if (err == 5) fprintf(stderr, "Could not access task for pid %d. You probably need to add user to procmod group\n", targetProcess);
#endif
}
@@ -274,16 +273,15 @@ mach_inject(
#endif
if( err ) {
+ MACH_ERROR("mach_inject failing..", err);
if( remoteParamBlock )
vm_deallocate( remoteTask, remoteParamBlock, paramSize );
if( remoteCode )
vm_deallocate( remoteTask, remoteCode, imageSize );
if( remoteStack )
vm_deallocate( remoteTask, remoteStack, stackSize );
}
-
- printf("mach inject done? %d\n", err);
-
+
return err;
}

0 comments on commit 5cfbabe

Please sign in to comment.