Created
March 24, 2024 19:39
-
-
Save kambala-decapitator/1ed83495afdf2350dcac7836f3340d4c to your computer and use it in GitHub Desktop.
reading from I/O port using Chipsec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from chipsec.chipset import cs | |
from chipsec.exceptions import UnknownChipsetError | |
from chipsec.hal.io import PortIO | |
from chipsec.logger import level, logger | |
# creates empty file in CWD/logs | |
log = logger() | |
log.chipsecLogger.setLevel(level.CRITICAL.value) | |
# start | |
chipset = cs() | |
try: | |
chipset.init(None, None, True, True) | |
except UnknownChipsetError: | |
pass | |
# actual program | |
portIo = PortIO(chipset) | |
print(portIo.read_port_dword(0x774)) | |
# cleanup | |
chipset.destroy(True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment