Solved

Reading a Memory Location?

Posted on 1999-01-09
10
208 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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 40 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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