Guest User

Untitled

a guest
Apr 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. #include "kpe.h"
  6.  
  7. int main(){
  8. struct kpe_cmd_opts opts, *opts_p;
  9. opts_p = &opts;
  10.  
  11. opts.start = 0xc0101a50;
  12. opts.end = 0xc0101a55;
  13. opts.duration = 100;
  14. opts.dump = 1;
  15. opts.name = "testing";
  16. opts.location = "somewhere";
  17.  
  18. printf("Pointer to struct: %p with size: %i\n", opts_p, sizeof(opts));
  19. printf("Location: %s\n", opts.location);
  20.  
  21. FILE * fp = fopen("/proc/uptime", "rw");
  22. //if (fwrite(fp, opts.location) == NULL) printf("Error writing address location");
  23.  
  24. int i = 0;
  25. char c;
  26. char line[17];
  27. ### while((c = fgetc(fp)) != EOF) strcat(line, &c);
  28.  
  29. printf("Location passed: %s", line);
  30.  
  31. return 0;
  32. }
Add Comment
Please, Sign In to add comment