mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
ac2ca7264f
UEFI shell. 2. Decompression of images in SPI flash parsing is only supported in Windows. 3. UEFI - Support for IA32 and i586 (Quark) 4. Added capability to use modules from an arbitrary path with the -I / --import command line option 5. Module functionality encapsulated in class inheriting BaseModule 6. Fixed loading platform specific configuration 7. Fixed issue with modules which run on multiple logical CPUs hanging on Bay Trail (Windows/Linux). The issue still exist when running from UEFI shell 8. Added template for a module - module_template.py 9. Added options to flush log files 10. Added ability to define custom platforms Driver changes: 1. Windows - Added IOCTL_ALLOC_PHYSMEM to allocate physical memory buffer 2. Linux - Fix wrpci defect
91 lines
2.6 KiB
Python
91 lines
2.6 KiB
Python
#!/usr/local/bin/python
|
|
#CHIPSEC: Platform Security Assessment Framework
|
|
#Copyright (c) 2010-2014, Intel Corporation
|
|
#
|
|
#This program is free software; you can redistribute it and/or
|
|
#modify it under the terms of the GNU General Public License
|
|
#as published by the Free Software Foundation; Version 2.
|
|
#
|
|
#This program is distributed in the hope that it will be useful,
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
#GNU General Public License for more details.
|
|
#
|
|
#You should have received a copy of the GNU General Public License
|
|
#along with this program; if not, write to the Free Software
|
|
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
#
|
|
#Contact information:
|
|
#chipsec@intel.com
|
|
#
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------
|
|
#
|
|
# CHIPSEC: Platform Hardware Security Assessment Framework
|
|
# (c) 2010-2012 Intel Corporation
|
|
#
|
|
# -------------------------------------------------------------------------------
|
|
|
|
|
|
## \addtogroup core
|
|
# __chipsec/module_common.py__ -- common include file for modules
|
|
#
|
|
#
|
|
|
|
import platform
|
|
import string
|
|
import sys
|
|
import os
|
|
from time import localtime, strftime
|
|
|
|
import chipsec.logger
|
|
import chipsec.chipset
|
|
cs = chipsec.chipset.cs() #\TODO: remove
|
|
logger = chipsec.logger.logger() #\TODO: remove
|
|
from chipsec.cfg.common import * #\TODO: remove
|
|
|
|
|
|
class BaseModule( object ):
|
|
def __init__(self):
|
|
self.cs = chipsec.chipset.cs()
|
|
self.logger = chipsec.logger.logger()
|
|
|
|
# This method should be overwritten by the module returning True or False
|
|
# depending wether or not this module is supported in the currently running
|
|
# platform.
|
|
# To access the currently running platform use
|
|
# self.cs.code
|
|
def is_supported(self):
|
|
raise NotImplementedError('sub class should overwrite this method')
|
|
|
|
def run( self, module_argv ):
|
|
raise NotImplementedError('sub class should overwrite this method')
|
|
|
|
|
|
MTAG_BIOS = "BIOS"
|
|
MTAG_SMM = "SMM"
|
|
MTAG_SECUREBOOT = "SECUREBOOT"
|
|
|
|
|
|
|
|
##! [Available Tags]
|
|
MTAG_METAS = {
|
|
MTAG_BIOS: "System firmware (BIOS/UEFI) specific tests",
|
|
MTAG_SMM: "System Management Mode (SMM) specific tests",
|
|
MTAG_SECUREBOOT: "Secure Boot specific tests",
|
|
}
|
|
##! [Available Tags]
|
|
MODULE_TAGS = dict( [(_tag, []) for _tag in MTAG_METAS])
|
|
|
|
|
|
class ModuleResult:
|
|
FAILED = 0
|
|
PASSED = 1
|
|
WARNING = 2
|
|
SKIPPED = 3
|
|
DEPRECATED = 4
|
|
ERROR = -1
|
|
|