mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-08 16:21:32 +00:00
neverzero for unicorn_mode
This commit is contained in:
parent
bec9b307db
commit
c5e0b29a22
@ -46,7 +46,7 @@ void afl_maybe_log(target_ulong cur_loc) {
|
||||
|
||||
static __thread abi_ulong prev_loc;
|
||||
|
||||
register target_ulong afl_idx = cur_loc ^ prev_loc;
|
||||
register uintptr_t afl_idx = cur_loc ^ prev_loc;
|
||||
|
||||
#if (defined(__x86_64__) || defined(__i386__)) && defined(AFL_QEMU_NOT_ZERO)
|
||||
asm volatile (
|
||||
|
@ -144,7 +144,7 @@ echo "[+] Configuration complete."
|
||||
|
||||
echo "[*] Attempting to build Unicorn (fingers crossed!)..."
|
||||
|
||||
UNICORN_QEMU_FLAGS='--python=python2' make || exit 1
|
||||
UNICORN_QEMU_FLAGS='--python=python2' make -j `nproc` || exit 1
|
||||
|
||||
echo "[+] Build process successful!"
|
||||
|
||||
|
@ -241,7 +241,21 @@ static inline void afl_maybe_log(unsigned long cur_loc) {
|
||||
// DEBUG
|
||||
//printf("cur_loc = 0x%lx\n", cur_loc);
|
||||
|
||||
afl_area_ptr[cur_loc ^ prev_loc]++;
|
||||
register uintptr_t afl_idx = cur_loc ^ prev_loc;
|
||||
|
||||
#if (defined(__x86_64__) || defined(__i386__)) && defined(AFL_QEMU_NOT_ZERO)
|
||||
asm volatile (
|
||||
"incb (%0, %1, 1)\n"
|
||||
"seto %%al\n"
|
||||
"addb %%al, (%0, %1, 1)\n"
|
||||
: /* no out */
|
||||
: "r" (afl_area_ptr), "r" (afl_idx)
|
||||
: "memory", "eax"
|
||||
);
|
||||
#else
|
||||
afl_area_ptr[afl_idx]++;
|
||||
#endif
|
||||
|
||||
prev_loc = cur_loc >> 1;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user