Solved

Memory Address of Value Changes

Posted on 2012-04-03
4
179 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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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