Solved

Memory Address of Value Changes

Posted on 2012-04-03
4
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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