daily pastebin goal
16%
SHARE
TWEET

enpm691

a guest Mar 23rd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## printf formating
  2.  
  3. '%d' - integer placeholder
  4. %f - floating point stuff aka decimal
  5. %c - char
  6. %s - string
  7. %x - hex format, prints any INTs to hex format
  8. %p - prints the pointer/address from input &var
  9.  
  10. ## pointers
  11.  
  12. int a = 5;         
  13. int *p;
  14. p = &a // assigning mem adr to a var
  15. printf("pointer is at: %p\n",p);    //prints a mem addr*
  16. printf("value at p: %d\n",*p);  //prints int 5
  17.  
  18. &  //address of something
  19.  
  20.  
  21. #Useful function
  22. -------------------
  23.  
  24. int x;
  25. sizeof(x)  // gives how big int is in bytes.
  26. getchar(); //waits for input, useful for examining
  27.  
  28.  
  29. #terminal/commands
  30. ------------------
  31.  
  32. *check mem map*
  33. cat /proc/[PID]/maps
  34.  
  35. *aslr check*
  36. cat /proc/sys/kernel/randomize_va_space
  37.  
  38. *turn off aslr*
  39. sudo bash -c "echo 0 > /proc/sys/kernel/randomize_va_space"
  40.  
  41. *dissassmble binary via object dump*
  42. objdump -d binaryFileName
  43. objdump -d binaryFilename | grep main // to narrow things down
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top