diff options
author | vanhauser-thc <vh@thc.org> | 2021-07-19 10:48:41 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2021-07-19 10:48:41 +0200 |
commit | cc57cc5f463e9b79980c2087d19b4a1e1360ec52 (patch) | |
tree | 69a89651deefc660b481e9c964f4cb97ab9073b6 /frida_mode/test/js/patch.js | |
parent | 3d1cc8ec57f0bf07d7834b652ec2db24e7914624 (diff) | |
parent | c55f7af65700e3d11c368072d39ba6670efa477b (diff) | |
download | afl++-cc57cc5f463e9b79980c2087d19b4a1e1360ec52.tar.gz |
fix merge conflicts
Diffstat (limited to 'frida_mode/test/js/patch.js')
-rw-r--r-- | frida_mode/test/js/patch.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/frida_mode/test/js/patch.js b/frida_mode/test/js/patch.js new file mode 100644 index 00000000..485a434f --- /dev/null +++ b/frida_mode/test/js/patch.js @@ -0,0 +1,34 @@ +Afl.print('******************'); +Afl.print('* AFL FRIDA MODE *'); +Afl.print('******************'); +Afl.print(''); + +const main = DebugSymbol.fromName('main').address; +Afl.print(`main: ${main}`); +Afl.setEntryPoint(main); +Afl.setPersistentAddress(main); +Afl.setPersistentCount(10000000); + +const crc32_check = DebugSymbol.fromName('crc32_check').address; +const crc32_replacement = new NativeCallback( + (buf, len) => { + Afl.print(`len: ${len}`); + if (len < 4) { + return 0; + } + + return 1; + }, + 'int', + ['pointer', 'int']); +Interceptor.replace(crc32_check, crc32_replacement); + +const some_boring_bug = DebugSymbol.fromName('some_boring_bug').address +const boring_replacement = new NativeCallback( + (c) => { }, + 'void', + ['char']); +Interceptor.replace(some_boring_bug, boring_replacement); + +Afl.done(); +Afl.print("done"); |