mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[+] 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:
parent
597af76fd6
commit
639b5df6b3
34
snippets/cr4.py
Normal file
34
snippets/cr4.py
Normal 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()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user