473,654 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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",t est);
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 3215
TIM <ds****@hot.e e> scribbled the following:
for example i have one simple programm int main()
{
int test = NULL;
while(1){
printf("%d\n",t est);
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.hel sinki.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.e e> scribbled the following:
for example i have one simple programm


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


After compiling and running it, i want to access to its memory adress
location(unde r 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.e e> scribbled the following:
Joona I Palaste wrote:
TIM <ds****@hot.e e> scribbled the following:
for example i have one simple programm

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


After compiling and running it, i want to access to its memory adress
location(und er 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.hel sinki.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.e e> scribbled the following:
Joona I Palaste wrote:
TIM <ds****@hot.e e> scribbled the following:

for example i have one simple programm

int main()
{
int test = NULL;
while(1){
printf("%d\n",t est);
getch();
test++;
}
return 0;
}
After compiling and running it, i want to access to its memory adress
location(un der 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.e e> scribbled the following:
Joona I Palaste wrote:
TIM <ds****@hot.e e> 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.hel sinki.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.e e> 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)cybers pace.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
1579
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
4527
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 do this ? ief
6
1537
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
10193
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 the processes visible in the task manager.
6
3367
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). So I added the StartInfo.UserName and Password to the Process. Now the program starts, but it hangs... nothing happens. In the task-manager the process is created, but it doesn't do anything - no cpu-load and no change of memory-usage. What...
2
1949
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 File-array. Then it goes through this array and executes the external programm "naccess". naccess takes a file as input and produces 4 output files. Unfortunatly the result files are not in the directory where the input file is (/home/tj/test), they are in...
2
7790
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 all defaults and uses CDatabase::useCursorLib in the OpenEx command. 2/ The database is well over 400MB large with over 200 tables and is compacted. 3/ Another process starts a winzip on that database that takes about 45
0
1097
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 all defaults and uses CDatabase::useCursorLib in the OpenEx command. 2/ The database is well over 400MB large with over 200 tables and is compacted.
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8706
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.