From b62c0bbd33ec2a275750d02f73a50a1881138fbd Mon Sep 17 00:00:00 2001 From: blacktop Date: Fri, 19 Apr 2024 19:41:17 -0600 Subject: [PATCH] fix: swift bind lookups --- swift.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/swift.go b/swift.go index bdee332..2d8f4dc 100644 --- a/swift.go +++ b/swift.go @@ -1224,6 +1224,13 @@ func (f *File) readProtocolConformance(r io.ReadSeeker, addr uint64) (pcd *swift paddr = f.vma.Convert(paddr) if paddr == 0 { pcd.Protocol = "" + paddr = pcd.ProtocolOffsest.GetRelPtrAddress() + if (paddr & 1) == 1 { + paddr = paddr &^ 1 + } + if bind, err := f.GetBindName(paddr); err == nil { + pcd.Protocol = bind + } } else if bind, err := f.GetBindName(paddr); err == nil { pcd.Protocol = bind } else { @@ -1382,6 +1389,13 @@ func (f *File) readProtocolConformance(r io.ReadSeeker, addr uint64) (pcd *swift } if addr == 0 { pcd.ResilientWitnesses[idx].Symbol = "" + addr = wit.RequirementOff.GetRelPtrAddress() + if (addr & 1) == 1 { + addr = addr &^ 1 + } + if bind, err := f.GetBindName(addr); err == nil { + pcd.ResilientWitnesses[idx].Symbol = bind + } } else { if bind, err := f.GetBindName(addr); err == nil { pcd.ResilientWitnesses[idx].Symbol = bind