diff options
Diffstat (limited to 'python/examples')
| -rw-r--r-- | python/examples/angr_plugin.py | 21 | ||||
| -rw-r--r-- | python/examples/bin_info.py | 16 | ||||
| -rw-r--r-- | python/examples/breakpoint.py | 20 |
3 files changed, 49 insertions, 8 deletions
diff --git a/python/examples/angr_plugin.py b/python/examples/angr_plugin.py index 675cc5f6..852eff65 100644 --- a/python/examples/angr_plugin.py +++ b/python/examples/angr_plugin.py @@ -1,3 +1,24 @@ +# Copyright (c) 2015-2016 Vector 35 LLC +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + # This plugin assumes angr is already installed and available on the system. See the angr documentation # for information about installing angr. It should be installed using the virtualenv method. # diff --git a/python/examples/bin_info.py b/python/examples/bin_info.py index ab963e4e..a472495a 100644 --- a/python/examples/bin_info.py +++ b/python/examples/bin_info.py @@ -37,20 +37,20 @@ else: bv = binaryninja.BinaryViewType[bintype].open(target) bv.update_analysis_and_wait() -print("-------- %s --------" % target) -print("START: 0x%x" % bv.start) -print("ENTRY: 0x%x" % bv.entry_point) -print("ARCH: %s" % bv.arch.name) -print("\n-------- Function List --------") +log.log_info("-------- %s --------" % target) +log.log_info("START: 0x%x" % bv.start) +log.log_info("ENTRY: 0x%x" % bv.entry_point) +log.log_info("ARCH: %s" % bv.arch.name) +log.log_info("\n-------- Function List --------") for func in bv.functions: - print(func.symbol.name) + log.log_info(func.symbol.name) -print("\n-------- First 10 strings --------") +log.log_info("\n-------- First 10 strings --------") for i in xrange(10): start = bv.strings[i].start length = bv.strings[i].length string = bv.read(start, length) - print("0x%x (%d):\t%s" % (start, length, string)) + log.log_info("0x%x (%d):\t%s" % (start, length, string)) diff --git a/python/examples/breakpoint.py b/python/examples/breakpoint.py index 44df19e2..2426e6a1 100644 --- a/python/examples/breakpoint.py +++ b/python/examples/breakpoint.py @@ -1,3 +1,23 @@ +# Copyright (c) 2015-2016 Vector 35 LLC +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + from binaryninja import * def write_breakpoint(view, start, length): |
