Skip to content

Instantly share code, notes, and snippets.

@kambala-decapitator
Created March 24, 2024 19:39
Show Gist options
  • Save kambala-decapitator/1ed83495afdf2350dcac7836f3340d4c to your computer and use it in GitHub Desktop.
Save kambala-decapitator/1ed83495afdf2350dcac7836f3340d4c to your computer and use it in GitHub Desktop.
reading from I/O port using Chipsec
#!/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