Solved

Memory Address of Value Changes

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

23 Experts available now in Live!

Get 1:1 Help Now