diff --git a/.sdk-version b/.sdk-version index 3bab994..c2239b0 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.93.0 +v3.93.2 diff --git a/README.md b/README.md index 2955144..2ebc362 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,7 @@ Class | Method | HTTP request | Description - [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md) - [AppApiRestV2InfoTypesCapability](docs/AppApiRestV2InfoTypesCapability.md) - [Argument](docs/Argument.md) + - [Artifact](docs/Artifact.md) - [AttemptFailedEvent](docs/AttemptFailedEvent.md) - [AttemptStartedEvent](docs/AttemptStartedEvent.md) - [AutoRunAgents](docs/AutoRunAgents.md) @@ -352,6 +353,7 @@ Class | Method | HTTP request | Description - [ConfigResponse](docs/ConfigResponse.md) - [ConfirmToolInputBody](docs/ConfirmToolInputBody.md) - [Connection](docs/Connection.md) + - [ConsoleOutputEntry](docs/ConsoleOutputEntry.md) - [Context](docs/Context.md) - [Conversation](docs/Conversation.md) - [ConversationContext](docs/ConversationContext.md) @@ -412,7 +414,6 @@ Class | Method | HTTP request | Description - [EventWarning](docs/EventWarning.md) - [ExportModel](docs/ExportModel.md) - [ExternalResponse](docs/ExternalResponse.md) - - [ExtractedFileEntry](docs/ExtractedFileEntry.md) - [ExtractedURL](docs/ExtractedURL.md) - [FileActivityEntry](docs/FileActivityEntry.md) - [FileFormat](docs/FileFormat.md) @@ -499,7 +500,6 @@ Class | Method | HTTP request | Description - [NameConfidence](docs/NameConfidence.md) - [NameSourceType](docs/NameSourceType.md) - [NetworkActivity](docs/NetworkActivity.md) - - [NumericAddr](docs/NumericAddr.md) - [Order](docs/Order.md) - [PDBDebugModel](docs/PDBDebugModel.md) - [PEModel](docs/PEModel.md) @@ -512,11 +512,11 @@ Class | Method | HTTP request | Description - [PatchCollectionTagsInputBody](docs/PatchCollectionTagsInputBody.md) - [PatchCollectionTagsOutputBody](docs/PatchCollectionTagsOutputBody.md) - [PatchCommentBody](docs/PatchCommentBody.md) + - [PcapBodyInfo](docs/PcapBodyInfo.md) - [Platform](docs/Platform.md) - [PriceOutput](docs/PriceOutput.md) - [PriceSummary](docs/PriceSummary.md) - [ProcessActivityEntry](docs/ProcessActivityEntry.md) - - [ProcessExtractedFiles](docs/ProcessExtractedFiles.md) - [ProcessMemdumps](docs/ProcessMemdumps.md) - [ProcessNode](docs/ProcessNode.md) - [ProcessTree](docs/ProcessTree.md) @@ -597,6 +597,7 @@ Class | Method | HTTP request | Description - [TaskResponse](docs/TaskResponse.md) - [TaskStatus](docs/TaskStatus.md) - [TaskStatusResponse](docs/TaskStatusResponse.md) + - [TcpCarvedFile](docs/TcpCarvedFile.md) - [TimestampModel](docs/TimestampModel.md) - [TokenisedData](docs/TokenisedData.md) - [TriageFunctionResponse](docs/TriageFunctionResponse.md) diff --git a/docs/AIDecompInverseFunctionMapItem.md b/docs/AIDecompInverseFunctionMapItem.md index 3c7e0b9..1e48fc8 100644 --- a/docs/AIDecompInverseFunctionMapItem.md +++ b/docs/AIDecompInverseFunctionMapItem.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**addr** | [**NumericAddr**](NumericAddr.md) | | +**addr** | **int** | | **is_external** | **bool** | | **name** | **str** | | diff --git a/docs/AIDecompInverseStringMapItem.md b/docs/AIDecompInverseStringMapItem.md index f4cae76..00c34f7 100644 --- a/docs/AIDecompInverseStringMapItem.md +++ b/docs/AIDecompInverseStringMapItem.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**addr** | [**NumericAddr**](NumericAddr.md) | | +**addr** | **int** | | **string** | **str** | | ## Example diff --git a/docs/AnalysisReport.md b/docs/AnalysisReport.md index 4e1db6d..e7fc6cb 100644 --- a/docs/AnalysisReport.md +++ b/docs/AnalysisReport.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**extracted_files** | [**List[ProcessExtractedFiles]**](ProcessExtractedFiles.md) | | [optional] +**artifacts** | [**List[Artifact]**](Artifact.md) | | [optional] +**console_output** | [**List[ConsoleOutputEntry]**](ConsoleOutputEntry.md) | | [optional] **file_activity** | [**List[FileActivityEntry]**](FileActivityEntry.md) | | [optional] **info** | [**ReportInfo**](ReportInfo.md) | | **memdumps** | [**List[ProcessMemdumps]**](ProcessMemdumps.md) | | [optional] @@ -18,7 +19,6 @@ Name | Type | Description | Notes **scheduled_tasks** | [**List[ScheduledTaskEntry]**](ScheduledTaskEntry.md) | | [optional] **services** | [**List[ServiceEntry]**](ServiceEntry.md) | | [optional] **startup** | [**StartupInfo**](StartupInfo.md) | | [optional] -**threat_score** | **int** | | **ttps** | [**List[Ttp]**](Ttp.md) | | [optional] ## Example diff --git a/docs/Artifact.md b/docs/Artifact.md new file mode 100644 index 0000000..ea4246e --- /dev/null +++ b/docs/Artifact.md @@ -0,0 +1,48 @@ +# Artifact + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**direction** | **str** | | [optional] +**dump_addr** | **str** | | [optional] +**dump_pid** | **int** | | [optional] +**file_type** | **str** | | [optional] +**host** | **str** | | [optional] +**is_pe** | **bool** | | +**mime_type** | **str** | | [optional] +**name** | **str** | | +**network_source** | **str** | | [optional] +**original_filename** | **str** | | [optional] +**path** | **str** | | +**process_seqid** | **int** | | [optional] +**reason** | **str** | | +**response_status** | **int** | | [optional] +**sha256** | **str** | | [optional] +**size** | **int** | | +**source** | **str** | | +**uri** | **str** | | [optional] +**was_mapped** | **bool** | | [optional] +**yara_hits** | **List[str]** | | [optional] + +## Example + +```python +from revengai.models.artifact import Artifact + +# TODO update the JSON string below +json = "{}" +# create an instance of Artifact from a JSON string +artifact_instance = Artifact.from_json(json) +# print the JSON string representation of the object +print(Artifact.to_json()) + +# convert the object into a dict +artifact_dict = artifact_instance.to_dict() +# create an instance of Artifact from a dict +artifact_from_dict = Artifact.from_dict(artifact_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Connection.md b/docs/Connection.md index 212c0fe..223c6f2 100644 --- a/docs/Connection.md +++ b/docs/Connection.md @@ -5,12 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**bytes_received** | **int** | | [optional] +**bytes_sent** | **int** | | [optional] **events** | [**List[ReportEvent]**](ReportEvent.md) | | [optional] +**ja3** | **str** | | [optional] +**ja3s** | **str** | | [optional] **local_ip** | **str** | | **local_port** | **object** | | **protocol** | **str** | | **remote_ip** | **str** | | **remote_port** | **object** | | +**tcp_carved_files** | [**List[TcpCarvedFile]**](TcpCarvedFile.md) | | [optional] ## Example diff --git a/docs/ConsoleOutputEntry.md b/docs/ConsoleOutputEntry.md new file mode 100644 index 0000000..85cfd31 --- /dev/null +++ b/docs/ConsoleOutputEntry.md @@ -0,0 +1,30 @@ +# ConsoleOutputEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**output** | **str** | | +**process_seqid** | **int** | | + +## Example + +```python +from revengai.models.console_output_entry import ConsoleOutputEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ConsoleOutputEntry from a JSON string +console_output_entry_instance = ConsoleOutputEntry.from_json(json) +# print the JSON string representation of the object +print(ConsoleOutputEntry.to_json()) + +# convert the object into a dict +console_output_entry_dict = console_output_entry_instance.to_dict() +# create an instance of ConsoleOutputEntry from a dict +console_output_entry_from_dict = ConsoleOutputEntry.from_dict(console_output_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DnsQuery.md b/docs/DnsQuery.md index 5e0daf9..c3236f8 100644 --- a/docs/DnsQuery.md +++ b/docs/DnsQuery.md @@ -5,8 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**cname_chain** | **List[str]** | | [optional] **domain** | **str** | | **events** | [**List[ReportEvent]**](ReportEvent.md) | | [optional] +**min_ttl** | **int** | | [optional] +**resolved_ips** | **List[str]** | | [optional] ## Example diff --git a/docs/ExtractedFileEntry.md b/docs/ExtractedFileEntry.md deleted file mode 100644 index 9684c40..0000000 --- a/docs/ExtractedFileEntry.md +++ /dev/null @@ -1,38 +0,0 @@ -# ExtractedFileEntry - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file_hash** | **str** | | [optional] -**file_size** | **int** | | -**file_type** | **str** | | [optional] -**filename** | **str** | | -**is_pe** | **bool** | | [optional] -**mime_type** | **str** | | [optional] -**reason** | **str** | | [optional] -**seq_num** | **int** | | -**sha256** | **str** | | [optional] -**zip_filename** | **str** | | - -## Example - -```python -from revengai.models.extracted_file_entry import ExtractedFileEntry - -# TODO update the JSON string below -json = "{}" -# create an instance of ExtractedFileEntry from a JSON string -extracted_file_entry_instance = ExtractedFileEntry.from_json(json) -# print the JSON string representation of the object -print(ExtractedFileEntry.to_json()) - -# convert the object into a dict -extracted_file_entry_dict = extracted_file_entry_instance.to_dict() -# create an instance of ExtractedFileEntry from a dict -extracted_file_entry_from_dict = ExtractedFileEntry.from_dict(extracted_file_entry_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/HttpRequest.md b/docs/HttpRequest.md index 6942951..1439be4 100644 --- a/docs/HttpRequest.md +++ b/docs/HttpRequest.md @@ -5,15 +5,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**bytes_received** | **int** | | [optional] +**bytes_sent** | **int** | | [optional] **events** | [**List[ReportEvent]**](ReportEvent.md) | | [optional] **extra_headers** | **List[str]** | | [optional] **flags** | **int** | | [optional] **password** | **str** | | [optional] **path** | **str** | | [optional] +**pcap_stream_id** | **int** | | [optional] **post_data** | **str** | | [optional] **proxy** | **str** | | [optional] **proxy_bypass** | **str** | | [optional] **referer** | **str** | | [optional] +**request_body** | [**PcapBodyInfo**](PcapBodyInfo.md) | | [optional] +**response_body** | [**PcapBodyInfo**](PcapBodyInfo.md) | | [optional] +**response_status** | **int** | | [optional] +**server_ip** | **str** | | [optional] **server_name** | **str** | | [optional] **server_port** | **int** | | [optional] **service** | **int** | | [optional] diff --git a/docs/NumericAddr.md b/docs/NumericAddr.md deleted file mode 100644 index 0bf79c3..0000000 --- a/docs/NumericAddr.md +++ /dev/null @@ -1,29 +0,0 @@ -# NumericAddr - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **int** | | - -## Example - -```python -from revengai.models.numeric_addr import NumericAddr - -# TODO update the JSON string below -json = "{}" -# create an instance of NumericAddr from a JSON string -numeric_addr_instance = NumericAddr.from_json(json) -# print the JSON string representation of the object -print(NumericAddr.to_json()) - -# convert the object into a dict -numeric_addr_dict = numeric_addr_instance.to_dict() -# create an instance of NumericAddr from a dict -numeric_addr_from_dict = NumericAddr.from_dict(numeric_addr_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PcapBodyInfo.md b/docs/PcapBodyInfo.md new file mode 100644 index 0000000..cb2bb25 --- /dev/null +++ b/docs/PcapBodyInfo.md @@ -0,0 +1,35 @@ +# PcapBodyInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | **str** | | [optional] +**is_pe** | **bool** | | +**mime_type** | **str** | | [optional] +**preview** | **str** | | [optional] +**sha256** | **str** | | [optional] +**size** | **int** | | +**yara_hits** | **List[str]** | | [optional] + +## Example + +```python +from revengai.models.pcap_body_info import PcapBodyInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of PcapBodyInfo from a JSON string +pcap_body_info_instance = PcapBodyInfo.from_json(json) +# print the JSON string representation of the object +print(PcapBodyInfo.to_json()) + +# convert the object into a dict +pcap_body_info_dict = pcap_body_info_instance.to_dict() +# create an instance of PcapBodyInfo from a dict +pcap_body_info_from_dict = PcapBodyInfo.from_dict(pcap_body_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ProcessExtractedFiles.md b/docs/ProcessExtractedFiles.md deleted file mode 100644 index ab93e28..0000000 --- a/docs/ProcessExtractedFiles.md +++ /dev/null @@ -1,30 +0,0 @@ -# ProcessExtractedFiles - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**files** | [**List[ExtractedFileEntry]**](ExtractedFileEntry.md) | | [optional] -**process_seqid** | **int** | | - -## Example - -```python -from revengai.models.process_extracted_files import ProcessExtractedFiles - -# TODO update the JSON string below -json = "{}" -# create an instance of ProcessExtractedFiles from a JSON string -process_extracted_files_instance = ProcessExtractedFiles.from_json(json) -# print the JSON string representation of the object -print(ProcessExtractedFiles.to_json()) - -# convert the object into a dict -process_extracted_files_dict = process_extracted_files_instance.to_dict() -# create an instance of ProcessExtractedFiles from a dict -process_extracted_files_from_dict = ProcessExtractedFiles.from_dict(process_extracted_files_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RenameInputBody.md b/docs/RenameInputBody.md index 2b18113..c8005d6 100644 --- a/docs/RenameInputBody.md +++ b/docs/RenameInputBody.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **new_mangled_name** | **str** | New mangled function name | [optional] **new_name** | **str** | New function name | +**preserve_ai_decompilation** | **bool** | Keep the cached AI decompilation, summary and inline comments. Set when the new name comes from the model's own prediction (e.g. Transfer Name) so existing AI output is not discarded and regenerated. | [optional] ## Example diff --git a/docs/ReportEvent.md b/docs/ReportEvent.md index dce34cf..01fa8f2 100644 --- a/docs/ReportEvent.md +++ b/docs/ReportEvent.md @@ -6,12 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_calls** | [**List[ApiCall]**](ApiCall.md) | | [optional] +**count** | **int** | | [optional] +**desired_access** | **List[str]** | | [optional] **process_seqid** | **int** | | [optional] -**total_bytes_requested** | **int** | | [optional] +**total_bytes** | **int** | | [optional] **type** | **str** | | **value** | **str** | | [optional] **value_name** | **str** | | [optional] -**write_count** | **int** | | [optional] ## Example diff --git a/docs/TcpCarvedFile.md b/docs/TcpCarvedFile.md new file mode 100644 index 0000000..32637dc --- /dev/null +++ b/docs/TcpCarvedFile.md @@ -0,0 +1,36 @@ +# TcpCarvedFile + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**direction** | **str** | | +**filename** | **str** | | [optional] +**is_pe** | **bool** | | +**mime_type** | **str** | | [optional] +**offset** | **int** | | +**sha256** | **str** | | +**size** | **int** | | +**yara_hits** | **List[str]** | | [optional] + +## Example + +```python +from revengai.models.tcp_carved_file import TcpCarvedFile + +# TODO update the JSON string below +json = "{}" +# create an instance of TcpCarvedFile from a JSON string +tcp_carved_file_instance = TcpCarvedFile.from_json(json) +# print the JSON string representation of the object +print(TcpCarvedFile.to_json()) + +# convert the object into a dict +tcp_carved_file_dict = tcp_carved_file_instance.to_dict() +# create an instance of TcpCarvedFile from a dict +tcp_carved_file_from_dict = TcpCarvedFile.from_dict(tcp_carved_file_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/revengai/__init__.py b/revengai/__init__.py index 1642198..a082ef4 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.93.0" +__version__ = "v3.93.2" # Define package exports __all__ = [ @@ -93,6 +93,7 @@ "AppApiRestV2FunctionsTypesFunction", "AppApiRestV2InfoTypesCapability", "Argument", + "Artifact", "AttemptFailedEvent", "AttemptStartedEvent", "AutoRunAgents", @@ -209,6 +210,7 @@ "ConfigResponse", "ConfirmToolInputBody", "Connection", + "ConsoleOutputEntry", "Context", "Conversation", "ConversationContext", @@ -269,7 +271,6 @@ "EventWarning", "ExportModel", "ExternalResponse", - "ExtractedFileEntry", "ExtractedURL", "FileActivityEntry", "FileFormat", @@ -356,7 +357,6 @@ "NameConfidence", "NameSourceType", "NetworkActivity", - "NumericAddr", "Order", "PDBDebugModel", "PEModel", @@ -369,11 +369,11 @@ "PatchCollectionTagsInputBody", "PatchCollectionTagsOutputBody", "PatchCommentBody", + "PcapBodyInfo", "Platform", "PriceOutput", "PriceSummary", "ProcessActivityEntry", - "ProcessExtractedFiles", "ProcessMemdumps", "ProcessNode", "ProcessTree", @@ -454,6 +454,7 @@ "TaskResponse", "TaskStatus", "TaskStatusResponse", + "TcpCarvedFile", "TimestampModel", "TokenisedData", "TriageFunctionResponse", @@ -558,6 +559,7 @@ from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction as AppApiRestV2FunctionsTypesFunction from revengai.models.app_api_rest_v2_info_types_capability import AppApiRestV2InfoTypesCapability as AppApiRestV2InfoTypesCapability from revengai.models.argument import Argument as Argument +from revengai.models.artifact import Artifact as Artifact from revengai.models.attempt_failed_event import AttemptFailedEvent as AttemptFailedEvent from revengai.models.attempt_started_event import AttemptStartedEvent as AttemptStartedEvent from revengai.models.auto_run_agents import AutoRunAgents as AutoRunAgents @@ -674,6 +676,7 @@ from revengai.models.config_response import ConfigResponse as ConfigResponse from revengai.models.confirm_tool_input_body import ConfirmToolInputBody as ConfirmToolInputBody from revengai.models.connection import Connection as Connection +from revengai.models.console_output_entry import ConsoleOutputEntry as ConsoleOutputEntry from revengai.models.context import Context as Context from revengai.models.conversation import Conversation as Conversation from revengai.models.conversation_context import ConversationContext as ConversationContext @@ -734,7 +737,6 @@ from revengai.models.event_warning import EventWarning as EventWarning from revengai.models.export_model import ExportModel as ExportModel from revengai.models.external_response import ExternalResponse as ExternalResponse -from revengai.models.extracted_file_entry import ExtractedFileEntry as ExtractedFileEntry from revengai.models.extracted_url import ExtractedURL as ExtractedURL from revengai.models.file_activity_entry import FileActivityEntry as FileActivityEntry from revengai.models.file_format import FileFormat as FileFormat @@ -821,7 +823,6 @@ from revengai.models.name_confidence import NameConfidence as NameConfidence from revengai.models.name_source_type import NameSourceType as NameSourceType from revengai.models.network_activity import NetworkActivity as NetworkActivity -from revengai.models.numeric_addr import NumericAddr as NumericAddr from revengai.models.order import Order as Order from revengai.models.pdb_debug_model import PDBDebugModel as PDBDebugModel from revengai.models.pe_model import PEModel as PEModel @@ -834,11 +835,11 @@ from revengai.models.patch_collection_tags_input_body import PatchCollectionTagsInputBody as PatchCollectionTagsInputBody from revengai.models.patch_collection_tags_output_body import PatchCollectionTagsOutputBody as PatchCollectionTagsOutputBody from revengai.models.patch_comment_body import PatchCommentBody as PatchCommentBody +from revengai.models.pcap_body_info import PcapBodyInfo as PcapBodyInfo from revengai.models.platform import Platform as Platform from revengai.models.price_output import PriceOutput as PriceOutput from revengai.models.price_summary import PriceSummary as PriceSummary from revengai.models.process_activity_entry import ProcessActivityEntry as ProcessActivityEntry -from revengai.models.process_extracted_files import ProcessExtractedFiles as ProcessExtractedFiles from revengai.models.process_memdumps import ProcessMemdumps as ProcessMemdumps from revengai.models.process_node import ProcessNode as ProcessNode from revengai.models.process_tree import ProcessTree as ProcessTree @@ -919,6 +920,7 @@ from revengai.models.task_response import TaskResponse as TaskResponse from revengai.models.task_status import TaskStatus as TaskStatus from revengai.models.task_status_response import TaskStatusResponse as TaskStatusResponse +from revengai.models.tcp_carved_file import TcpCarvedFile as TcpCarvedFile from revengai.models.timestamp_model import TimestampModel as TimestampModel from revengai.models.tokenised_data import TokenisedData as TokenisedData from revengai.models.triage_function_response import TriageFunctionResponse as TriageFunctionResponse diff --git a/revengai/api_client.py b/revengai/api_client.py index 89007e3..a21eed5 100644 --- a/revengai/api_client.py +++ b/revengai/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v3.93.0/python' + self.user_agent = 'OpenAPI-Generator/v3.93.2/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 3373189..bf8e575 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v3.93.0\n"\ - "SDK Package Version: v3.93.0".\ + "Version of the API: v3.93.2\n"\ + "SDK Package Version: v3.93.2".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index 2eab098..89c974a 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -59,6 +59,7 @@ from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction from revengai.models.app_api_rest_v2_info_types_capability import AppApiRestV2InfoTypesCapability from revengai.models.argument import Argument +from revengai.models.artifact import Artifact from revengai.models.attempt_failed_event import AttemptFailedEvent from revengai.models.attempt_started_event import AttemptStartedEvent from revengai.models.auto_run_agents import AutoRunAgents @@ -175,6 +176,7 @@ from revengai.models.config_response import ConfigResponse from revengai.models.confirm_tool_input_body import ConfirmToolInputBody from revengai.models.connection import Connection +from revengai.models.console_output_entry import ConsoleOutputEntry from revengai.models.context import Context from revengai.models.conversation import Conversation from revengai.models.conversation_context import ConversationContext @@ -235,7 +237,6 @@ from revengai.models.event_warning import EventWarning from revengai.models.export_model import ExportModel from revengai.models.external_response import ExternalResponse -from revengai.models.extracted_file_entry import ExtractedFileEntry from revengai.models.extracted_url import ExtractedURL from revengai.models.file_activity_entry import FileActivityEntry from revengai.models.file_format import FileFormat @@ -322,7 +323,6 @@ from revengai.models.name_confidence import NameConfidence from revengai.models.name_source_type import NameSourceType from revengai.models.network_activity import NetworkActivity -from revengai.models.numeric_addr import NumericAddr from revengai.models.order import Order from revengai.models.pdb_debug_model import PDBDebugModel from revengai.models.pe_model import PEModel @@ -335,11 +335,11 @@ from revengai.models.patch_collection_tags_input_body import PatchCollectionTagsInputBody from revengai.models.patch_collection_tags_output_body import PatchCollectionTagsOutputBody from revengai.models.patch_comment_body import PatchCommentBody +from revengai.models.pcap_body_info import PcapBodyInfo from revengai.models.platform import Platform from revengai.models.price_output import PriceOutput from revengai.models.price_summary import PriceSummary from revengai.models.process_activity_entry import ProcessActivityEntry -from revengai.models.process_extracted_files import ProcessExtractedFiles from revengai.models.process_memdumps import ProcessMemdumps from revengai.models.process_node import ProcessNode from revengai.models.process_tree import ProcessTree @@ -420,6 +420,7 @@ from revengai.models.task_response import TaskResponse from revengai.models.task_status import TaskStatus from revengai.models.task_status_response import TaskStatusResponse +from revengai.models.tcp_carved_file import TcpCarvedFile from revengai.models.timestamp_model import TimestampModel from revengai.models.tokenised_data import TokenisedData from revengai.models.triage_function_response import TriageFunctionResponse diff --git a/revengai/models/ai_decomp_inverse_function_map_item.py b/revengai/models/ai_decomp_inverse_function_map_item.py index 97632a1..5a50241 100644 --- a/revengai/models/ai_decomp_inverse_function_map_item.py +++ b/revengai/models/ai_decomp_inverse_function_map_item.py @@ -16,9 +16,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List -from revengai.models.numeric_addr import NumericAddr +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -26,7 +25,7 @@ class AIDecompInverseFunctionMapItem(BaseModel): """ AIDecompInverseFunctionMapItem """ # noqa: E501 - addr: NumericAddr + addr: Optional[StrictInt] is_external: StrictBool name: StrictStr additional_properties: Dict[str, Any] = {} @@ -73,14 +72,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of addr - if self.addr: - _dict['addr'] = self.addr.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if addr (nullable) is None + # and model_fields_set contains the field + if self.addr is None and "addr" in self.model_fields_set: + _dict['addr'] = None + return _dict @classmethod @@ -93,7 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": NumericAddr.from_dict(obj["addr"]) if obj.get("addr") is not None else None, + "addr": obj.get("addr"), "is_external": obj.get("is_external"), "name": obj.get("name") }) diff --git a/revengai/models/ai_decomp_inverse_string_map_item.py b/revengai/models/ai_decomp_inverse_string_map_item.py index 63330fa..d36c380 100644 --- a/revengai/models/ai_decomp_inverse_string_map_item.py +++ b/revengai/models/ai_decomp_inverse_string_map_item.py @@ -16,9 +16,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from revengai.models.numeric_addr import NumericAddr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -26,7 +25,7 @@ class AIDecompInverseStringMapItem(BaseModel): """ AIDecompInverseStringMapItem """ # noqa: E501 - addr: NumericAddr + addr: Optional[StrictInt] string: StrictStr additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["addr", "string"] @@ -72,14 +71,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of addr - if self.addr: - _dict['addr'] = self.addr.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if addr (nullable) is None + # and model_fields_set contains the field + if self.addr is None and "addr" in self.model_fields_set: + _dict['addr'] = None + return _dict @classmethod @@ -92,7 +93,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": NumericAddr.from_dict(obj["addr"]) if obj.get("addr") is not None else None, + "addr": obj.get("addr"), "string": obj.get("string") }) # store additional fields in additional_properties diff --git a/revengai/models/analysis_report.py b/revengai/models/analysis_report.py index b3a2587..8af7db0 100644 --- a/revengai/models/analysis_report.py +++ b/revengai/models/analysis_report.py @@ -16,14 +16,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.artifact import Artifact +from revengai.models.console_output_entry import ConsoleOutputEntry from revengai.models.file_activity_entry import FileActivityEntry from revengai.models.module_load_entry import ModuleLoadEntry from revengai.models.mutex_entry import MutexEntry from revengai.models.network_activity import NetworkActivity from revengai.models.process_activity_entry import ProcessActivityEntry -from revengai.models.process_extracted_files import ProcessExtractedFiles from revengai.models.process_memdumps import ProcessMemdumps from revengai.models.process_tree import ProcessTree from revengai.models.registry_operation import RegistryOperation @@ -39,7 +40,8 @@ class AnalysisReport(BaseModel): """ AnalysisReport """ # noqa: E501 - extracted_files: Optional[List[ProcessExtractedFiles]] = None + artifacts: Optional[List[Artifact]] = None + console_output: Optional[List[ConsoleOutputEntry]] = None file_activity: Optional[List[FileActivityEntry]] = None info: ReportInfo memdumps: Optional[List[ProcessMemdumps]] = None @@ -52,10 +54,9 @@ class AnalysisReport(BaseModel): scheduled_tasks: Optional[List[ScheduledTaskEntry]] = None services: Optional[List[ServiceEntry]] = None startup: Optional[StartupInfo] = None - threat_score: StrictInt ttps: Optional[List[Ttp]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["extracted_files", "file_activity", "info", "memdumps", "module_load_addresses", "mutexes", "network_activity", "process_activity", "process_tree", "registry_operations", "scheduled_tasks", "services", "startup", "threat_score", "ttps"] + __properties: ClassVar[List[str]] = ["artifacts", "console_output", "file_activity", "info", "memdumps", "module_load_addresses", "mutexes", "network_activity", "process_activity", "process_tree", "registry_operations", "scheduled_tasks", "services", "startup", "ttps"] model_config = ConfigDict( populate_by_name=True, @@ -98,13 +99,20 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in extracted_files (list) + # override the default output from pydantic by calling `to_dict()` of each item in artifacts (list) _items = [] - if self.extracted_files: - for _item_extracted_files in self.extracted_files: - if _item_extracted_files: - _items.append(_item_extracted_files.to_dict()) - _dict['extracted_files'] = _items + if self.artifacts: + for _item_artifacts in self.artifacts: + if _item_artifacts: + _items.append(_item_artifacts.to_dict()) + _dict['artifacts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in console_output (list) + _items = [] + if self.console_output: + for _item_console_output in self.console_output: + if _item_console_output: + _items.append(_item_console_output.to_dict()) + _dict['console_output'] = _items # override the default output from pydantic by calling `to_dict()` of each item in file_activity (list) _items = [] if self.file_activity: @@ -185,10 +193,15 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if extracted_files (nullable) is None + # set to None if artifacts (nullable) is None + # and model_fields_set contains the field + if self.artifacts is None and "artifacts" in self.model_fields_set: + _dict['artifacts'] = None + + # set to None if console_output (nullable) is None # and model_fields_set contains the field - if self.extracted_files is None and "extracted_files" in self.model_fields_set: - _dict['extracted_files'] = None + if self.console_output is None and "console_output" in self.model_fields_set: + _dict['console_output'] = None # set to None if file_activity (nullable) is None # and model_fields_set contains the field @@ -247,7 +260,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "extracted_files": [ProcessExtractedFiles.from_dict(_item) for _item in obj["extracted_files"]] if obj.get("extracted_files") is not None else None, + "artifacts": [Artifact.from_dict(_item) for _item in obj["artifacts"]] if obj.get("artifacts") is not None else None, + "console_output": [ConsoleOutputEntry.from_dict(_item) for _item in obj["console_output"]] if obj.get("console_output") is not None else None, "file_activity": [FileActivityEntry.from_dict(_item) for _item in obj["file_activity"]] if obj.get("file_activity") is not None else None, "info": ReportInfo.from_dict(obj["info"]) if obj.get("info") is not None else None, "memdumps": [ProcessMemdumps.from_dict(_item) for _item in obj["memdumps"]] if obj.get("memdumps") is not None else None, @@ -260,7 +274,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "scheduled_tasks": [ScheduledTaskEntry.from_dict(_item) for _item in obj["scheduled_tasks"]] if obj.get("scheduled_tasks") is not None else None, "services": [ServiceEntry.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None, "startup": StartupInfo.from_dict(obj["startup"]) if obj.get("startup") is not None else None, - "threat_score": obj.get("threat_score"), "ttps": [Ttp.from_dict(_item) for _item in obj["ttps"]] if obj.get("ttps") is not None else None }) # store additional fields in additional_properties diff --git a/revengai/models/artifact.py b/revengai/models/artifact.py new file mode 100644 index 0000000..0f5692a --- /dev/null +++ b/revengai/models/artifact.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Artifact(BaseModel): + """ + Artifact + """ # noqa: E501 + direction: Optional[StrictStr] = None + dump_addr: Optional[StrictStr] = None + dump_pid: Optional[StrictInt] = None + file_type: Optional[StrictStr] = None + host: Optional[StrictStr] = None + is_pe: StrictBool + mime_type: Optional[StrictStr] = None + name: Optional[StrictStr] + network_source: Optional[StrictStr] = None + original_filename: Optional[StrictStr] = None + path: Optional[StrictStr] + process_seqid: Optional[StrictInt] = None + reason: StrictStr + response_status: Optional[StrictInt] = None + sha256: Optional[StrictStr] = None + size: StrictInt + source: Optional[StrictStr] + uri: Optional[StrictStr] = None + was_mapped: Optional[StrictBool] = None + yara_hits: Optional[List[StrictStr]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["direction", "dump_addr", "dump_pid", "file_type", "host", "is_pe", "mime_type", "name", "network_source", "original_filename", "path", "process_seqid", "reason", "response_status", "sha256", "size", "source", "uri", "was_mapped", "yara_hits"] + + @field_validator('reason') + def reason_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['written_by_target_process', 'binary_detected', 'shellcode_detected', 'file_type_detected', 'yara_match', 'network_request', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('written_by_target_process', 'binary_detected', 'shellcode_detected', 'file_type_detected', 'yara_match', 'network_request', 'unknown_default_open_api')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Artifact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if direction (nullable) is None + # and model_fields_set contains the field + if self.direction is None and "direction" in self.model_fields_set: + _dict['direction'] = None + + # set to None if dump_addr (nullable) is None + # and model_fields_set contains the field + if self.dump_addr is None and "dump_addr" in self.model_fields_set: + _dict['dump_addr'] = None + + # set to None if file_type (nullable) is None + # and model_fields_set contains the field + if self.file_type is None and "file_type" in self.model_fields_set: + _dict['file_type'] = None + + # set to None if host (nullable) is None + # and model_fields_set contains the field + if self.host is None and "host" in self.model_fields_set: + _dict['host'] = None + + # set to None if mime_type (nullable) is None + # and model_fields_set contains the field + if self.mime_type is None and "mime_type" in self.model_fields_set: + _dict['mime_type'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if network_source (nullable) is None + # and model_fields_set contains the field + if self.network_source is None and "network_source" in self.model_fields_set: + _dict['network_source'] = None + + # set to None if original_filename (nullable) is None + # and model_fields_set contains the field + if self.original_filename is None and "original_filename" in self.model_fields_set: + _dict['original_filename'] = None + + # set to None if path (nullable) is None + # and model_fields_set contains the field + if self.path is None and "path" in self.model_fields_set: + _dict['path'] = None + + # set to None if sha256 (nullable) is None + # and model_fields_set contains the field + if self.sha256 is None and "sha256" in self.model_fields_set: + _dict['sha256'] = None + + # set to None if source (nullable) is None + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: + _dict['source'] = None + + # set to None if uri (nullable) is None + # and model_fields_set contains the field + if self.uri is None and "uri" in self.model_fields_set: + _dict['uri'] = None + + # set to None if yara_hits (nullable) is None + # and model_fields_set contains the field + if self.yara_hits is None and "yara_hits" in self.model_fields_set: + _dict['yara_hits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Artifact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "direction": obj.get("direction"), + "dump_addr": obj.get("dump_addr"), + "dump_pid": obj.get("dump_pid"), + "file_type": obj.get("file_type"), + "host": obj.get("host"), + "is_pe": obj.get("is_pe"), + "mime_type": obj.get("mime_type"), + "name": obj.get("name"), + "network_source": obj.get("network_source"), + "original_filename": obj.get("original_filename"), + "path": obj.get("path"), + "process_seqid": obj.get("process_seqid"), + "reason": obj.get("reason"), + "response_status": obj.get("response_status"), + "sha256": obj.get("sha256"), + "size": obj.get("size"), + "source": obj.get("source"), + "uri": obj.get("uri"), + "was_mapped": obj.get("was_mapped"), + "yara_hits": obj.get("yara_hits") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/connection.py b/revengai/models/connection.py index 87b8a89..48f28c0 100644 --- a/revengai/models/connection.py +++ b/revengai/models/connection.py @@ -16,9 +16,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from revengai.models.report_event import ReportEvent +from revengai.models.tcp_carved_file import TcpCarvedFile from typing import Optional, Set from typing_extensions import Self @@ -26,14 +27,19 @@ class Connection(BaseModel): """ Connection """ # noqa: E501 + bytes_received: Optional[StrictInt] = None + bytes_sent: Optional[StrictInt] = None events: Optional[List[ReportEvent]] = None + ja3: Optional[StrictStr] = None + ja3s: Optional[StrictStr] = None local_ip: Optional[StrictStr] local_port: Optional[Any] protocol: Optional[StrictStr] remote_ip: Optional[StrictStr] remote_port: Optional[Any] + tcp_carved_files: Optional[List[TcpCarvedFile]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["events", "local_ip", "local_port", "protocol", "remote_ip", "remote_port"] + __properties: ClassVar[List[str]] = ["bytes_received", "bytes_sent", "events", "ja3", "ja3s", "local_ip", "local_port", "protocol", "remote_ip", "remote_port", "tcp_carved_files"] model_config = ConfigDict( populate_by_name=True, @@ -83,6 +89,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_events: _items.append(_item_events.to_dict()) _dict['events'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in tcp_carved_files (list) + _items = [] + if self.tcp_carved_files: + for _item_tcp_carved_files in self.tcp_carved_files: + if _item_tcp_carved_files: + _items.append(_item_tcp_carved_files.to_dict()) + _dict['tcp_carved_files'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -93,6 +106,16 @@ def to_dict(self) -> Dict[str, Any]: if self.events is None and "events" in self.model_fields_set: _dict['events'] = None + # set to None if ja3 (nullable) is None + # and model_fields_set contains the field + if self.ja3 is None and "ja3" in self.model_fields_set: + _dict['ja3'] = None + + # set to None if ja3s (nullable) is None + # and model_fields_set contains the field + if self.ja3s is None and "ja3s" in self.model_fields_set: + _dict['ja3s'] = None + # set to None if local_ip (nullable) is None # and model_fields_set contains the field if self.local_ip is None and "local_ip" in self.model_fields_set: @@ -118,6 +141,11 @@ def to_dict(self) -> Dict[str, Any]: if self.remote_port is None and "remote_port" in self.model_fields_set: _dict['remote_port'] = None + # set to None if tcp_carved_files (nullable) is None + # and model_fields_set contains the field + if self.tcp_carved_files is None and "tcp_carved_files" in self.model_fields_set: + _dict['tcp_carved_files'] = None + return _dict @classmethod @@ -130,12 +158,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "bytes_received": obj.get("bytes_received"), + "bytes_sent": obj.get("bytes_sent"), "events": [ReportEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "ja3": obj.get("ja3"), + "ja3s": obj.get("ja3s"), "local_ip": obj.get("local_ip"), "local_port": obj.get("local_port"), "protocol": obj.get("protocol"), "remote_ip": obj.get("remote_ip"), - "remote_port": obj.get("remote_port") + "remote_port": obj.get("remote_port"), + "tcp_carved_files": [TcpCarvedFile.from_dict(_item) for _item in obj["tcp_carved_files"]] if obj.get("tcp_carved_files") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/numeric_addr.py b/revengai/models/console_output_entry.py similarity index 82% rename from revengai/models/numeric_addr.py rename to revengai/models/console_output_entry.py index a3dab85..84fdbeb 100644 --- a/revengai/models/numeric_addr.py +++ b/revengai/models/console_output_entry.py @@ -16,18 +16,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class NumericAddr(BaseModel): +class ConsoleOutputEntry(BaseModel): """ - NumericAddr + ConsoleOutputEntry """ # noqa: E501 - value: Optional[StrictInt] = Field(alias="Value") + output: Optional[StrictStr] + process_seqid: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["Value"] + __properties: ClassVar[List[str]] = ["output", "process_seqid"] model_config = ConfigDict( populate_by_name=True, @@ -47,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of NumericAddr from a JSON string""" + """Create an instance of ConsoleOutputEntry from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,16 +76,16 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if value (nullable) is None + # set to None if output (nullable) is None # and model_fields_set contains the field - if self.value is None and "value" in self.model_fields_set: - _dict['Value'] = None + if self.output is None and "output" in self.model_fields_set: + _dict['output'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of NumericAddr from a dict""" + """Create an instance of ConsoleOutputEntry from a dict""" if obj is None: return None @@ -92,7 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "Value": obj.get("Value") + "output": obj.get("output"), + "process_seqid": obj.get("process_seqid") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/dns_query.py b/revengai/models/dns_query.py index 7b8a051..da91fb8 100644 --- a/revengai/models/dns_query.py +++ b/revengai/models/dns_query.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from revengai.models.report_event import ReportEvent from typing import Optional, Set @@ -26,10 +26,13 @@ class DnsQuery(BaseModel): """ DnsQuery """ # noqa: E501 + cname_chain: Optional[List[StrictStr]] = None domain: Optional[StrictStr] events: Optional[List[ReportEvent]] = None + min_ttl: Optional[StrictInt] = None + resolved_ips: Optional[List[StrictStr]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["domain", "events"] + __properties: ClassVar[List[str]] = ["cname_chain", "domain", "events", "min_ttl", "resolved_ips"] model_config = ConfigDict( populate_by_name=True, @@ -84,6 +87,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if cname_chain (nullable) is None + # and model_fields_set contains the field + if self.cname_chain is None and "cname_chain" in self.model_fields_set: + _dict['cname_chain'] = None + # set to None if domain (nullable) is None # and model_fields_set contains the field if self.domain is None and "domain" in self.model_fields_set: @@ -94,6 +102,11 @@ def to_dict(self) -> Dict[str, Any]: if self.events is None and "events" in self.model_fields_set: _dict['events'] = None + # set to None if resolved_ips (nullable) is None + # and model_fields_set contains the field + if self.resolved_ips is None and "resolved_ips" in self.model_fields_set: + _dict['resolved_ips'] = None + return _dict @classmethod @@ -106,8 +119,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "cname_chain": obj.get("cname_chain"), "domain": obj.get("domain"), - "events": [ReportEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None + "events": [ReportEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "min_ttl": obj.get("min_ttl"), + "resolved_ips": obj.get("resolved_ips") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/http_request.py b/revengai/models/http_request.py index 939eae6..000126f 100644 --- a/revengai/models/http_request.py +++ b/revengai/models/http_request.py @@ -18,6 +18,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.pcap_body_info import PcapBodyInfo from revengai.models.report_event import ReportEvent from typing import Optional, Set from typing_extensions import Self @@ -26,15 +27,22 @@ class HttpRequest(BaseModel): """ HttpRequest """ # noqa: E501 + bytes_received: Optional[StrictInt] = None + bytes_sent: Optional[StrictInt] = None events: Optional[List[ReportEvent]] = None extra_headers: Optional[List[StrictStr]] = None flags: Optional[StrictInt] = None password: Optional[StrictStr] = None path: Optional[StrictStr] = None + pcap_stream_id: Optional[StrictInt] = None post_data: Optional[StrictStr] = None proxy: Optional[StrictStr] = None proxy_bypass: Optional[StrictStr] = None referer: Optional[StrictStr] = None + request_body: Optional[PcapBodyInfo] = None + response_body: Optional[PcapBodyInfo] = None + response_status: Optional[StrictInt] = None + server_ip: Optional[StrictStr] = None server_name: Optional[StrictStr] = None server_port: Optional[StrictInt] = None service: Optional[StrictInt] = None @@ -43,7 +51,7 @@ class HttpRequest(BaseModel): verb: Optional[StrictStr] = None version: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["events", "extra_headers", "flags", "password", "path", "post_data", "proxy", "proxy_bypass", "referer", "server_name", "server_port", "service", "user_agent", "username", "verb", "version"] + __properties: ClassVar[List[str]] = ["bytes_received", "bytes_sent", "events", "extra_headers", "flags", "password", "path", "pcap_stream_id", "post_data", "proxy", "proxy_bypass", "referer", "request_body", "response_body", "response_status", "server_ip", "server_name", "server_port", "service", "user_agent", "username", "verb", "version"] model_config = ConfigDict( populate_by_name=True, @@ -93,6 +101,12 @@ def to_dict(self) -> Dict[str, Any]: if _item_events: _items.append(_item_events.to_dict()) _dict['events'] = _items + # override the default output from pydantic by calling `to_dict()` of request_body + if self.request_body: + _dict['request_body'] = self.request_body.to_dict() + # override the default output from pydantic by calling `to_dict()` of response_body + if self.response_body: + _dict['response_body'] = self.response_body.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -138,6 +152,11 @@ def to_dict(self) -> Dict[str, Any]: if self.referer is None and "referer" in self.model_fields_set: _dict['referer'] = None + # set to None if server_ip (nullable) is None + # and model_fields_set contains the field + if self.server_ip is None and "server_ip" in self.model_fields_set: + _dict['server_ip'] = None + # set to None if server_name (nullable) is None # and model_fields_set contains the field if self.server_name is None and "server_name" in self.model_fields_set: @@ -175,15 +194,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "bytes_received": obj.get("bytes_received"), + "bytes_sent": obj.get("bytes_sent"), "events": [ReportEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, "extra_headers": obj.get("extra_headers"), "flags": obj.get("flags"), "password": obj.get("password"), "path": obj.get("path"), + "pcap_stream_id": obj.get("pcap_stream_id"), "post_data": obj.get("post_data"), "proxy": obj.get("proxy"), "proxy_bypass": obj.get("proxy_bypass"), "referer": obj.get("referer"), + "request_body": PcapBodyInfo.from_dict(obj["request_body"]) if obj.get("request_body") is not None else None, + "response_body": PcapBodyInfo.from_dict(obj["response_body"]) if obj.get("response_body") is not None else None, + "response_status": obj.get("response_status"), + "server_ip": obj.get("server_ip"), "server_name": obj.get("server_name"), "server_port": obj.get("server_port"), "service": obj.get("service"), diff --git a/revengai/models/extracted_file_entry.py b/revengai/models/pcap_body_info.py similarity index 70% rename from revengai/models/extracted_file_entry.py rename to revengai/models/pcap_body_info.py index f4fbf4c..6492eec 100644 --- a/revengai/models/extracted_file_entry.py +++ b/revengai/models/pcap_body_info.py @@ -21,22 +21,19 @@ from typing import Optional, Set from typing_extensions import Self -class ExtractedFileEntry(BaseModel): +class PcapBodyInfo(BaseModel): """ - ExtractedFileEntry + PcapBodyInfo """ # noqa: E501 - file_hash: Optional[StrictStr] = None - file_size: StrictInt - file_type: Optional[StrictStr] = None - filename: Optional[StrictStr] - is_pe: Optional[StrictBool] = None + filename: Optional[StrictStr] = None + is_pe: StrictBool mime_type: Optional[StrictStr] = None - reason: Optional[StrictStr] = None - seq_num: StrictInt + preview: Optional[StrictStr] = None sha256: Optional[StrictStr] = None - zip_filename: Optional[StrictStr] + size: StrictInt + yara_hits: Optional[List[StrictStr]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["file_hash", "file_size", "file_type", "filename", "is_pe", "mime_type", "reason", "seq_num", "sha256", "zip_filename"] + __properties: ClassVar[List[str]] = ["filename", "is_pe", "mime_type", "preview", "sha256", "size", "yara_hits"] model_config = ConfigDict( populate_by_name=True, @@ -56,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ExtractedFileEntry from a JSON string""" + """Create an instance of PcapBodyInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,16 +81,6 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if file_hash (nullable) is None - # and model_fields_set contains the field - if self.file_hash is None and "file_hash" in self.model_fields_set: - _dict['file_hash'] = None - - # set to None if file_type (nullable) is None - # and model_fields_set contains the field - if self.file_type is None and "file_type" in self.model_fields_set: - _dict['file_type'] = None - # set to None if filename (nullable) is None # and model_fields_set contains the field if self.filename is None and "filename" in self.model_fields_set: @@ -104,26 +91,26 @@ def to_dict(self) -> Dict[str, Any]: if self.mime_type is None and "mime_type" in self.model_fields_set: _dict['mime_type'] = None - # set to None if reason (nullable) is None + # set to None if preview (nullable) is None # and model_fields_set contains the field - if self.reason is None and "reason" in self.model_fields_set: - _dict['reason'] = None + if self.preview is None and "preview" in self.model_fields_set: + _dict['preview'] = None # set to None if sha256 (nullable) is None # and model_fields_set contains the field if self.sha256 is None and "sha256" in self.model_fields_set: _dict['sha256'] = None - # set to None if zip_filename (nullable) is None + # set to None if yara_hits (nullable) is None # and model_fields_set contains the field - if self.zip_filename is None and "zip_filename" in self.model_fields_set: - _dict['zip_filename'] = None + if self.yara_hits is None and "yara_hits" in self.model_fields_set: + _dict['yara_hits'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ExtractedFileEntry from a dict""" + """Create an instance of PcapBodyInfo from a dict""" if obj is None: return None @@ -131,16 +118,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "file_hash": obj.get("file_hash"), - "file_size": obj.get("file_size"), - "file_type": obj.get("file_type"), "filename": obj.get("filename"), "is_pe": obj.get("is_pe"), "mime_type": obj.get("mime_type"), - "reason": obj.get("reason"), - "seq_num": obj.get("seq_num"), + "preview": obj.get("preview"), "sha256": obj.get("sha256"), - "zip_filename": obj.get("zip_filename") + "size": obj.get("size"), + "yara_hits": obj.get("yara_hits") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/rename_input_body.py b/revengai/models/rename_input_body.py index e6448a9..67e9a72 100644 --- a/revengai/models/rename_input_body.py +++ b/revengai/models/rename_input_body.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from typing import Optional, Set @@ -28,8 +28,9 @@ class RenameInputBody(BaseModel): """ # noqa: E501 new_mangled_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="New mangled function name") new_name: Annotated[str, Field(min_length=1, strict=True, max_length=512)] = Field(description="New function name") + preserve_ai_decompilation: Optional[StrictBool] = Field(default=None, description="Keep the cached AI decompilation, summary and inline comments. Set when the new name comes from the model's own prediction (e.g. Transfer Name) so existing AI output is not discarded and regenerated.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["new_mangled_name", "new_name"] + __properties: ClassVar[List[str]] = ["new_mangled_name", "new_name", "preserve_ai_decompilation"] model_config = ConfigDict( populate_by_name=True, @@ -90,7 +91,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "new_mangled_name": obj.get("new_mangled_name"), - "new_name": obj.get("new_name") + "new_name": obj.get("new_name"), + "preserve_ai_decompilation": obj.get("preserve_ai_decompilation") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/report_event.py b/revengai/models/report_event.py index ff67b6d..aeee83f 100644 --- a/revengai/models/report_event.py +++ b/revengai/models/report_event.py @@ -27,14 +27,15 @@ class ReportEvent(BaseModel): ReportEvent """ # noqa: E501 api_calls: Optional[List[ApiCall]] = None + count: Optional[StrictInt] = None + desired_access: Optional[List[StrictStr]] = None process_seqid: Optional[StrictInt] = None - total_bytes_requested: Optional[StrictInt] = None + total_bytes: Optional[StrictInt] = None type: Optional[StrictStr] value: Optional[StrictStr] = None value_name: Optional[StrictStr] = None - write_count: Optional[StrictInt] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["api_calls", "process_seqid", "total_bytes_requested", "type", "value", "value_name", "write_count"] + __properties: ClassVar[List[str]] = ["api_calls", "count", "desired_access", "process_seqid", "total_bytes", "type", "value", "value_name"] model_config = ConfigDict( populate_by_name=True, @@ -94,6 +95,11 @@ def to_dict(self) -> Dict[str, Any]: if self.api_calls is None and "api_calls" in self.model_fields_set: _dict['api_calls'] = None + # set to None if desired_access (nullable) is None + # and model_fields_set contains the field + if self.desired_access is None and "desired_access" in self.model_fields_set: + _dict['desired_access'] = None + # set to None if type (nullable) is None # and model_fields_set contains the field if self.type is None and "type" in self.model_fields_set: @@ -122,12 +128,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "api_calls": [ApiCall.from_dict(_item) for _item in obj["api_calls"]] if obj.get("api_calls") is not None else None, + "count": obj.get("count"), + "desired_access": obj.get("desired_access"), "process_seqid": obj.get("process_seqid"), - "total_bytes_requested": obj.get("total_bytes_requested"), + "total_bytes": obj.get("total_bytes"), "type": obj.get("type"), "value": obj.get("value"), - "value_name": obj.get("value_name"), - "write_count": obj.get("write_count") + "value_name": obj.get("value_name") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/process_extracted_files.py b/revengai/models/tcp_carved_file.py similarity index 59% rename from revengai/models/process_extracted_files.py rename to revengai/models/tcp_carved_file.py index aaaf84f..ee83e7e 100644 --- a/revengai/models/process_extracted_files.py +++ b/revengai/models/tcp_carved_file.py @@ -16,20 +16,25 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.extracted_file_entry import ExtractedFileEntry from typing import Optional, Set from typing_extensions import Self -class ProcessExtractedFiles(BaseModel): +class TcpCarvedFile(BaseModel): """ - ProcessExtractedFiles + TcpCarvedFile """ # noqa: E501 - files: Optional[List[ExtractedFileEntry]] = None - process_seqid: StrictInt + direction: Optional[StrictStr] + filename: Optional[StrictStr] = None + is_pe: StrictBool + mime_type: Optional[StrictStr] = None + offset: StrictInt + sha256: Optional[StrictStr] + size: StrictInt + yara_hits: Optional[List[StrictStr]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["files", "process_seqid"] + __properties: ClassVar[List[str]] = ["direction", "filename", "is_pe", "mime_type", "offset", "sha256", "size", "yara_hits"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +54,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProcessExtractedFiles from a JSON string""" + """Create an instance of TcpCarvedFile from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,28 +77,41 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in files (list) - _items = [] - if self.files: - for _item_files in self.files: - if _item_files: - _items.append(_item_files.to_dict()) - _dict['files'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if files (nullable) is None + # set to None if direction (nullable) is None # and model_fields_set contains the field - if self.files is None and "files" in self.model_fields_set: - _dict['files'] = None + if self.direction is None and "direction" in self.model_fields_set: + _dict['direction'] = None + + # set to None if filename (nullable) is None + # and model_fields_set contains the field + if self.filename is None and "filename" in self.model_fields_set: + _dict['filename'] = None + + # set to None if mime_type (nullable) is None + # and model_fields_set contains the field + if self.mime_type is None and "mime_type" in self.model_fields_set: + _dict['mime_type'] = None + + # set to None if sha256 (nullable) is None + # and model_fields_set contains the field + if self.sha256 is None and "sha256" in self.model_fields_set: + _dict['sha256'] = None + + # set to None if yara_hits (nullable) is None + # and model_fields_set contains the field + if self.yara_hits is None and "yara_hits" in self.model_fields_set: + _dict['yara_hits'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProcessExtractedFiles from a dict""" + """Create an instance of TcpCarvedFile from a dict""" if obj is None: return None @@ -101,8 +119,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "files": [ExtractedFileEntry.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None, - "process_seqid": obj.get("process_seqid") + "direction": obj.get("direction"), + "filename": obj.get("filename"), + "is_pe": obj.get("is_pe"), + "mime_type": obj.get("mime_type"), + "offset": obj.get("offset"), + "sha256": obj.get("sha256"), + "size": obj.get("size"), + "yara_hits": obj.get("yara_hits") }) # store additional fields in additional_properties for _key in obj.keys():