[+] added: windbg snippet displaying CR4 register

git-svn-id: https://pykd.svn.codeplex.com/svn@56566 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2010-10-28 08:04:01 +00:00
parent 597af76fd6
commit 639b5df6b3

34
snippets/cr4.py Normal file
View File

@ -0,0 +1,34 @@
#
#
#
from pykd import *
def cr4( value = 0 ):
if value == 0:
value = reg( "cr4" )
dprintln( "CR4: %x (" % value + "".join( [ ( value & ( 1 << ( 31 - i ) ) ) and "1" or "0" for i in range(0,31) ] ) + ")" )
for i in range (0, 31):
bits = { 0 : "VME", 1 : "PVI", 2 : "TSD", 3 : "DE", 4 : "PSE", 5 : "PAE", 6 : "MCE", 7 : "PGE", 8 : "PCE", 9 : "OSFXSR", 10 : "OSXMMEXCPT", 13 : "VMXE", 14 : "SMXE", 17 : "PCIDE", 18 : "OSXSAVE" }
if ( ( 1 << ( 31 -i ) ) & value ) and 31-i in bits:
dprint( " " + bits[31-i] )
dprintln("")
if __name__ == "__main__":
if not isSessionStart():
print "script is launch out of windbg"
quit( 0 )
if (sys.argv[0] != "" ):
cr4( int( sys.argv[0], 16 ) )
else:
cr4()