Skip to content

Document the difference between the AST and non AST versions of HLIL  #7413

Description

@v-p-b

Version and Platform (required):

  • Binary Ninja Version: 5.2.8286-dev
  • Edition: Non-Commercial
  • OS: Ubuntu Linux (running with this Dockerfile)
  • OS Version: 24.04 LTS
  • CPU Architecture: x64

Bug Description:

Disassembly settings are ignored when using the HighLevelILInstruction.get_lines() function:

settings = function.DisassemblySettings.default_linear_settings()
settings.set_option(DisassemblyOption.ShowAddress)
settings.set_option(DisassemblyOption.IndentHLILBody)

for func in bv.functions:
    hlil = func.high_level_il
    for hli in hlil.instructions:
        for hl_line in hli.get_lines(settings):
            print("".join([t.text for t in hl_line.tokens]))

The resulting output doesn't show indents or addresses. The same settings object works with LinearViewObject.hlil(...)

Steps To Reproduce:
Please provide all steps required to reproduce the behavior:

  1. Run the previous script (you can use the container linked above, but I don't think it matters)
  2. Observe that the requested data (addresses, indentation) is not present in the output

Expected Behavior:
I expect DisassemblySettings being applied on the output token list.

Screenshots/Video Recording:
N/A

Binary:
N/A

Additional Information:

N/A

Metadata

Metadata

Assignees

Labels

Component: CoreIssue needs changes to the coreEffort: LowIssues require < 1 week of workImpact: MediumIssue is impactful with a bad, or no, workaroundState: IntendedIssue is actually intended behavior

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions