Re: [DynInst_API:] Problem in pointer alias analysis by using Dyninst


Date: Tue, 13 Dec 2022 11:50:13 -0600
From: Barton Miller <bart@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] Problem in pointer alias analysis by using Dyninst

Hi Wen,


As Tim points out, statically, determining that these two instructions point to the location is a challenge in general. As Tim said, you might be able to use the DataflowAPI to slice backwards on each register to see if you can determine its value. However, that can't work in the most general case.


Dynamically, you can insert instrumentation into these instructions to calculate the effective address. Dyninst makes this easy with the BPatch_effectiveAddressExpr method (Section 3.3 in the Dyninst Programmer's Guide). That would allow you to gather the information at runtime and compare them.


--bart


On 12/13/2022 11:43 AM, Tim Haines wrote:
The general problem with pointer aliasing is that there are many different sources of memory and each presents its own challenge- particularly heap memory. This isn't my area of expertise, but I believe using dataflow analysis would be a place to start. DataflowAPI won't have a single method to solve pointer aliasing because it's too complex of a problem, but the information it provides should get you started. Feel free to ask more questions here or open a question issue on our Github.

Thanks.
- Tim


On 12/12/22 3:37 PM, Wen Zhang wrote:
Dear developers,

I am using Dyninst to do the static binary analysis on x86/64. And I meet one problem with how to use Dyninst to identify two memory locations represented by different registers that may point to the same memory location. For example, there are two assembly codes: 

mov %rax, 0x8(%rbp)
mov %rcx, 0x4(%rcx)

Even though these two memory writings look totally different, 0x8(%rbp) and 0x4(%rcx) may point to the same memory location. 

I have looked at all manuals in Dyininst, but it seems nothing related to this problem. Is there any API or method given by Dyninst that can solve this problem?
I appreciate your feedback. 

Sincerely,
Wen Zhang

_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api


_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
[← Prev in Thread] Current Thread [Next in Thread→]