Solved

Reading a Memory Location?

Posted on 1999-01-09
10
205 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Raymond,

  Do you have any code examples to implement this API from Delphi (4.0)?  
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
Sorry, no.
0
 
LVL 2

Accepted Solution

by:
ivi earned 40 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Adjusted points to 40
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

18 Experts available now in Live!

Get 1:1 Help Now