Solved

Memory Address of Value Changes

Posted on 2012-04-03
4
173 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
c# code 19 59
Image(7) 1 37
Create a form which is copy of a form in vb.net 2 17
Trouble connecting to SqlServer database 4 32
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now