<s> import sys <EOL> from mixbox . binding_utils import * <EOL> from . import cybox_common <EOL> class SSDTEntryListType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , SSDT_Entry = None ) : <EOL> if SSDT_Entry is None : <EOL> self . SSDT_Entry = [ ] <EOL> else : <EOL> self . SSDT_Entry = SSDT_Entry <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if SSDTEntryListType . subclass : <EOL> return SSDTEntryListType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return SSDTEntryListType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_SSDT_Entry ( self ) : return self . SSDT_Entry <EOL> def set_SSDT_Entry ( self , SSDT_Entry ) : self . SSDT_Entry = SSDT_Entry <EOL> def add_SSDT_Entry ( self , value ) : self . SSDT_Entry . append ( value ) <EOL> def insert_SSDT_Entry ( self , index , value ) : self . SSDT_Entry [ index ] = value <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . SSDT_Entry <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for SSDT_Entry_ in self . SSDT_Entry : <EOL> SSDT_Entry_ . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = SSDTEntryType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . SSDT_Entry . append ( obj_ ) <EOL> class SSDTEntryType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , hooked = None , Service_Table_Base = None , Service_Counter_Table_Base = None , Number_Of_Services = None , Argument_Table_Base = None ) : <EOL> self . hooked = _cast ( bool , hooked ) <EOL> self . Service_Table_Base = Service_Table_Base <EOL> self . Service_Counter_Table_Base = Service_Counter_Table_Base <EOL> self . Number_Of_Services = Number_Of_Services <EOL> self . Argument_Table_Base = Argument_Table_Base <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if SSDTEntryType . subclass : <EOL> return SSDTEntryType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return SSDTEntryType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Service_Table_Base ( self ) : return self . Service_Table_Base <EOL> def set_Service_Table_Base ( self , Service_Table_Base ) : self . Service_Table_Base = Service_Table_Base <EOL> def validate_HexBinaryObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Service_Counter_Table_Base ( self ) : return self . Service_Counter_Table_Base <EOL> def set_Service_Counter_Table_Base ( self , Service_Counter_Table_Base ) : self . Service_Counter_Table_Base = Service_Counter_Table_Base <EOL> def get_Number_Of_Services ( self ) : return self . Number_Of_Services <EOL> def set_Number_Of_Services ( self , Number_Of_Services ) : self . Number_Of_Services = Number_Of_Services <EOL> def validate_NonNegativeIntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Argument_Table_Base ( self ) : return self . Argument_Table_Base <EOL> def set_Argument_Table_Base ( self , Argument_Table_Base ) : self . Argument_Table_Base = Argument_Table_Base <EOL> def get_hooked ( self ) : return self . hooked <EOL> def set_hooked ( self , hooked ) : self . hooked = hooked <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Service_Table_Base is not None or <EOL> self . Service_Counter_Table_Base is not None or <EOL> self . Number_Of_Services is not None or <EOL> self . Argument_Table_Base is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> if self . hooked is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_boolean ( self . hooked , input_name = '<STR_LIT>' ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Service_Table_Base is not None : <EOL> self . Service_Table_Base . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Service_Counter_Table_Base is not None : <EOL> self . Service_Counter_Table_Base . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Number_Of_Services is not None : <EOL> self . Number_Of_Services . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Argument_Table_Base is not None : <EOL> self . Argument_Table_Base . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> if value in ( '<STR_LIT:true>' , '<STR_LIT:1>' ) : <EOL> self . hooked = True <EOL> elif value in ( '<STR_LIT:false>' , '<STR_LIT:0>' ) : <EOL> self . hooked = False <EOL> else : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Service_Table_Base ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Service_Counter_Table_Base ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . NonNegativeIntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Number_Of_Services ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Argument_Table_Base ( obj_ ) <EOL> class IDTEntryListType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , IDT_Entry = None ) : <EOL> if IDT_Entry is None : <EOL> self . IDT_Entry = [ ] <EOL> else : <EOL> self . IDT_Entry = IDT_Entry <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if IDTEntryListType . subclass : <EOL> return IDTEntryListType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return IDTEntryListType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_IDT_Entry ( self ) : return self . IDT_Entry <EOL> def set_IDT_Entry ( self , IDT_Entry ) : self . IDT_Entry = IDT_Entry <EOL> def add_IDT_Entry ( self , value ) : self . IDT_Entry . append ( value ) <EOL> def insert_IDT_Entry ( self , index , value ) : self . IDT_Entry [ index ] = value <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . IDT_Entry <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for IDT_Entry_ in self . IDT_Entry : <EOL> IDT_Entry_ . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = IDTEntryType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . IDT_Entry . append ( obj_ ) <EOL> class IDTEntryType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Type_Attr = None , Offset_High = None , Offset_Low = None , Offset_Middle = None , Selector = None ) : <EOL> self . Type_Attr = Type_Attr <EOL> self . Offset_High = Offset_High <EOL> self . Offset_Low = Offset_Low <EOL> self . Offset_Middle = Offset_Middle <EOL> self . Selector = Selector <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if IDTEntryType . subclass : <EOL> return IDTEntryType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return IDTEntryType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Type_Attr ( self ) : return self . Type_Attr <EOL> def set_Type_Attr ( self , Type_Attr ) : self . Type_Attr = Type_Attr <EOL> def validate_HexBinaryObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Offset_High ( self ) : return self . Offset_High <EOL> def set_Offset_High ( self , Offset_High ) : self . Offset_High = Offset_High <EOL> def get_Offset_Low ( self ) : return self . Offset_Low <EOL> def set_Offset_Low ( self , Offset_Low ) : self . Offset_Low = Offset_Low <EOL> def get_Offset_Middle ( self ) : return self . Offset_Middle <EOL> def set_Offset_Middle ( self , Offset_Middle ) : self . Offset_Middle = Offset_Middle <EOL> def get_Selector ( self ) : return self . Selector <EOL> def set_Selector ( self , Selector ) : self . Selector = Selector <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Type_Attr is not None or <EOL> self . Offset_High is not None or <EOL> self . Offset_Low is not None or <EOL> self . Offset_Middle is not None or <EOL> self . Selector is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Type_Attr is not None : <EOL> self . Type_Attr . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Offset_High is not None : <EOL> self . Offset_High . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Offset_Low is not None : <EOL> self . Offset_Low . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Offset_Middle is not None : <EOL> self . Offset_Middle . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Selector is not None : <EOL> self . Selector . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Type_Attr ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Offset_High ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Offset_Low ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Offset_Middle ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Selector ( obj_ ) <EOL> class WindowsKernelObjectType ( cybox_common . ObjectPropertiesType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . ObjectPropertiesType <EOL> def __init__ ( self , object_reference = None , Custom_Properties = None , xsi_type = None , IDT = None , SSDT = None ) : <EOL> super ( WindowsKernelObjectType , self ) . __init__ ( object_reference , Custom_Properties , xsi_type ) <EOL> self . IDT = IDT <EOL> self . SSDT = SSDT <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if WindowsKernelObjectType . subclass : <EOL> return WindowsKernelObjectType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return WindowsKernelObjectType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_IDT ( self ) : return self . IDT <EOL> def set_IDT ( self , IDT ) : self . IDT = IDT <EOL> def get_SSDT ( self ) : return self . SSDT <EOL> def set_SSDT ( self , SSDT ) : self . SSDT = SSDT <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . IDT is not None or <EOL> self . SSDT is not None or <EOL> super ( WindowsKernelObjectType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( WindowsKernelObjectType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( WindowsKernelObjectType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . IDT is not None : <EOL> self . IDT . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . SSDT is not None : <EOL> self . SSDT . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> super ( WindowsKernelObjectType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = IDTEntryListType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_IDT ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = SSDTEntryListType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_SSDT ( obj_ ) <EOL> super ( WindowsKernelObjectType , self ) . buildChildren ( child_ , node , nodeName_ , True ) <EOL> GDSClassesMapping = { <EOL> '<STR_LIT>' : cybox_common . BuildUtilityType , <EOL> '<STR_LIT>' : cybox_common . ErrorsType , <EOL> '<STR_LIT>' : cybox_common . TimeType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashStructureType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . DigitalSignatureInfoType , <EOL> '<STR_LIT>' : cybox_common . CodeSnippetsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . InternationalizationSettingsType , <EOL> '<STR_LIT>' : cybox_common . ToolConfigurationType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentsType , <EOL> '<STR_LIT>' : cybox_common . FunctionsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . CompilerInformalDescriptionType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . UsageContextAssumptionsType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . CompilersType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringType , <EOL> '<STR_LIT>' : cybox_common . CustomPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildInformationType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . ErrorInstancesType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PropertyType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringsType , <EOL> '<STR_LIT>' : cybox_common . NonNegativeIntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PersonnelType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . DataSizeType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingsType , <EOL> '<STR_LIT>' : cybox_common . SimpleHashValueType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformIdentifierType , <EOL> '<STR_LIT>' : cybox_common . ToolSpecificDataType , <EOL> '<STR_LIT>' : cybox_common . ExecutionEnvironmentType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DependenciesType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashBlockType , <EOL> '<STR_LIT>' : cybox_common . DependencyType , <EOL> '<STR_LIT>' : cybox_common . ErrorType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . EnvironmentVariableType , <EOL> '<STR_LIT>' : cybox_common . ByteRunType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ImportsType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . LibraryType , <EOL> '<STR_LIT>' : cybox_common . ToolReferencesType , <EOL> '<STR_LIT>' : cybox_common . InternalStringsType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . LibrariesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildConfigurationType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentType , <EOL> '<STR_LIT>' : cybox_common . CompilerType , <EOL> '<STR_LIT:Name>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashValueType , <EOL> '<STR_LIT>' : cybox_common . DateRangeType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ContributorType , <EOL> '<STR_LIT>' : cybox_common . ToolsInformationType , <EOL> '<STR_LIT>' : cybox_common . ToolInformationType , <EOL> } <EOL> USAGE_TEXT = """<STR_LIT>""" <EOL> def usage ( ) : <EOL> print ( USAGE_TEXT ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def get_root_tag ( node ) : <EOL> tag = Tag_pattern_ . match ( node . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> rootClass = GDSClassesMapping . get ( tag ) <EOL> if rootClass is None : <EOL> rootClass = globals ( ) . get ( tag ) <EOL> return tag , rootClass <EOL> def parse ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = WindowsKernelObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def parseEtree ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = WindowsKernelObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> rootElement = rootObj . to_etree ( None , name_ = rootTag ) <EOL> content = etree_ . tostring ( rootElement , pretty_print = True , <EOL> xml_declaration = True , encoding = "<STR_LIT:utf-8>" ) <EOL> sys . stdout . write ( content ) <EOL> sys . stdout . write ( '<STR_LIT:\n>' ) <EOL> return rootObj , rootElement <EOL> def parseString ( inString ) : <EOL> from mixbox . vendor . six import StringIO <EOL> doc = parsexml_ ( StringIO ( inString ) ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = WindowsKernelObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def main ( ) : <EOL> args = sys . argv [ <NUM_LIT:1> : ] <EOL> if len ( args ) == <NUM_LIT:1> : <EOL> parse ( args [ <NUM_LIT:0> ] ) <EOL> else : <EOL> usage ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) <EOL> __all__ = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] </s>
