在DOS实模式下直接存取4GB内存(5)
2015-06-24 01:06
导读:asmdb0x67//32bitAddressPrefix asmdb0x64//FS: asmmovbyteptr[BX],al//=MOVFS:[EDI],AL return-AL; } ////////DontTouchAboveCode/// #includestdio,h voidDump4G(unsignedlongAddress) { inti; intj; for(i=0;i20;
asm db 0x67 //32 bit Address Prefix
asm db 0x64 //FS:
asm mov byte ptr [BX],al //=MOV FS: [EDI],AL
return -AL;
}
//////// Don t Touch Above Code ///
# include <stdio, h>
void Dump4G (unsigned long Address)
{
int i;
int j;
for (i=0; i<20; i++)
{
printf (“%081X: ”, (Address+i*16));
for (j=0; j<16;j++)
printf ("% 02X" ,ReadByte (Address+i*16+j));
printf (" ");
for (j=0;j<16;j++)
{
if (ReadByte (Address+i*16+j) <0x20) printf (" . ");
else printf (" %C ", ReadByte (Address+i*16+j));
}
printf ("\n");
}
}
main ()
{
unsigned long Address=0;
unsigned long tmp;
LoadFSLimit4G ();
printf ("====Designed By Southern. 1995.7.17====\n");
printf (" Now you can Access The Machine All 4G Memory.\n");
printf (" Input the Start Memory Physical to DUMP. \n");
printf (" Press D to Cuntinue DUMP, 0 to End & Quit, \n");
do {
printf ("-");
scanf ("%IX", &tmp);
if (tmp==0x0d) Address+=(20*16);
else Address=tmp;