Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## printf formating
- '%d' - integer placeholder
- %f - floating point stuff aka decimal
- %c - char
- %s - string
- %x - hex format, prints any INTs to hex format
- %p - prints the pointer/address from input &var
- ## pointers
- int a = 5;
- int *p;
- p = &a // assigning mem adr to a var
- printf("pointer is at: %p\n",p); //prints a mem addr*
- printf("value at p: %d\n",*p); //prints int 5
- & //address of something
- #Useful function
- -------------------
- int x;
- sizeof(x) // gives how big int is in bytes.
- getchar(); //waits for input, useful for examining
- #terminal/commands
- ------------------
- *check mem map*
- cat /proc/[PID]/maps
- *aslr check*
- cat /proc/sys/kernel/randomize_va_space
- *turn off aslr*
- sudo bash -c "echo 0 > /proc/sys/kernel/randomize_va_space"
- *dissassmble binary via object dump*
- objdump -d binaryFileName
- objdump -d binaryFilename | grep main // to narrow things down
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement