Created
October 13, 2016 21:50
-
-
Save dtouch3d/7e2dbadc03c482b6f7bddae58d6c40de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import angr | |
p = angr.Project(sys.argv[1], load_options={'auto_load_libs': False}) | |
s = p.factory.entry_state() | |
def malloc_print(state): | |
print("Called malloc!") | |
def free_print(state): | |
print("Called Free!") | |
p.hook_symbol('free', free_print) | |
p.hook_symbol('malloc', malloc_print) | |
pg = p.factory.path_group(s) | |
pg.explore() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* compiled with gcc -o test test.c */ | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int* ptr = malloc(1024); | |
free(ptr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment