GaloisInc / macaw

Open source binary analysis tools.
BSD 3-Clause "New" or "Revised" License
190 stars 19 forks source link

`macaw-ppc`: Don't assume absolute IP addresses when decoding #350

Closed RyanGlScott closed 8 months ago

RyanGlScott commented 8 months ago

macaw-ppc was previously assuming that addresses are absolute, which is not true for position independent executables. Extracting the offset from the address is sufficient for our purposes here (note that taking the offset from the MemSegmentOffset would not be right, as that offset is relative to the segment start).

This is the exact same issue that was noticed in https://github.com/GaloisInc/macaw/commit/37d8029c00d99335625ab615c7ae94fba18f9574 (in macaw-aarch32), but that commit forgot to fix things on the macaw-ppc end.