Skip to content

mips disasm losing xrefs to offsets from $gp #4839

@bowserjklol

Description

@bowserjklol

Version and Platform (required):

  • Binary Ninja Version: 3.5.4526
  • OS: MacOS
  • OS Version: 14.2.1
  • CPU Architecture: x64

Bug Description:
It appears that the disassembler is losing track of xrefs based on offsets from $gp when the value in $gp is saved to the stack and later loaded back from the stack. This worked correctly in 3.4.4271 but no longer functions as expected in both 3.5.4526 (latest stable) and 3.6.4728 (latest dev).

It's of note that In opening other mips binaries in 3.5/3.6, when $gp is not manipulated in the function prologue (like it is here in the example program), binja continues to find and label xrefs as I've come to expect. It seems like this condition only appears when $gp gets a new value loaded from the stack (even if that value is the canonical $gp addr).

Steps To Reproduce:

  1. Open the provided binary and navigate to http_parser_main.
  2. Observe in 3.4.x, xrefs to fputs, fflush and others are identified correctly.
  3. Observe in 3.5.x and 3.6.x, binja loses the xrefs.

httpd.zip

Expected Behavior:
When the analysis is complete, we should see xrefs to the referenced libc functions.

Screenshots:

Example of binja mapping the calls to fflush and fputs from http_parser_main in 3.4.

httpd_3 4 4271

Example of binja failing to find and label these cross references in 3.5 and 3.6. Note how it's happy to label the xref for memset but then loses track after $gp gets a value from the stack.

3.5

httpd_3 5 4526

3.6

httpd_3 6 4728

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: MIPSIssues with the MIPS architecture pluginComponent: ArchitectureIssue needs changes to an architecture pluginEffort: MediumIssues require < 1 month of workImpact: MediumIssue is impactful with a bad, or no, workaround

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions