473,394 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Access to process memory from external programm

TIM
for example i have one simple programm

int main()
{
int test = NULL;
while(1){
printf("%d\n",test);
getch();
test++;
}
return 0;
}

After compiling and running it, i want to access to its memory adress
location(under windows) from other programm(which i want to write, but
dont know how or better say, from to start :-)) and find this "test"
variable and change its value during programm run-time. How i can do it
from external programm written in C++? Any help would be appreciated. THX.
Nov 14 '05 #1
6 1527
TIM <ds****@hot.ee> scribbled the following:
for example i have one simple programm int main()
{
int test = NULL;
while(1){
printf("%d\n",test);
getch();
test++;
}
return 0;
} After compiling and running it, i want to access to its memory adress
location(under windows) from other programm(which i want to write, but
dont know how or better say, from to start :-)) and find this "test"
variable and change its value during programm run-time. How i can do it
from external programm written in C++? Any help would be appreciated. THX.


From the viewpoint of the C standard: You can't. C has no concept of
other processes in the first place.
From a looser viewpoint: Usually processes can't write to each other's
memory space, so you're still out of luck. Some OSes provide the concept
of "shared memory" which might help, but that'd be off-topic here.
YR WLCM.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"As a boy, I often dreamed of being a baseball, but now we must go forward, not
backward, upward, not forward, and always whirling, whirling towards freedom!"
- Kang
Nov 14 '05 #2
TIM
Joona I Palaste wrote:
TIM <ds****@hot.ee> scribbled the following:
for example i have one simple programm


int main()
{
int test = NULL;
while(1){
printf("%d\n",test);
getch();
test++;
}
return 0;
}


After compiling and running it, i want to access to its memory adress
location(under windows) from other programm(which i want to write, but
dont know how or better say, from to start :-)) and find this "test"
variable and change its value during programm run-time. How i can do it
from external programm written in C++? Any help would be appreciated. THX.

From the viewpoint of the C standard: You can't. C has no concept of
other processes in the first place.
From a looser viewpoint: Usually processes can't write to each other's
memory space, so you're still out of luck. Some OSes provide the concept
of "shared memory" which might help, but that'd be off-topic here.
YR WLCM.

LoL how is then written programm such as ARTMONEY? If C doesnt have
concepts of other processes, maybe C++ does? or i must better do it with
ASM?
thx.
Nov 14 '05 #3
TIM <ds****@hot.ee> scribbled the following:
Joona I Palaste wrote:
TIM <ds****@hot.ee> scribbled the following:
for example i have one simple programm

int main()
{
int test = NULL;
while(1){
printf("%d\n",test);
getch();
test++;
}
return 0;
}


After compiling and running it, i want to access to its memory adress
location(under windows) from other programm(which i want to write, but
dont know how or better say, from to start :-)) and find this "test"
variable and change its value during programm run-time. How i can do it
from external programm written in C++? Any help would be appreciated. THX.

From the viewpoint of the C standard: You can't. C has no concept of
other processes in the first place.
From a looser viewpoint: Usually processes can't write to each other's
memory space, so you're still out of luck. Some OSes provide the concept
of "shared memory" which might help, but that'd be off-topic here.
YR WLCM.

LoL how is then written programm such as ARTMONEY? If C doesnt have
concepts of other processes, maybe C++ does? or i must better do it with
ASM?
thx.


Read what I wrote. "Some OSes provide the concept of 'shared memory'
which might help, but that'd be off-topic here." C, as such, doesn't
have the concept of other processes, but OS-specific extensions to C do.
The same is true for C++: C++ doesn't have the concept of other
processes, but OS-specific extensions to C++ do.
You can either do it with ASM, or find a C- or C++- compatible library
where someone has already done it with ASM for you.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"It's time, it's time, it's time to dump the slime!"
- Dr. Dante
Nov 14 '05 #4
TIM
Joona I Palaste wrote:
TIM <ds****@hot.ee> scribbled the following:
Joona I Palaste wrote:
TIM <ds****@hot.ee> scribbled the following:

for example i have one simple programm

int main()
{
int test = NULL;
while(1){
printf("%d\n",test);
getch();
test++;
}
return 0;
}
After compiling and running it, i want to access to its memory adress
location(under windows) from other programm(which i want to write, but
dont know how or better say, from to start :-)) and find this "test"
variable and change its value during programm run-time. How i can do it

from external programm written in C++? Any help would be appreciated. THX.
From the viewpoint of the C standard: You can't. C has no concept of
other processes in the first place.
From a looser viewpoint: Usually processes can't write to each other's
memory space, so you're still out of luck. Some OSes provide the concept
of "shared memory" which might help, but that'd be off-topic here.
YR WLCM.


LoL how is then written programm such as ARTMONEY? If C doesnt have
concepts of other processes, maybe C++ does? or i must better do it with
ASM?
thx.

Read what I wrote. "Some OSes provide the concept of 'shared memory'
which might help, but that'd be off-topic here." C, as such, doesn't
have the concept of other processes, but OS-specific extensions to C do.
The same is true for C++: C++ doesn't have the concept of other
processes, but OS-specific extensions to C++ do.
You can either do it with ASM, or find a C- or C++- compatible library
where someone has already done it with ASM for you.

Thx for help, but i dont like to use someone else work, i like to make
things by myself and learn to new things, only then you get full
control...so i will make it.
Nov 14 '05 #5
TIM <ds****@hot.ee> scribbled the following:
Joona I Palaste wrote:
TIM <ds****@hot.ee> scribbled the following:
LoL how is then written programm such as ARTMONEY? If C doesnt have
concepts of other processes, maybe C++ does? or i must better do it with
ASM?
thx.


Read what I wrote. "Some OSes provide the concept of 'shared memory'
which might help, but that'd be off-topic here." C, as such, doesn't
have the concept of other processes, but OS-specific extensions to C do.
The same is true for C++: C++ doesn't have the concept of other
processes, but OS-specific extensions to C++ do.
You can either do it with ASM, or find a C- or C++- compatible library
where someone has already done it with ASM for you.

Thx for help, but i dont like to use someone else work, i like to make
things by myself and learn to new things, only then you get full
control...so i will make it.


Here, "someone else's work" includes any system core libraries your OS
might have. Depending on your OS, "making things yourself" might even
require implementing your own multi-tasking kernel. This is a very
great deal of work, and overkill just to be able to use shared memory.
Therefore I suggest you first check your own OS's core libraries,
whether they support shared memory. If they do, fine. Otherwise you can
make things yourself or try to find a third-party solution.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"I am looking for myself. Have you seen me somewhere?"
- Anon
Nov 14 '05 #6
TIM <ds****@hot.ee> spoke thus:
After compiling and running it, i want to access to its memory adress
location(under windows) from other programm(which i want to write, but
dont know how or better say, from to start :-)) and find this "test"
variable and change its value during programm run-time. How i can do it
from external programm written in C++? Any help would be appreciated. THX.


I think Joona meant to post these URL's (didn't you, Joona? ;)):

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: TIM | last post by:
for example i have one simple programm int main() { int test = NULL; while(1){ printf("%d\n",test); getch(); test++; }
11
by: X-Centric | last post by:
hi, because I always get an EAccessViolation error when i try to quit my program, I want to kill the process of it everytime it finishes its task. and then rerun it. can someone tell me how to...
6
by: TIM | last post by:
for example i have one simple programm int main() { int test = NULL; while(1){ printf("%d\n",test); getch(); test++; }
11
by: Tyron | last post by:
Is there a possibility to run an external process (exe) in on of my C# Apps Thread? I would need that because I don't want them to run anymore when my programm crashes. Also I don't want to have...
6
by: Alexander Widera | last post by:
hello, if i start a program (an exe-file) with Process.Start(...) I don't have the required permissions that the programm needs (i could start the programm but the program needs special rights)....
2
by: LordChaos | last post by:
Dear all, I am a newbie in Java, I got the following problem: I am going through a list of directories. The programm looks inside each directory for specific files and writes them in an...
2
by: bert.medley | last post by:
I have a problem that I can distill down to the following. 1/ A Visual C++ 6.0 program connects to a MS Access database using an ODBC connection and sleeps for a long time. The connection takes...
0
by: bert.medley | last post by:
I have a problem that I can distill down to the following. 1/ A Visual C++ 6.0 program connects to a MS Access database using an ODBC connection and sleeps for a long time. The connection takes...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.