MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / read_msr

Method read_msr

pydevd_attach_to_process/winappdbg/system.py:738–764  ·  view source on GitHub ↗

Read the contents of the specified MSR (Machine Specific Register). @type address: int @param address: MSR to read. @rtype: int @return: Value of the specified MSR. @raise WindowsError: Raises an exception on error. @raise No

(address)

Source from the content-addressed store, hash-verified

736
737 @staticmethod
738 def read_msr(address):
739 """
740 Read the contents of the specified MSR (Machine Specific Register).
741
742 @type address: int
743 @param address: MSR to read.
744
745 @rtype: int
746 @return: Value of the specified MSR.
747
748 @raise WindowsError:
749 Raises an exception on error.
750
751 @raise NotImplementedError:
752 Current architecture is not C{i386} or C{amd64}.
753
754 @warning:
755 It could potentially brick your machine.
756 It works on my machine, but your mileage may vary.
757 """
758 if win32.arch not in (win32.ARCH_I386, win32.ARCH_AMD64):
759 raise NotImplementedError("MSR reading is only supported on i386 or amd64 processors.")
760 msr = win32.SYSDBG_MSR()
761 msr.Address = address
762 msr.Data = 0
763 win32.NtSystemDebugControl(win32.SysDbgReadMsr, InputBuffer=msr, OutputBuffer=msr)
764 return msr.Data
765
766 @staticmethod
767 def write_msr(address, value):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected