Is getting the address from a Symbol the same as getting the address for the variable?

Yum, Mitchell 21 Reputation points
2020-10-20T18:49:36.02+00:00

Hello,

I was wondering if IDiaSymbol::get_virtualAddress() returns the virtual address of the symbol or the variable (or is it the same)?

The end goal is to get the address of a static variable, so that when I cast it to a void pointer, I can memcpy a new value into it.
I have been running into issues with "access violation reading location" when trying to memcpy using the address obtained from get_virtualAddress().
Am I approaching this incorrectly?

Thank you,
Mitchell

https://learn.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/symbols-and-symbol-tags?view=vs-2015

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,641 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,543 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
947 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 40,771 Reputation points
    2020-10-20T21:01:03.653+00:00

    If I read the documentation correctly you need to call IDiaSession::put_loadAddress in order to obtain meaningful information from IDiaSymbol::get_virtualAddress. Did you do this?

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful