question

YumMitchell-2537 avatar image
0 Votes"
YumMitchell-2537 asked YumMitchell-2537 commented

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

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://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/symbols-and-symbol-tags?view=vs-2015

c++vs-generalvs-debugging
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RLWA32-6355 avatar image
1 Vote"
RLWA32-6355 answered YumMitchell-2537 commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.