?
Solved

Reading a Memory Location?

Posted on 1999-01-09
10
Medium Priority
?
213 Views
Last Modified: 2010-04-06
I want to be able to read a ROM memory address and place the information into a text string.  For example, if I wanted to read the ROM Date of a PC, I could use debug and dump location F000:FFF0 to view the date.  I would like to be able to assign this date to a string variable.  Any help is appreciated.  Thanks.
0
Comment
Question by:rickofkirkwood
[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
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1355624
Under windows you cannot use the segment:offset way of memory accessing... If you do an app for DOS then you can use it and it is very easy...

for DOS....

var data :array[0..5] of char absolute $F000:FFF0;

writeln(data);

if writeln(data); doesn;t work then you should do this...

for i := 0 to 5 do
  write(data[i]);
writeln;

but I think it would work that way also...

-Viktor
--Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1355625
oppps...

var data :array[0..5] of char absolute $F000:FFF0;

should be

var data :array[0..5] of char absolute $F000:$FFF0;
0
 

Author Comment

by:rickofkirkwood
ID: 1355626
viktornet,

  I tried using your suggestion:
   I created a console app (to run from dos) and kept getting
   "segment/offset not supported" errors.  I have small DOS application that I found in an MS-DOS tips & tricks book that does display the data, but I don't want to shell to DOS and run it.  I suspect there may a way using delphi's memory-mapping methods, but don't know yet.  Thanks for your help and if you have any other ideas, please let me know.  Rick
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355627
Look at VirtualProtectEx et al in the memory management functions API group. You should be able to do what you need to do with these functions...

Cheers,

Raymond
0
 

Author Comment

by:rickofkirkwood
ID: 1355628
Raymond,

  Do you have any code examples to implement this API from Delphi (4.0)?  
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355629
Sorry, no.
0
 
LVL 2

Accepted Solution

by:
ivi earned 160 total points
ID: 1355630
For Win95/98 only, not for NT:

var Buffer : array[0..64] of DWORD;
    nBytes : DWORD;
    Addr   : Pointer;
begin
  Addr:=Pointer($FFFF0); // 16*Segment+Offset
  FillChar(Buffer,256,0);
  if  ReadProcessMemory(
    GetCurrentProcess(),
    Addr,
    @Buffer,
    256,
    nBytes)
  then   Label1.caption:=IntToHex(Buffer[0],8);
  else Label1.Caption:='False...';

0
 

Author Comment

by:rickofkirkwood
ID: 1355631
Dear Ivi...

I tried your suggestion, but was not successful.  The actual offset is $FFF5 which represents the ROM Date.  I did get an answer from your suggestion so I think we are on the right track.  The answer was "00E05BEA".  Maybe I need to try to convert to text or increase the size of the buffer?  Any ideas?  Thanks.. Rick
0
 
LVL 2

Expert Comment

by:ivi
ID: 1355632
Just use Buffer : array[0..8] of Char;
Addr := $FFFF5;

.
after call:

 Buffer[8]:=#0;
 Label1.caption:=StrPas(Buffer);

In my opinion it works (I see data like 'xx/xx/xx');.
0
 

Author Comment

by:rickofkirkwood
ID: 1355633
Adjusted points to 40
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

771 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