diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-10-16 19:57:03 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-10-16 19:57:03 (GMT) |
commit | a30fc1056877860593c19498738775c0ac43794d (patch) | |
tree | 3b63f6a7c99d494756b470f5b476f9b0c211fa83 /tools/ffuzzer/process.py | |
parent | 3a2dcf9f1e6718b0a45feed8eefadb71be66f4ac (diff) |
Defined a basic system based on Melkor to stress the disassembler and the Python bindings.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@598 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'tools/ffuzzer/process.py')
-rw-r--r-- | tools/ffuzzer/process.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/ffuzzer/process.py b/tools/ffuzzer/process.py new file mode 100644 index 0000000..c1bf2b7 --- /dev/null +++ b/tools/ffuzzer/process.py @@ -0,0 +1,31 @@ +#!/usr/bin/python3-dbg +# -*- coding: utf-8 -*- + +from gi.repository import Gtk +from pychrysalide.analysis import LoadedBinary +from pychrysalide.analysis.contents import FileContent + +import sys + +for arg in sys.argv[1:]: + + fc = FileContent(arg) + + print(' --> file content:', fc) + + binary = LoadedBinary(fc) + + print(' --> loaded binary:', binary) + + if binary is not None: + + def disassembly_is_done(obj, binary): + Gtk.main_quit() + + binary.connect('disassembly-done', disassembly_is_done, binary) + + binary.analyse() + + # Attente de la réception du signal + # Cf. http://stackoverflow.com/questions/28873688/python-how-to-block-in-pygtk-while-waiting-for-timeout-add-callback + Gtk.main() |