diff --git a/chipsec/helper/win/win32helper.py b/chipsec/helper/win/win32helper.py index 2ee51b37..983576bb 100644 --- a/chipsec/helper/win/win32helper.py +++ b/chipsec/helper/win/win32helper.py @@ -518,13 +518,13 @@ class Win32Helper(Helper): try: out_buf = win32file.DeviceIoControl( self.driver_handle, ioctl_code, in_buf, out_length, None ) except pywintypes.error as _err: - err_status = _err[0] + 0x100000000 + err_status = _err.args[0] + 0x100000000 if STATUS_PRIVILEGED_INSTRUCTION == err_status: err_msg = "HW Access Violation: DeviceIoControl returned STATUS_PRIVILEGED_INSTRUCTION (0x{:X})".format(err_status) if logger().DEBUG: logger().error( err_msg ) raise HWAccessViolationError( err_msg, err_status ) else: - _handle_error( "HW Access Error: DeviceIoControl returned status 0x{:X} ({})".format(err_status, _err[2]), err_status ) + _handle_error( "HW Access Error: DeviceIoControl returned status 0x{:X} ({})".format(err_status, _err.args[2]), err_status ) return out_buf