diff options
Diffstat (limited to 'plugins/warp/api/python')
| -rw-r--r-- | plugins/warp/api/python/_warpcore.py | 19 | ||||
| -rw-r--r-- | plugins/warp/api/python/warp.py | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/plugins/warp/api/python/_warpcore.py b/plugins/warp/api/python/_warpcore.py index c53feefa..740072ab 100644 --- a/plugins/warp/api/python/_warpcore.py +++ b/plugins/warp/api/python/_warpcore.py @@ -956,6 +956,25 @@ def BNWARPIsLiftedInstructionVariant( # ------------------------------------------------------- +# _BNWARPIsLowLevelInstructionComputedVariant + +_BNWARPIsLowLevelInstructionComputedVariant = core.BNWARPIsLowLevelInstructionComputedVariant +_BNWARPIsLowLevelInstructionComputedVariant.restype = ctypes.c_bool +_BNWARPIsLowLevelInstructionComputedVariant.argtypes = [ + ctypes.POINTER(BNLowLevelILFunction), + ctypes.c_ulonglong, + ] + + +# noinspection PyPep8Naming +def BNWARPIsLowLevelInstructionComputedVariant( + llilFunction: ctypes.POINTER(BNLowLevelILFunction), + idx: int + ) -> bool: + return _BNWARPIsLowLevelInstructionComputedVariant(llilFunction, idx) + + +# ------------------------------------------------------- # _BNWARPNewContainerReference _BNWARPNewContainerReference = core.BNWARPNewContainerReference diff --git a/plugins/warp/api/python/warp.py b/plugins/warp/api/python/warp.py index e0500215..c761c323 100644 --- a/plugins/warp/api/python/warp.py +++ b/plugins/warp/api/python/warp.py @@ -365,6 +365,12 @@ def is_instruction_variant(function: LowLevelILFunction, variant: LowLevelILInst def is_instruction_blacklisted(function: LowLevelILFunction, variant: LowLevelILInstruction) -> bool: return warpcore.BNWARPIsLiftedInstructionBlacklisted(function.handle, variant.instr_index) +def is_instruction_computed_variant(function: LowLevelILFunction, variant: LowLevelILInstruction) -> bool: + """ + Checks to see if the instruction is variant due to some computed value. **Must use LLIL.** + """ + return warpcore.BNWARPIsLowLevelInstructionComputedVariant(function.handle, variant.instr_index) + def get_function_guid(function: Function) -> Optional[FunctionGUID]: guid = warpcore.BNWARPUUID() if not warpcore.BNWARPGetAnalysisFunctionGUID(function.handle, guid): |
