diff options
| author | Brian Potchik <brian@vector35.com> | 2026-04-17 12:10:07 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2026-04-17 12:10:07 -0400 |
| commit | bfd306437f34ebc4d4170c5fb8170261585f6038 (patch) | |
| tree | 36dd320d130fa23239213dd94546abb9a5ab4114 /python/function.py | |
| parent | 424dc721f5f2a3a7ffd5a6ccbcc7320b5ae7496d (diff) | |
Add RecognizeConstantData to StringRecognizer API
Adds a new recognize_constant_data method to the StringRecognizer API,
enabling plugins to decode constant data expressions (HLIL_CONST_DATA)
recovered by the outline resolver. The recognizer receives the full
instruction, giving access to the data buffer and builtin type via the
constant_data accessor.
Also fixes a pre-existing ctypes mismatch in get_constant_data_and_builtin
where BNBuiltinType (uint8_t) was incorrectly passed as c_int.
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/function.py b/python/function.py index 93eb7d15..bc8def47 100644 --- a/python/function.py +++ b/python/function.py @@ -1938,7 +1938,7 @@ class Function: def get_constant_data_and_builtin( self, state: RegisterValueType, value: int, size: int = 0 ) -> Tuple[databuffer.DataBuffer, BuiltinType]: - builtin = ctypes.c_int() + builtin = ctypes.c_ubyte() db = databuffer.DataBuffer( handle=core.BNGetConstantData(self.handle, state, value, size, ctypes.byref(builtin))) return db, BuiltinType(builtin.value) |
