summaryrefslogtreecommitdiff
path: root/python/languagerepresentation.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2024-10-28 21:00:07 -0400
committerRusty Wagner <rusty.wagner@gmail.com>2024-10-28 21:04:03 -0400
commit8dabdd428acd30aac4ebb7e17270505fc3ba4a59 (patch)
treea4d8ab90d164458a6138c96e7aa856c81e174bd0 /python/languagerepresentation.py
parent717a2ea5c79a95dd3178447e27be979895f55892 (diff)
Eliminate AST parameter in high level rendering APIs, as it is already part of the HLIL instruction
Diffstat (limited to 'python/languagerepresentation.py')
-rw-r--r--python/languagerepresentation.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/python/languagerepresentation.py b/python/languagerepresentation.py
index 49a300c1..ac34c860 100644
--- a/python/languagerepresentation.py
+++ b/python/languagerepresentation.py
@@ -395,11 +395,11 @@ class LanguageRepresentationFunction:
):
try:
hlil = highlevelil.HighLevelILFunction(handle=core.BNNewHighLevelILFunctionReference(hlil))
- instr = hlil.get_expr(highlevelil.ExpressionIndex(expr_index))
+ instr = hlil.get_expr(highlevelil.ExpressionIndex(expr_index), as_full_ast)
tokens = HighLevelILTokenEmitter(core.BNNewHighLevelILTokenEmitterReference(tokens))
if settings is not None:
settings = function.DisassemblySettings(core.BNNewDisassemblySettingsReference(settings))
- self.perform_get_expr_text(instr, tokens, settings, as_full_ast, precedence, statement)
+ self.perform_get_expr_text(instr, tokens, settings, precedence, statement)
except:
log_error(traceback.format_exc())
@@ -461,7 +461,7 @@ class LanguageRepresentationFunction:
def perform_get_expr_text(
self, instr: 'highlevelil.HighLevelILInstruction', tokens: HighLevelILTokenEmitter,
- settings: Optional['function.DisassemblySettings'], as_full_ast: bool = True,
+ settings: Optional['function.DisassemblySettings'],
precedence: OperatorPrecedence = OperatorPrecedence.TopLevelOperatorPrecedence, statement: bool = False
):
"""
@@ -481,15 +481,17 @@ class LanguageRepresentationFunction:
def get_expr_text(
self, instr: 'highlevelil.HighLevelILInstruction', settings: Optional['function.DisassemblySettings'],
- as_full_ast: bool = True, precedence: OperatorPrecedence = OperatorPrecedence.TopLevelOperatorPrecedence,
+ precedence: OperatorPrecedence = OperatorPrecedence.TopLevelOperatorPrecedence,
statement: bool = False
) -> List['function.DisassemblyTextLine']:
"""Gets the lines of tokens for a given High Level IL instruction."""
count = ctypes.c_ulonglong()
if settings is not None:
settings = settings.handle
- lines = core.BNGetLanguageRepresentationFunctionExprText(self.handle, instr.function.handle, instr.expr_index,
- settings, as_full_ast, precedence, statement, count)
+ lines = core.BNGetLanguageRepresentationFunctionExprText(
+ self.handle, instr.function.handle, instr.expr_index,
+ settings, instr.as_ast, precedence, statement, count
+ )
result = []
if lines is not None:
result = []
@@ -507,8 +509,7 @@ class LanguageRepresentationFunction:
def get_linear_lines(
self, instr: 'highlevelil.HighLevelILInstruction',
- settings: Optional['function.DisassemblySettings'] = None,
- as_full_ast: bool = True
+ settings: Optional['function.DisassemblySettings'] = None
) -> List['function.DisassemblyTextLine']:
"""
Generates lines for the given High Level IL instruction in the style of the linear view. To get the lines
@@ -517,8 +518,10 @@ class LanguageRepresentationFunction:
count = ctypes.c_ulonglong()
if settings is not None:
settings = settings.handle
- lines = core.BNGetLanguageRepresentationFunctionLinearLines(self.handle, instr.function.handle, instr.expr_index,
- settings, as_full_ast, count)
+ lines = core.BNGetLanguageRepresentationFunctionLinearLines(
+ self.handle, instr.function.handle, instr.expr_index,
+ settings, instr.as_ast, count
+ )
result = []
if lines is not None:
result = []