From 6ddbf10fc5f9be325475ff4b0908faab8c301abb Mon Sep 17 00:00:00 2001 From: Ivan Kirillov Date: Thu, 12 Sep 2013 11:00:07 -0400 Subject: [PATCH] API Object initial commit --- cybox/objects/api_object.py | 20 ++++++++++++++++++++ cybox/utils/nsparser.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 cybox/objects/api_object.py diff --git a/cybox/objects/api_object.py b/cybox/objects/api_object.py new file mode 100644 index 00000000..b3e9eb65 --- /dev/null +++ b/cybox/objects/api_object.py @@ -0,0 +1,20 @@ +# Copyright (c) 2013, The MITRE Corporation. All rights reserved. +# See LICENSE.txt for complete terms. + +import cybox +import cybox.bindings.api_object as api_binding +from cybox.common import ObjectProperties, String, HexBinary, StructuredText + + +class API(ObjectProperties): + _binding = api_binding + _binding_class = api_binding.APIObjectType + _namespace = "http://cybox.mitre.org/objects#APIObject-2" + _XSI_NS = "APIObj" + _XSI_TYPE = "APIObjectType" + + description = cybox.TypedField("Description", StructuredText) + function_name = cybox.TypedField("Function_Name", String) + normalized_function_name = cybox.TypedField("Normalized_Function_Name", String) + #platform TODO: add PlatformSpecificationType + address = cybox.TypedField("Address", HexBinary) diff --git a/cybox/utils/nsparser.py b/cybox/utils/nsparser.py index 195ac8c5..f4c14edd 100644 --- a/cybox/utils/nsparser.py +++ b/cybox/utils/nsparser.py @@ -219,7 +219,7 @@ def get_class_for_object_type(self, object_type): OBJ_LIST = [ ('AccountObjectType', 'cybox.objects.account_object.Account', 'account_object', 'http://cybox.mitre.org/objects#AccountObject-2', []), ('AddressObjectType', 'cybox.objects.address_object.Address', 'address_object', 'http://cybox.mitre.org/objects#AddressObject-2', []), - ('APIObjectType', None, 'api_object', 'http://cybox.mitre.org/objects#APIObject-2', []), + ('APIObjectType', 'cybox.objects.api_object.API', 'api_object', 'http://cybox.mitre.org/objects#APIObject-2', []), ('ArtifactObjectType', 'cybox.objects.artifact_object.Artifact', 'artifact_object', 'http://cybox.mitre.org/objects#ArtifactObject-2', []), ('CodeObjectType', None, 'code_object', 'http://cybox.mitre.org/objects#CodeObject-2', []), ('CustomObjectType', None, 'custom_object', 'http://cybox.mitre.org/objects#CustomObject-1', []),