/*++ Copyright (c) 1992 Microsoft Corporation Module Name: physical.c Abstract: WinDbg Extension Api Author: Wesley Witt (wesw) 15-Aug-1993 Environment: User Mode. Revision History: --*/ #include "precomp.h" #pragma hdrstop DECLARE_API( db ) /*++ Routine Description: Does a read of 16 ULONGS from the physical memory of the target maching Arguments: args - Supplies physical address Return Value: None. --*/ { #define NumberBytesToRead 32*4 static PHYSICAL_ADDRESS LastAddress = {0L, 0L}; PHYSICAL_ADDRESS Address = {0L, 0L}; UCHAR Buffer[NumberBytesToRead]; ULONG ActualRead; UCHAR hexstring[80]; UCHAR bytestring[40]; UCHAR ch, *p; int cnt, d; if(*args == '\0') { Address=LastAddress; } else { sscanf(args,"%lx",&Address.LowPart); Address.LowPart &= (~0x3); // Truncate to dword boundary LastAddress=Address; } ReadPhysical(Address,Buffer,sizeof(Buffer),&ActualRead); if (ActualRead != sizeof(Buffer)) { dprintf("Physical memory read failed\n"); } else { for(cnt=0;cnt 0x7e) { ch = '.'; } bytestring[d] = ch; } bytestring[d] = '\0'; dprintf("%s %s\n", hexstring, bytestring); } LastAddress.LowPart += sizeof(Buffer); } } DECLARE_API( dd ) /*++ Routine Description: Does a read of 16 ULONGS from the physical memory of the target maching Arguments: args - Supplies physical address Return Value: None. --*/ { #define NumberToRead 32 static PHYSICAL_ADDRESS LastAddress = {0L, 0L}; PHYSICAL_ADDRESS Address; ULONG Buffer[NumberToRead]; ULONG ActualRead; int cnt; if(*args == '\0') { Address=LastAddress; } else { sscanf(args,"%lx",&Address.LowPart); Address.LowPart &= (~0x3); // Truncate to dword boundary LastAddress=Address; } ReadPhysical(Address,Buffer,sizeof(Buffer),&ActualRead); if (ActualRead != sizeof(Buffer)) { dprintf("Physical memory read failed\n"); } else { for(cnt=0;cnt