Guest User

Untitled

a guest
Apr 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4.  
  5. int main() {
  6. uintptr_t *p1 = malloc(0);
  7. uintptr_t *p2 = malloc(0);
  8.  
  9. free(p2);
  10.  
  11. // UAF
  12. *p2 = (uintptr_t)p2 - 0x10;
  13.  
  14. uintptr_t *p3 = malloc(0);
  15.  
  16. fprintf(stderr, "Fastbin loop: %p,%p,%p\n", p3, malloc(0), malloc(0));
  17.  
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment