Permalink
Browse files
better debug output in mach_inject
- Loading branch information...
Showing
with
2 additions
and
4 deletions.
-
+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