diff options
author | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-10-13 13:03:06 +0200 |
---|---|---|
committer | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-10-13 13:03:06 +0200 |
commit | dcfccb2a0d6d351588d6e312410974b36462bbce (patch) | |
tree | 5e37392a085a19289b2648f7d69eca2eb0b713e4 | |
parent | ac5b0a3b34ab63e33bbaa336518f206f8ba8698f (diff) | |
download | afl++-dcfccb2a0d6d351588d6e312410974b36462bbce.tar.gz |
reverse bytes compcov in unicorn
-rw-r--r-- | unicorn_mode/patches/afl-unicorn-tcg-runtime-inl.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/unicorn_mode/patches/afl-unicorn-tcg-runtime-inl.h b/unicorn_mode/patches/afl-unicorn-tcg-runtime-inl.h index 95e68302..12e33b2f 100644 --- a/unicorn_mode/patches/afl-unicorn-tcg-runtime-inl.h +++ b/unicorn_mode/patches/afl-unicorn-tcg-runtime-inl.h @@ -38,7 +38,7 @@ void HELPER(afl_compcov_log_16)(void* uc_ptr, uint64_t cur_loc, uint64_t arg1, u8* afl_area_ptr = ((struct uc_struct*)uc_ptr)->afl_area_ptr; - if ((arg1 & 0xff) == (arg2 & 0xff)) { INC_AFL_AREA(cur_loc); } + if ((arg1 & 0xff00) == (arg2 & 0xff00)) { INC_AFL_AREA(cur_loc); } } @@ -47,13 +47,13 @@ void HELPER(afl_compcov_log_32)(void* uc_ptr, uint64_t cur_loc, uint64_t arg1, u8* afl_area_ptr = ((struct uc_struct*)uc_ptr)->afl_area_ptr; - if ((arg1 & 0xff) == (arg2 & 0xff)) { + if ((arg1 & 0xff000000) == (arg2 & 0xff000000)) { - INC_AFL_AREA(cur_loc); - if ((arg1 & 0xffff) == (arg2 & 0xffff)) { + INC_AFL_AREA(cur_loc +2); + if ((arg1 & 0xff0000) == (arg2 & 0xff0000)) { INC_AFL_AREA(cur_loc + 1); - if ((arg1 & 0xffffff) == (arg2 & 0xffffff)) { INC_AFL_AREA(cur_loc + 2); } + if ((arg1 & 0xff00) == (arg2 & 0xff00)) { INC_AFL_AREA(cur_loc); } } @@ -66,27 +66,27 @@ void HELPER(afl_compcov_log_64)(void* uc_ptr, uint64_t cur_loc, uint64_t arg1, u8* afl_area_ptr = ((struct uc_struct*)uc_ptr)->afl_area_ptr; - if ((arg1 & 0xff) == (arg2 & 0xff)) { + if ((arg1 & 0xff00000000000000) == (arg2 & 0xff00000000000000)) { - INC_AFL_AREA(cur_loc); - if ((arg1 & 0xffff) == (arg2 & 0xffff)) { + INC_AFL_AREA(cur_loc +6); + if ((arg1 & 0xff000000000000) == (arg2 & 0xff000000000000)) { - INC_AFL_AREA(cur_loc + 1); - if ((arg1 & 0xffffff) == (arg2 & 0xffffff)) { + INC_AFL_AREA(cur_loc + 5); + if ((arg1 & 0xff0000000000) == (arg2 & 0xff0000000000)) { - INC_AFL_AREA(cur_loc + 2); - if ((arg1 & 0xffffffff) == (arg2 & 0xffffffff)) { + INC_AFL_AREA(cur_loc + 4); + if ((arg1 & 0xff00000000) == (arg2 & 0xff00000000)) { INC_AFL_AREA(cur_loc + 3); - if ((arg1 & 0xffffffffff) == (arg2 & 0xffffffffff)) { + if ((arg1 & 0xff000000) == (arg2 & 0xff000000)) { - INC_AFL_AREA(cur_loc + 4); - if ((arg1 & 0xffffffffffff) == (arg2 & 0xffffffffffff)) { + INC_AFL_AREA(cur_loc + 2); + if ((arg1 & 0xff0000) == (arg2 & 0xff0000)) { - INC_AFL_AREA(cur_loc + 5); - if ((arg1 & 0xffffffffffffff) == (arg2 & 0xffffffffffffff)) { + INC_AFL_AREA(cur_loc + 1); + if ((arg1 & 0xff00) == (arg2 & 0xff00)) { - INC_AFL_AREA(cur_loc + 6); + INC_AFL_AREA(cur_loc); } |