Solved

Memory Address of Value Changes

Posted on 2012-04-03
4
177 Views
Last Modified: 2012-06-27
Experts,

I have a C#  program (program “A”) that monitors a value generated by a third-party program (program “B”). I do this through reading B’s memory address where the value is located.

Everything works great until I close and reopen B – the value I need is now located elsewhere. From my searching online, I assume this can be solved through the use of offsets, but am unsure. If it’s an offset I need, any advice on finding said offset?

Basically, I’d like my program to always have access to B’s value no matter where in B’s memory it’s stored. Is this Possible?

Thanks.
0
Comment
Question by:ak5745
  • 2
4 Comments
 
LVL 23

Expert Comment

by:wdosanjos
ID: 37802569
How are you able to find the memory address of the value in the first place?  Would not be a matter of identifying that Program "B" restarted and rerun Program "A" initialization code?
0
 

Author Comment

by:ak5745
ID: 37802851
I use either TSearch or Cheat Engine (both Memory Scanners) to find the value I'm looking for. For example, if B is displaying a value of, say, 10.5 (always a double), I'll search B's memory for 10.5. Then when I close and reopen B, 10.5 is located elsewhere in memory. I could just search again, but that gets old. That answer your question?

Know of any way to always be able to find that dynamic address?
0
 
LVL 23

Accepted Solution

by:
wdosanjos earned 250 total points
ID: 37803157
If Program B is a .NET application due to the dynamic memory architecture, it's unlikely that the value would be on the same place every time.  That would be true for any program/framework that relies on dynamic memory allocation.  Perhaps that's what you are experiencing.
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 250 total points
ID: 37804648
>>Everything works great until I close and reopen B

You MUST obtain the new location when that happens.  Also, as wdosanjos, says: if it is a .net program then you can never be certain even during the lifetime of the program if that will remain the same location - .net uses dynamic memory relocation as the program executes.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question