473,385 Members | 1,641 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,385 software developers and data experts.

access memory

hi, this might b getting a bit too...low level but how can i check to see if
a certain memory address holds a charge?
--
-iwdu15
Mar 2 '06 #1
3 1204

"iwdu15" wrote:
hi, this might b getting a bit too...low level but how can i check to see if
a certain memory address holds a charge?
--


Are you talking about virtual address (i.e. in a process context) or
physical memory?
physical addresses can only be used in kernel space. The easiest solution is
to use a kernel debugger like WinDbg.

If you want to know the value at a virtual memory address in a process you
can also use a debugger, or do something like:

size_t the_address = 0x123456;
long * ptr = (long*) the_address;
long the_value = *ptr;

of course, since there may not be anything at that virtual address, you have
to use structured exception handling (seh) to make it safe. otherwise you can
crash your program.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 2 '06 #2
sorry for not being clear...i mean like get the value of what stored at a
certain memory address....like if i give 0x123456, then it returns whats
stored at that address
--
-iwdu15
Mar 3 '06 #3
> sorry for not being clear...i mean like get the value of what stored at a
certain memory address....like if i give 0x123456, then it returns whats
stored at that address


That is exactly what my example does:

size_t the_address = 0x123456; //specify a numerical value that
is to be used as an address
long * ptr = (long*) the_address; //declare a pointer that points
to the specified adress
long the_value = *ptr; //read the value that is
stored at that address.

or in shorthand:

long the_value = *(long *) 0x123456;

but you have to use SEH around this to catch possible access violations
because you don't know if you can access that address or not.
This also only works for virtual addresses. if you want to do this with
physical memory there is no choice but to write a kernel driver or use a
kernel debugger.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 3 '06 #4

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

Similar topics

12
by: James Brown | last post by:
Hi all, Having problems designing a template-class. I'll describe my scenario first then show what I've come up with so far: Need a class to provide pointer/array-like access to an area of...
7
by: Ariel | last post by:
I have a question that I'm hoping someone here can answer. Let's say I have two fields which have a beginning number and an ending number. What I'd like to do is have Access generate a list of...
12
by: Paul H | last post by:
Say I have a Windows 2000 server running Terminal Services with a single file Access DB (not front end/back end) on it, could multiple users access the data base simultaneously? Paul
24
by: David Mathog | last post by:
If this: int i,sum; int *array; for(sum=0, i=0; i<len; i++){ sum += array; } is converted to this (never mind why for the moment):
5
by: Benny Raymond | last post by:
I'm nearly done writing the first version of my tracking app and I'm starting to re-think the way I store my database. Currently I have my database setup as an xml dataset. Before I started the...
14
by: Greg Copeland | last post by:
I am running python on VxWorks. In the course of operation, a vxworks tasks writes to a reserved area of memory. I need access to this chunk of memory from within python. Initially I thought I...
10
by: WannaKatana | last post by:
I am just wondering why, with nothing else running and executing an update query against a very large table, does Access seem to be causing less than 10% processor usage. Then it says "There is not...
6
by: Bobby | last post by:
Hi, I'm not 100% sure that this is an Access problem. A friend of mine has an Access 2003 database. Occasionally he brings a copy to me so that I can import some of his data into my Access 2003...
6
by: nmehring | last post by:
I have an MFC app with 2000 users. I have one user that experiences a crash in our software anywhere from 1 to 5 times a week when opening a particular module. No other users have reported this...
36
by: Peter Olcott | last post by:
So far the only way that I found to do this was by making a single global instance of the container class and providing access to the contained class, through this single global instance. Are...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.