1# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
2# See LICENSE.txt for complete terms.
3
4from mixbox import fields
5
6import cybox.bindings.library_object as library_binding
7from cybox.common.extracted_features import ExtractedFeatures
8from cybox.common import BaseProperty, ObjectProperties, String, UnsignedLong, HexBinary
9
10
11class LibraryType(BaseProperty):
12    _binding = library_binding
13    _binding_class = library_binding.LibraryType
14    _namespace = "http://cybox.mitre.org/objects#LibraryObject-2"
15    default_datatype = "string"
16
17    TYPE_DYNAMIC = "Dynamic"
18    TYPE_STATIC = "Static"
19    TYPE_REMOTE = "Remote"
20    TYPE_SHARED = "Shared"
21    TYPE_OTHER = "Other"
22
23
24class Library(ObjectProperties):
25    _binding = library_binding
26    _binding_class = library_binding.LibraryObjectType
27    _namespace = "http://cybox.mitre.org/objects#LibraryObject-2"
28    _XSI_NS = "LibraryObj"
29    _XSI_TYPE = "LibraryObjectType"
30
31    name = fields.TypedField("Name", String)
32    path = fields.TypedField("Path", String)
33    size = fields.TypedField("Size", UnsignedLong)
34    type_ = fields.TypedField("Type", LibraryType)
35    version = fields.TypedField("Version", String)
36    base_address = fields.TypedField("Base_Address", HexBinary)
37    extracted_features = fields.TypedField("Extracted_Features", ExtractedFeatures)
38