Advertisement
FlyFar

call.c

May 17th, 2024
807
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | Cybersecurity | 0 0
  1. /*
  2.  * an example to interface our syscall
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <sys/syscall.h>
  7. #include <unistd.h>
  8. #include <stdlib.h>
  9.  
  10. #define OFFSET 210
  11.  
  12. int
  13. main(int argc, char **argv)
  14. {
  15.     int error;
  16.  
  17.     if(argc != 3) {
  18.         printf("Usage:\n%s pid uid\n", argv[0]);
  19.         exit(1);
  20.     }
  21.    
  22.     error = syscall(OFFSET, atoi(argv[1]), atoi(argv[2]));
  23.  
  24.     if(error)
  25.         perror("syscall()");
  26.  
  27.     return 0;
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement