Solved

Reading a Memory Location?

Posted on 1999-01-09
10
206 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 107
Working this component WebCopy with proxy, help 3 76
Can Viruses spread while transferring Binary data with Winsock 2 66
CheckListBox usage 3 51
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now