This file contains hidden or 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
#include <stdio.h> | |
#include <cpuid.h> | |
#include <stdint.h> | |
int cpu_supports_cet_shadow_stack() { | |
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; | |
__cpuid_count(7, 0, eax, ebx, ecx, edx); | |
return (ecx & (1 << 7)) != 0; | |
} |
This file contains hidden or 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
If you have a list of edge hashes produced by AFL (e.g. from something like this): | |
./afl-showmap -o foo.edges -t 500 -q -e -- ./program arg1 | |
Re-run the program using gdb to trace the sequence of block IDs: | |
./collect_coverage.sh trace.txt ./program arg1 | |
Print edges in the trace: |