binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

"Display As->Pointer" on a DataVariable should modify the type of the DataVariable

Open yrp604 opened this issue 2 years ago • 5 comments

Version and Platform (required):

  • Binary Ninja Version: 4272-dev
  • OS: Windows
  • OS Version:: 22h2
  • CPU Architecture: x64

Bug Description: Function pointer xrefs disappear at times. For example, I have a global containing a function pointer

0090d870  int64_t data_90d870 = clock_gettime_and_convert

However, when I go to that function pointer and look at the xrefs: image

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

  1. RE for a while
  2. Notice this

Expected Behavior: I expect xrefs to show up for functions. Feel free to contact me for a bndb.

yrp604 avatar May 07 '23 21:05 yrp604

I ran into this once, while reversing and was unable to reproduce it. I have a small suspicion that its due to an uninitialized variable. I had a binary open once that would reproduce the issue but then after closing it and reopening the issue disappeared.

plafosse avatar May 08 '23 14:05 plafosse

I'm pretty sure I had reliable repro steps for this at one point and sent them to @fuzyll?

yrp604 avatar May 08 '23 19:05 yrp604

~~I went back through all of my DMs and a bunch of notes trying to find it and, if you did, I apologize...I've definitely lost them.~~

EDIT: I found it, I filed it as a private issue because there was an executable provided. I don't think it's relevant because we fixed that one, but I've linked it in privately for extra context.

fuzyll avatar May 09 '23 15:05 fuzyll

BNDB shared privately under label "Sad Horse Eats Ramen"

plafosse avatar Jun 09 '23 20:06 plafosse

Ok it looks like you right clicked and did "Display As->Pointer" which in the case of DataVariables really should modify the underlying type to be a void* (like we do in the IL) or better yet a function pointer. If however you hit 'o' it would have created a function pointer at that location instead. Once it is a function pointer you then get xrefs. Ultimately this wouldn't have been an issue at all if we had done #1189 first. Which is slated for the current release and to be done by @D0ntPanic. I'm going to change the title to reflect the change needed.

plafosse avatar Jun 09 '23 20:06 plafosse