From 98a5094bea61e02fb9184707b8bad6e09b9f5574 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Tue, 23 Apr 2024 14:21:30 -0400 Subject: initial advanced binary search documentation --- docs/guide/index.md | 1 + docs/img/find.png | Bin 124058 -> 149526 bytes python/binaryview.py | 9 +++++++++ 3 files changed, 10 insertions(+) diff --git a/docs/guide/index.md b/docs/guide/index.md index db20be62..1af0012c 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -410,6 +410,7 @@ The normal find dialog also exists as a sidebar panel that allows persistent, ta The search types are available from a drop-down next to the text input field and include: + - Advanced Binary Search: A new search type using the [bv.search](https://dev-api.binary.ninja/binaryninja.binaryview-module.html#binaryninja.binaryview.BinaryView.search) syntax (supporting regular expressions and wildcard hex strings) - Escaped: Escaped strings such as `OneString\x09\Tabsx09Another` - Hex: All values much be valid hex characters such as `ebfffc390` and the bytes will only be searched for in this particular order - Raw: A simple string search that matches the exact string as specified diff --git a/docs/img/find.png b/docs/img/find.png index 1c790edb..6a10a014 100644 Binary files a/docs/img/find.png and b/docs/img/find.png differ diff --git a/python/binaryview.py b/python/binaryview.py index d740ce92..9ef7a913 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -8700,6 +8700,15 @@ class BinaryView: :return: A generator object that yields the offset and matched DataBuffer for each match found. :rtype: QueueGenerator + :Example: + >>> from binaryninja import load + >>> bv = load('/bin/ls') + >>> print(bv) + + >>> bytes(list(bv.search("50 ?4"))[0][1]).hex() + '5004' + >>> bytes(list(bv.search("[\\x20-\\x25][\\x60-\\x67]"))[0][1]).hex() + '2062' """ if start is None: start = self.start -- cgit v1.3.1