Shofel2_T124_python/venv/lib/python3.10/site-packages/qiling/arch/msr.py

27 lines
537 B
Python
Raw Normal View History

2024-05-25 16:45:07 +00:00
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
from unicorn import Uc
class QlMsrManager:
"""Enables access to Intel MSR.
"""
def __init__(self, uc: Uc) -> None:
self.uc = uc
def read(self, msr: int) -> int:
"""Read a model-specific register value.
"""
return self.uc.msr_read(msr)
def write(self, msr: int, value: int):
"""Write a model-specific register value.
"""
self.uc.msr_write(msr, value)