From bfd306437f34ebc4d4170c5fb8170261585f6038 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Fri, 17 Apr 2026 12:10:07 -0400 Subject: 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. --- python/function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/function.py') 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) -- cgit v1.3.1