From dca4a9efa0d5cace0257e65fbc258a8d0f7049ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 21 Sep 2026 19:39:31 +0000 Subject: [PATCH] Update SDK to version v4.51.0 - Generated from OpenAPI spec version v4.51.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 15 + docs/AnalysesCoreApi.md | 94 ++ docs/ArrayDataType.md | 1 + docs/BaseDataType.md | 1 + docs/BinariesApi.md | 282 ++++++ docs/BitfieldDataType.md | 1 + docs/ConfigApi.md | 169 ++++ docs/DataTypeEntry.md | 1 + docs/DieMatch.md | 8 +- docs/EnumDataType.md | 1 + docs/FunctionDataType.md | 1 + docs/FunctionsAIDecompilationApi.md | 6 +- docs/FunctionsProgressOutputBody.md | 31 + docs/GetConfigOutputBody.md | 30 + docs/GetDieInfoOutputBody.md | 29 + docs/GetModelsOutputBody.md | 29 + docs/GetRelatedBinariesOutputBody.md | 30 + docs/GetRelatedStatusOutputBody.md | 29 + docs/PointerDataType.md | 1 + docs/RelatedBinary.md | 32 + docs/ScreenshotEntry.md | 29 + docs/ScreenshotsIndex.md | 30 + docs/StructDataType.md | 1 + docs/TypedefDataType.md | 1 + docs/UnionDataType.md | 1 + docs/UnknownDataType.md | 1 + revengai/__init__.py | 20 +- revengai/api/analyses_core_api.py | 275 ++++++ revengai/api/binaries_api.py | 825 ++++++++++++++++++ revengai/api/config_api.py | 499 +++++++++++ .../api/functions_ai_decompilation_api.py | 19 +- revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/__init__.py | 9 + revengai/models/array_data_type.py | 4 +- revengai/models/base_data_type.py | 4 +- revengai/models/bitfield_data_type.py | 4 +- revengai/models/die_match.py | 12 +- revengai/models/enum_data_type.py | 4 +- revengai/models/function_data_type.py | 4 +- .../models/functions_progress_output_body.py | 103 +++ revengai/models/get_config_output_body.py | 106 +++ revengai/models/get_die_info_output_body.py | 112 +++ revengai/models/get_models_output_body.py | 104 +++ .../get_related_binaries_output_body.py | 117 +++ .../models/get_related_status_output_body.py | 106 +++ revengai/models/pointer_data_type.py | 4 +- revengai/models/related_binary.py | 110 +++ revengai/models/screenshot_entry.py | 99 +++ revengai/models/screenshots_index.py | 114 +++ revengai/models/struct_data_type.py | 4 +- revengai/models/typedef_data_type.py | 4 +- revengai/models/union_data_type.py | 4 +- revengai/models/unknown_data_type.py | 4 +- 55 files changed, 3504 insertions(+), 28 deletions(-) create mode 100644 docs/FunctionsProgressOutputBody.md create mode 100644 docs/GetConfigOutputBody.md create mode 100644 docs/GetDieInfoOutputBody.md create mode 100644 docs/GetModelsOutputBody.md create mode 100644 docs/GetRelatedBinariesOutputBody.md create mode 100644 docs/GetRelatedStatusOutputBody.md create mode 100644 docs/RelatedBinary.md create mode 100644 docs/ScreenshotEntry.md create mode 100644 docs/ScreenshotsIndex.md create mode 100644 revengai/models/functions_progress_output_body.py create mode 100644 revengai/models/get_config_output_body.py create mode 100644 revengai/models/get_die_info_output_body.py create mode 100644 revengai/models/get_models_output_body.py create mode 100644 revengai/models/get_related_binaries_output_body.py create mode 100644 revengai/models/get_related_status_output_body.py create mode 100644 revengai/models/related_binary.py create mode 100644 revengai/models/screenshot_entry.py create mode 100644 revengai/models/screenshots_index.py diff --git a/.sdk-version b/.sdk-version index cb6924e2..79477607 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v4.46.0 +v4.51.0 diff --git a/README.md b/README.md index d51e1ff2..f86f7561 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**upload_file**](docs/AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File *AnalysesCoreApi* | [**v3_create_analysis**](docs/AnalysesCoreApi.md#v3_create_analysis) | **POST** /v3/analyses | Create an analysis *AnalysesCoreApi* | [**v3_get_analysis_auto_unstrip_status**](docs/AnalysesCoreApi.md#v3_get_analysis_auto_unstrip_status) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. +*AnalysesCoreApi* | [**v3_get_analysis_functions_progress**](docs/AnalysesCoreApi.md#v3_get_analysis_functions_progress) | **GET** /v3/analyses/{analysis_id}/progress/functions | Get function embedding progress for an analysis. *AnalysesCoreApi* | [**v3_get_analysis_logs**](docs/AnalysesCoreApi.md#v3_get_analysis_logs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log *AnalysesCoreApi* | [**v3_get_analysis_operation**](docs/AnalysesCoreApi.md#v3_get_analysis_operation) | **GET** /v3/operations/analyses/{analysis_id} | Get an Analysis-creation operation *AnalysesCoreApi* | [**v3_get_analysis_strings**](docs/AnalysesCoreApi.md#v3_get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. @@ -152,6 +153,9 @@ Class | Method | HTTP request | Description *BinariesApi* | [**get_binary_externals**](docs/BinariesApi.md#get_binary_externals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary *BinariesApi* | [**get_binary_related_status**](docs/BinariesApi.md#get_binary_related_status) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary *BinariesApi* | [**get_related_binaries**](docs/BinariesApi.md#get_related_binaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. +*BinariesApi* | [**v3_get_binary_die_info**](docs/BinariesApi.md#v3_get_binary_die_info) | **GET** /v3/binaries/{binary_id}/die-info | Get Detect It Easy matches for a binary. +*BinariesApi* | [**v3_get_binary_related**](docs/BinariesApi.md#v3_get_binary_related) | **GET** /v3/binaries/{binary_id}/related | Get the binaries related to this one by unpacking. +*BinariesApi* | [**v3_get_binary_related_status**](docs/BinariesApi.md#v3_get_binary_related_status) | **GET** /v3/binaries/{binary_id}/related/status | Get the archive-unpacking status for a binary. *BinariesApi* | [**v3_upload_file**](docs/BinariesApi.md#v3_upload_file) | **POST** /v3/upload | Upload a file. *CollectionsApi* | [**create_collection**](docs/CollectionsApi.md#create_collection) | **POST** /v2/collections | Creates new collection information *CollectionsApi* | [**delete_collection**](docs/CollectionsApi.md#delete_collection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection @@ -170,6 +174,8 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**v3_patch_collection_tags**](docs/CollectionsApi.md#v3_patch_collection_tags) | **PATCH** /v3/collections/{collection_id}/tags | Replace the tags on a collection. *CollectionsApi* | [**v3_remove_collection_binaries**](docs/CollectionsApi.md#v3_remove_collection_binaries) | **DELETE** /v3/collections/{collection_id}/binaries | Remove binaries from a collection. *ConfigApi* | [**get_config**](docs/ConfigApi.md#get_config) | **GET** /v2/config | Get Config +*ConfigApi* | [**v3_get_config**](docs/ConfigApi.md#v3_get_config) | **GET** /v3/config | Get client configuration. +*ConfigApi* | [**v3_get_models**](docs/ConfigApi.md#v3_get_models) | **GET** /v3/models | Get the models available for analysis. *ConversationsApi* | [**cancel_run**](docs/ConversationsApi.md#cancel_run) | **POST** /v2/conversations/{id}/cancel | Cancel an active run *ConversationsApi* | [**confirm_tool**](docs/ConversationsApi.md#confirm_tool) | **POST** /v2/conversations/{id}/confirm | Approve or reject a pending tool confirmation *ConversationsApi* | [**create_conversation**](docs/ConversationsApi.md#create_conversation) | **POST** /v2/conversations | Create a new conversation @@ -610,6 +616,7 @@ Class | Method | HTTP request | Description - [FunctionTypeDefinition](docs/FunctionTypeDefinition.md) - [FunctionsDetailResponse](docs/FunctionsDetailResponse.md) - [FunctionsListRename](docs/FunctionsListRename.md) + - [FunctionsProgressOutputBody](docs/FunctionsProgressOutputBody.md) - [GeneratePDFOutputBody](docs/GeneratePDFOutputBody.md) - [GetAdditionalDetailsOutputBody](docs/GetAdditionalDetailsOutputBody.md) - [GetAdditionalDetailsStatusOutputBody](docs/GetAdditionalDetailsStatusOutputBody.md) @@ -617,12 +624,17 @@ Class | Method | HTTP request | Description - [GetAnalysisLogsOutputBody](docs/GetAnalysisLogsOutputBody.md) - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) - [GetCollectionOutputBody](docs/GetCollectionOutputBody.md) + - [GetConfigOutputBody](docs/GetConfigOutputBody.md) - [GetDataTypeHistoryBody](docs/GetDataTypeHistoryBody.md) + - [GetDieInfoOutputBody](docs/GetDieInfoOutputBody.md) - [GetFunctionSignatureHistoryBody](docs/GetFunctionSignatureHistoryBody.md) - [GetMatchesOutputBody](docs/GetMatchesOutputBody.md) - [GetMatchesStatusOutputBody](docs/GetMatchesStatusOutputBody.md) + - [GetModelsOutputBody](docs/GetModelsOutputBody.md) - [GetProductsOutputBody](docs/GetProductsOutputBody.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) + - [GetRelatedBinariesOutputBody](docs/GetRelatedBinariesOutputBody.md) + - [GetRelatedStatusOutputBody](docs/GetRelatedStatusOutputBody.md) - [GetSubscriptionOutputBody](docs/GetSubscriptionOutputBody.md) - [GetTokensResponse](docs/GetTokensResponse.md) - [HardcodedSecretEvidence](docs/HardcodedSecretEvidence.md) @@ -750,6 +762,7 @@ Class | Method | HTTP request | Description - [RegenerateOutputBody](docs/RegenerateOutputBody.md) - [RegisterUserInputBody](docs/RegisterUserInputBody.md) - [RegistryOperation](docs/RegistryOperation.md) + - [RelatedBinary](docs/RelatedBinary.md) - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) - [RemediationAgentResponse](docs/RemediationAgentResponse.md) - [RemediationResult](docs/RemediationResult.md) @@ -777,6 +790,8 @@ Class | Method | HTTP request | Description - [SandboxTimeout](docs/SandboxTimeout.md) - [ScheduledTaskEntry](docs/ScheduledTaskEntry.md) - [ScrapeThirdPartyConfig](docs/ScrapeThirdPartyConfig.md) + - [ScreenshotEntry](docs/ScreenshotEntry.md) + - [ScreenshotsIndex](docs/ScreenshotsIndex.md) - [SecretsAgentResponse](docs/SecretsAgentResponse.md) - [SectionModel](docs/SectionModel.md) - [SecurityFinding](docs/SecurityFinding.md) diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 119d4a49..771f0157 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -29,6 +29,7 @@ Method | HTTP request | Description [**upload_file**](AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File [**v3_create_analysis**](AnalysesCoreApi.md#v3_create_analysis) | **POST** /v3/analyses | Create an analysis [**v3_get_analysis_auto_unstrip_status**](AnalysesCoreApi.md#v3_get_analysis_auto_unstrip_status) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. +[**v3_get_analysis_functions_progress**](AnalysesCoreApi.md#v3_get_analysis_functions_progress) | **GET** /v3/analyses/{analysis_id}/progress/functions | Get function embedding progress for an analysis. [**v3_get_analysis_logs**](AnalysesCoreApi.md#v3_get_analysis_logs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log [**v3_get_analysis_operation**](AnalysesCoreApi.md#v3_get_analysis_operation) | **GET** /v3/operations/analyses/{analysis_id} | Get an Analysis-creation operation [**v3_get_analysis_strings**](AnalysesCoreApi.md#v3_get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. @@ -2339,6 +2340,99 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_get_analysis_functions_progress** +> FunctionsProgressOutputBody v3_get_analysis_functions_progress(analysis_id) + +Get function embedding progress for an analysis. + +Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.functions_progress_output_body import FunctionsProgressOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get function embedding progress for an analysis. + api_response = api_instance.v3_get_analysis_functions_progress(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis_functions_progress:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_get_analysis_functions_progress: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**FunctionsProgressOutputBody**](FunctionsProgressOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_get_analysis_logs** > GetAnalysisLogsOutputBody v3_get_analysis_logs(analysis_id) diff --git a/docs/ArrayDataType.md b/docs/ArrayDataType.md index 97d9a53c..396a66a3 100644 --- a/docs/ArrayDataType.md +++ b/docs/ArrayDataType.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/BaseDataType.md b/docs/BaseDataType.md index ebfd2983..2ad0713b 100644 --- a/docs/BaseDataType.md +++ b/docs/BaseDataType.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/BinariesApi.md b/docs/BinariesApi.md index 427220f6..92e59b86 100644 --- a/docs/BinariesApi.md +++ b/docs/BinariesApi.md @@ -14,6 +14,9 @@ Method | HTTP request | Description [**get_binary_externals**](BinariesApi.md#get_binary_externals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary [**get_binary_related_status**](BinariesApi.md#get_binary_related_status) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary [**get_related_binaries**](BinariesApi.md#get_related_binaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. +[**v3_get_binary_die_info**](BinariesApi.md#v3_get_binary_die_info) | **GET** /v3/binaries/{binary_id}/die-info | Get Detect It Easy matches for a binary. +[**v3_get_binary_related**](BinariesApi.md#v3_get_binary_related) | **GET** /v3/binaries/{binary_id}/related | Get the binaries related to this one by unpacking. +[**v3_get_binary_related_status**](BinariesApi.md#v3_get_binary_related_status) | **GET** /v3/binaries/{binary_id}/related/status | Get the archive-unpacking status for a binary. [**v3_upload_file**](BinariesApi.md#v3_upload_file) | **POST** /v3/upload | Upload a file. @@ -875,6 +878,285 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_get_binary_die_info** +> GetDieInfoOutputBody v3_get_binary_die_info(binary_id) + +Get Detect It Easy matches for a binary. + +Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_die_info_output_body import GetDieInfoOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.BinariesApi(api_client) + binary_id = 56 # int | Binary ID + + try: + # Get Detect It Easy matches for a binary. + api_response = api_instance.v3_get_binary_die_info(binary_id) + print("The response of BinariesApi->v3_get_binary_die_info:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinariesApi->v3_get_binary_die_info: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| Binary ID | + +### Return type + +[**GetDieInfoOutputBody**](GetDieInfoOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_binary_related** +> GetRelatedBinariesOutputBody v3_get_binary_related(binary_id) + +Get the binaries related to this one by unpacking. + +Returns the binaries unpacked out of this one, and the archive it came out of when it was not uploaded directly. A related binary that has never been analysed carries a null `analysis_id`. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_related_binaries_output_body import GetRelatedBinariesOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.BinariesApi(api_client) + binary_id = 56 # int | Binary ID + + try: + # Get the binaries related to this one by unpacking. + api_response = api_instance.v3_get_binary_related(binary_id) + print("The response of BinariesApi->v3_get_binary_related:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinariesApi->v3_get_binary_related: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| Binary ID | + +### Return type + +[**GetRelatedBinariesOutputBody**](GetRelatedBinariesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_binary_related_status** +> GetRelatedStatusOutputBody v3_get_binary_related_status(binary_id) + +Get the archive-unpacking status for a binary. + +Returns the status of the task that unpacks an archive into its contents, which is what decides whether the related-binary list is still filling up. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_related_status_output_body import GetRelatedStatusOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.BinariesApi(api_client) + binary_id = 56 # int | Binary ID + + try: + # Get the archive-unpacking status for a binary. + api_response = api_instance.v3_get_binary_related_status(binary_id) + print("The response of BinariesApi->v3_get_binary_related_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinariesApi->v3_get_binary_related_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| Binary ID | + +### Return type + +[**GetRelatedStatusOutputBody**](GetRelatedStatusOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_upload_file** > UploadOutputBody v3_upload_file(file, upload_file_type, force_overwrite=force_overwrite) diff --git a/docs/BitfieldDataType.md b/docs/BitfieldDataType.md index a9a73a9b..82807b62 100644 --- a/docs/BitfieldDataType.md +++ b/docs/BitfieldDataType.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/ConfigApi.md b/docs/ConfigApi.md index 3399d82b..ceb9ea14 100644 --- a/docs/ConfigApi.md +++ b/docs/ConfigApi.md @@ -5,6 +5,8 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_config**](ConfigApi.md#get_config) | **GET** /v2/config | Get Config +[**v3_get_config**](ConfigApi.md#v3_get_config) | **GET** /v3/config | Get client configuration. +[**v3_get_models**](ConfigApi.md#v3_get_models) | **GET** /v3/models | Get the models available for analysis. # **get_config** @@ -89,3 +91,170 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_get_config** +> GetConfigOutputBody v3_get_config() + +Get client configuration. + +Returns the settings a client needs to configure itself: where to send users to view results, the largest binary the calling user may submit, and what AI decompilation supports. The size limit reflects the caller's own role and tier. + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_config_output_body import GetConfigOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.ConfigApi(api_client) + + try: + # Get client configuration. + api_response = api_instance.v3_get_config() + print("The response of ConfigApi->v3_get_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConfigApi->v3_get_config: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**GetConfigOutputBody**](GetConfigOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**0** | Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_models** +> GetModelsOutputBody v3_get_models() + +Get the models available for analysis. + +Returns the models a new analysis can be run on, by base name — the architecture and platform variants a model is built for are collapsed into one entry, and models no longer offered are omitted. + +**Error codes:** +- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_models_output_body import GetModelsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.ConfigApi(api_client) + + try: + # Get the models available for analysis. + api_response = api_instance.v3_get_models() + print("The response of ConfigApi->v3_get_models:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConfigApi->v3_get_models: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**GetModelsOutputBody**](GetModelsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/DataTypeEntry.md b/docs/DataTypeEntry.md index cb9b13c1..1e3a777e 100644 --- a/docs/DataTypeEntry.md +++ b/docs/DataTypeEntry.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/DieMatch.md b/docs/DieMatch.md index eb88b3c3..c1727f48 100644 --- a/docs/DieMatch.md +++ b/docs/DieMatch.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | Canonical name of the matched signature/technology (e.g., 'UPX', 'GCC', 'MSVC'). | -**type** | **str** | Category assigned by DIE for the match (e.g., 'compiler', 'packer', 'file'). | -**display** | **str** | Human-readable description from DIE's 'string' field; suitable for UI/logs, not for parsing. | -**version** | **str** | Extracted version string when available; may be empty/None if unknown. | +**display** | **str** | Human-readable description from DIE; suitable for display, not parsing | +**name** | **str** | Canonical name of the matched signature or technology | +**type** | **str** | Category DIE assigns the match, such as compiler, packer or file | +**version** | **str** | Version DIE extracted, empty when it could not determine one | ## Example diff --git a/docs/EnumDataType.md b/docs/EnumDataType.md index 08b2c0a6..56bcbf33 100644 --- a/docs/EnumDataType.md +++ b/docs/EnumDataType.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/FunctionDataType.md b/docs/FunctionDataType.md index 6a39add9..632e224f 100644 --- a/docs/FunctionDataType.md +++ b/docs/FunctionDataType.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/FunctionsAIDecompilationApi.md b/docs/FunctionsAIDecompilationApi.md index 16a058d9..e42c6a29 100644 --- a/docs/FunctionsAIDecompilationApi.md +++ b/docs/FunctionsAIDecompilationApi.md @@ -25,7 +25,7 @@ Method | HTTP request | Description # **create_ai_decompilation** -> CreateAIDecompOutputBody create_ai_decompilation(function_id, temperature=temperature) +> CreateAIDecompOutputBody create_ai_decompilation(function_id, temperature=temperature, type_suggestions=type_suggestions) Start AI decompilation @@ -76,10 +76,11 @@ with revengai.ApiClient(configuration) as api_client: api_instance = revengai.FunctionsAIDecompilationApi(api_client) function_id = 56 # int | Function ID temperature = -1 # float | LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. (optional) (default to -1) + type_suggestions = True # bool | Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. (optional) (default to True) try: # Start AI decompilation - api_response = api_instance.create_ai_decompilation(function_id, temperature=temperature) + api_response = api_instance.create_ai_decompilation(function_id, temperature=temperature, type_suggestions=type_suggestions) print("The response of FunctionsAIDecompilationApi->create_ai_decompilation:\n") pprint(api_response) except Exception as e: @@ -95,6 +96,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **function_id** | **int**| Function ID | **temperature** | **float**| LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. | [optional] [default to -1] + **type_suggestions** | **bool**| Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. | [optional] [default to True] ### Return type diff --git a/docs/FunctionsProgressOutputBody.md b/docs/FunctionsProgressOutputBody.md new file mode 100644 index 00000000..3887cea6 --- /dev/null +++ b/docs/FunctionsProgressOutputBody.md @@ -0,0 +1,31 @@ +# FunctionsProgressOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_embeddings_count** | **int** | Functions whose embedding has been written back | +**functions_count** | **int** | Functions found in the analysis | +**percentage_completed** | **float** | Embeddings as a percentage of functions, to 2 decimal places. 0 when the analysis has no functions | + +## Example + +```python +from revengai.models.functions_progress_output_body import FunctionsProgressOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionsProgressOutputBody from a JSON string +functions_progress_output_body_instance = FunctionsProgressOutputBody.from_json(json) +# print the JSON string representation of the object +print(FunctionsProgressOutputBody.to_json()) + +# convert the object into a dict +functions_progress_output_body_dict = functions_progress_output_body_instance.to_dict() +# create an instance of FunctionsProgressOutputBody from a dict +functions_progress_output_body_from_dict = FunctionsProgressOutputBody.from_dict(functions_progress_output_body_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/GetConfigOutputBody.md b/docs/GetConfigOutputBody.md new file mode 100644 index 00000000..2c19fcb4 --- /dev/null +++ b/docs/GetConfigOutputBody.md @@ -0,0 +1,30 @@ +# GetConfigOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ai_decompiler_unsupported_languages** | **List[str]** | Source languages AI decompilation does not support | +**max_file_size_bytes** | **int** | Largest binary the calling user may submit for analysis, in bytes | + +## Example + +```python +from revengai.models.get_config_output_body import GetConfigOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetConfigOutputBody from a JSON string +get_config_output_body_instance = GetConfigOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetConfigOutputBody.to_json()) + +# convert the object into a dict +get_config_output_body_dict = get_config_output_body_instance.to_dict() +# create an instance of GetConfigOutputBody from a dict +get_config_output_body_from_dict = GetConfigOutputBody.from_dict(get_config_output_body_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/GetDieInfoOutputBody.md b/docs/GetDieInfoOutputBody.md new file mode 100644 index 00000000..8805c4c6 --- /dev/null +++ b/docs/GetDieInfoOutputBody.md @@ -0,0 +1,29 @@ +# GetDieInfoOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**matches** | [**List[DieMatch]**](DieMatch.md) | Signatures Detect It Easy recognised in the binary | + +## Example + +```python +from revengai.models.get_die_info_output_body import GetDieInfoOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDieInfoOutputBody from a JSON string +get_die_info_output_body_instance = GetDieInfoOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetDieInfoOutputBody.to_json()) + +# convert the object into a dict +get_die_info_output_body_dict = get_die_info_output_body_instance.to_dict() +# create an instance of GetDieInfoOutputBody from a dict +get_die_info_output_body_from_dict = GetDieInfoOutputBody.from_dict(get_die_info_output_body_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/GetModelsOutputBody.md b/docs/GetModelsOutputBody.md new file mode 100644 index 00000000..5397cd59 --- /dev/null +++ b/docs/GetModelsOutputBody.md @@ -0,0 +1,29 @@ +# GetModelsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**models** | **List[str]** | Models a new analysis may be run on | + +## Example + +```python +from revengai.models.get_models_output_body import GetModelsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetModelsOutputBody from a JSON string +get_models_output_body_instance = GetModelsOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetModelsOutputBody.to_json()) + +# convert the object into a dict +get_models_output_body_dict = get_models_output_body_instance.to_dict() +# create an instance of GetModelsOutputBody from a dict +get_models_output_body_from_dict = GetModelsOutputBody.from_dict(get_models_output_body_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/GetRelatedBinariesOutputBody.md b/docs/GetRelatedBinariesOutputBody.md new file mode 100644 index 00000000..41fffe7f --- /dev/null +++ b/docs/GetRelatedBinariesOutputBody.md @@ -0,0 +1,30 @@ +# GetRelatedBinariesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**children** | [**List[RelatedBinary]**](RelatedBinary.md) | Binaries unpacked out of this one | +**parent** | [**RelatedBinary**](RelatedBinary.md) | Archive this binary was unpacked from, null when it was uploaded directly | + +## Example + +```python +from revengai.models.get_related_binaries_output_body import GetRelatedBinariesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetRelatedBinariesOutputBody from a JSON string +get_related_binaries_output_body_instance = GetRelatedBinariesOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetRelatedBinariesOutputBody.to_json()) + +# convert the object into a dict +get_related_binaries_output_body_dict = get_related_binaries_output_body_instance.to_dict() +# create an instance of GetRelatedBinariesOutputBody from a dict +get_related_binaries_output_body_from_dict = GetRelatedBinariesOutputBody.from_dict(get_related_binaries_output_body_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/GetRelatedStatusOutputBody.md b/docs/GetRelatedStatusOutputBody.md new file mode 100644 index 00000000..a37efd50 --- /dev/null +++ b/docs/GetRelatedStatusOutputBody.md @@ -0,0 +1,29 @@ +# GetRelatedStatusOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Status of the task that unpacks an archive into its contents | + +## Example + +```python +from revengai.models.get_related_status_output_body import GetRelatedStatusOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetRelatedStatusOutputBody from a JSON string +get_related_status_output_body_instance = GetRelatedStatusOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetRelatedStatusOutputBody.to_json()) + +# convert the object into a dict +get_related_status_output_body_dict = get_related_status_output_body_instance.to_dict() +# create an instance of GetRelatedStatusOutputBody from a dict +get_related_status_output_body_from_dict = GetRelatedStatusOutputBody.from_dict(get_related_status_output_body_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/PointerDataType.md b/docs/PointerDataType.md index 01e56d17..532bf9e3 100644 --- a/docs/PointerDataType.md +++ b/docs/PointerDataType.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/RelatedBinary.md b/docs/RelatedBinary.md new file mode 100644 index 00000000..a541ad27 --- /dev/null +++ b/docs/RelatedBinary.md @@ -0,0 +1,32 @@ +# RelatedBinary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | Most recent analysis of the related binary, null when it has never been analysed | +**binary_id** | **int** | ID of the related binary | +**name** | **str** | Name of the related binary | +**sha256** | **str** | SHA-256 of the related binary | + +## Example + +```python +from revengai.models.related_binary import RelatedBinary + +# TODO update the JSON string below +json = "{}" +# create an instance of RelatedBinary from a JSON string +related_binary_instance = RelatedBinary.from_json(json) +# print the JSON string representation of the object +print(RelatedBinary.to_json()) + +# convert the object into a dict +related_binary_dict = related_binary_instance.to_dict() +# create an instance of RelatedBinary from a dict +related_binary_from_dict = RelatedBinary.from_dict(related_binary_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/ScreenshotEntry.md b/docs/ScreenshotEntry.md new file mode 100644 index 00000000..8f84c8a4 --- /dev/null +++ b/docs/ScreenshotEntry.md @@ -0,0 +1,29 @@ +# ScreenshotEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **int** | | + +## Example + +```python +from revengai.models.screenshot_entry import ScreenshotEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ScreenshotEntry from a JSON string +screenshot_entry_instance = ScreenshotEntry.from_json(json) +# print the JSON string representation of the object +print(ScreenshotEntry.to_json()) + +# convert the object into a dict +screenshot_entry_dict = screenshot_entry_instance.to_dict() +# create an instance of ScreenshotEntry from a dict +screenshot_entry_from_dict = ScreenshotEntry.from_dict(screenshot_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/ScreenshotsIndex.md b/docs/ScreenshotsIndex.md new file mode 100644 index 00000000..ee3ca408 --- /dev/null +++ b/docs/ScreenshotsIndex.md @@ -0,0 +1,30 @@ +# ScreenshotsIndex + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | +**screenshots** | [**List[ScreenshotEntry]**](ScreenshotEntry.md) | | + +## Example + +```python +from revengai.models.screenshots_index import ScreenshotsIndex + +# TODO update the JSON string below +json = "{}" +# create an instance of ScreenshotsIndex from a JSON string +screenshots_index_instance = ScreenshotsIndex.from_json(json) +# print the JSON string representation of the object +print(ScreenshotsIndex.to_json()) + +# convert the object into a dict +screenshots_index_dict = screenshots_index_instance.to_dict() +# create an instance of ScreenshotsIndex from a dict +screenshots_index_from_dict = ScreenshotsIndex.from_dict(screenshots_index_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/StructDataType.md b/docs/StructDataType.md index 550a1dc1..b3cf9f49 100644 --- a/docs/StructDataType.md +++ b/docs/StructDataType.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/TypedefDataType.md b/docs/TypedefDataType.md index 185f6ea4..cad5678f 100644 --- a/docs/TypedefDataType.md +++ b/docs/TypedefDataType.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/UnionDataType.md b/docs/UnionDataType.md index e1b76089..16a67d4a 100644 --- a/docs/UnionDataType.md +++ b/docs/UnionDataType.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/docs/UnknownDataType.md b/docs/UnknownDataType.md index 9c42f80c..12fb0739 100644 --- a/docs/UnknownDataType.md +++ b/docs/UnknownDataType.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **name** | **str** | Type name. | **namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | **size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, when it could be resolved. | [optional] **source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] **source_type** | **str** | Where this type came from. | diff --git a/revengai/__init__.py b/revengai/__init__.py index 439faea2..8518749c 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v4.46.0" +__version__ = "v4.51.0" # Define package exports __all__ = [ @@ -401,6 +401,7 @@ "FunctionTypeDefinition", "FunctionsDetailResponse", "FunctionsListRename", + "FunctionsProgressOutputBody", "GeneratePDFOutputBody", "GetAdditionalDetailsOutputBody", "GetAdditionalDetailsStatusOutputBody", @@ -408,12 +409,17 @@ "GetAnalysisLogsOutputBody", "GetAnalysisStringsStatusOutputBody", "GetCollectionOutputBody", + "GetConfigOutputBody", "GetDataTypeHistoryBody", + "GetDieInfoOutputBody", "GetFunctionSignatureHistoryBody", "GetMatchesOutputBody", "GetMatchesStatusOutputBody", + "GetModelsOutputBody", "GetProductsOutputBody", "GetPublicUserResponse", + "GetRelatedBinariesOutputBody", + "GetRelatedStatusOutputBody", "GetSubscriptionOutputBody", "GetTokensResponse", "HardcodedSecretEvidence", @@ -541,6 +547,7 @@ "RegenerateOutputBody", "RegisterUserInputBody", "RegistryOperation", + "RelatedBinary", "RelativeBinaryResponse", "RemediationAgentResponse", "RemediationResult", @@ -568,6 +575,8 @@ "SandboxTimeout", "ScheduledTaskEntry", "ScrapeThirdPartyConfig", + "ScreenshotEntry", + "ScreenshotsIndex", "SecretsAgentResponse", "SectionModel", "SecurityFinding", @@ -1105,6 +1114,7 @@ from revengai.models.function_type_definition import FunctionTypeDefinition as FunctionTypeDefinition from revengai.models.functions_detail_response import FunctionsDetailResponse as FunctionsDetailResponse from revengai.models.functions_list_rename import FunctionsListRename as FunctionsListRename +from revengai.models.functions_progress_output_body import FunctionsProgressOutputBody as FunctionsProgressOutputBody from revengai.models.generate_pdf_output_body import GeneratePDFOutputBody as GeneratePDFOutputBody from revengai.models.get_additional_details_output_body import GetAdditionalDetailsOutputBody as GetAdditionalDetailsOutputBody from revengai.models.get_additional_details_status_output_body import GetAdditionalDetailsStatusOutputBody as GetAdditionalDetailsStatusOutputBody @@ -1112,12 +1122,17 @@ from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody as GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody as GetAnalysisStringsStatusOutputBody from revengai.models.get_collection_output_body import GetCollectionOutputBody as GetCollectionOutputBody +from revengai.models.get_config_output_body import GetConfigOutputBody as GetConfigOutputBody from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody as GetDataTypeHistoryBody +from revengai.models.get_die_info_output_body import GetDieInfoOutputBody as GetDieInfoOutputBody from revengai.models.get_function_signature_history_body import GetFunctionSignatureHistoryBody as GetFunctionSignatureHistoryBody from revengai.models.get_matches_output_body import GetMatchesOutputBody as GetMatchesOutputBody from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody as GetMatchesStatusOutputBody +from revengai.models.get_models_output_body import GetModelsOutputBody as GetModelsOutputBody from revengai.models.get_products_output_body import GetProductsOutputBody as GetProductsOutputBody from revengai.models.get_public_user_response import GetPublicUserResponse as GetPublicUserResponse +from revengai.models.get_related_binaries_output_body import GetRelatedBinariesOutputBody as GetRelatedBinariesOutputBody +from revengai.models.get_related_status_output_body import GetRelatedStatusOutputBody as GetRelatedStatusOutputBody from revengai.models.get_subscription_output_body import GetSubscriptionOutputBody as GetSubscriptionOutputBody from revengai.models.get_tokens_response import GetTokensResponse as GetTokensResponse from revengai.models.hardcoded_secret_evidence import HardcodedSecretEvidence as HardcodedSecretEvidence @@ -1245,6 +1260,7 @@ from revengai.models.regenerate_output_body import RegenerateOutputBody as RegenerateOutputBody from revengai.models.register_user_input_body import RegisterUserInputBody as RegisterUserInputBody from revengai.models.registry_operation import RegistryOperation as RegistryOperation +from revengai.models.related_binary import RelatedBinary as RelatedBinary from revengai.models.relative_binary_response import RelativeBinaryResponse as RelativeBinaryResponse from revengai.models.remediation_agent_response import RemediationAgentResponse as RemediationAgentResponse from revengai.models.remediation_result import RemediationResult as RemediationResult @@ -1272,6 +1288,8 @@ from revengai.models.sandbox_timeout import SandboxTimeout as SandboxTimeout from revengai.models.scheduled_task_entry import ScheduledTaskEntry as ScheduledTaskEntry from revengai.models.scrape_third_party_config import ScrapeThirdPartyConfig as ScrapeThirdPartyConfig +from revengai.models.screenshot_entry import ScreenshotEntry as ScreenshotEntry +from revengai.models.screenshots_index import ScreenshotsIndex as ScreenshotsIndex from revengai.models.secrets_agent_response import SecretsAgentResponse as SecretsAgentResponse from revengai.models.section_model import SectionModel as SectionModel from revengai.models.security_finding import SecurityFinding as SecurityFinding diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 67be52b1..0bbdfdb5 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -42,6 +42,7 @@ from revengai.models.create_request import CreateRequest from revengai.models.dynamic_execution_status import DynamicExecutionStatus from revengai.models.dynamic_execution_status_response import DynamicExecutionStatusResponse +from revengai.models.functions_progress_output_body import FunctionsProgressOutputBody from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody from revengai.models.get_matches_output_body import GetMatchesOutputBody @@ -7409,6 +7410,280 @@ def _v3_get_analysis_auto_unstrip_status_serialize( + @validate_call + def v3_get_analysis_functions_progress( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FunctionsProgressOutputBody: + """Get function embedding progress for an analysis. + + Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_functions_progress_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionsProgressOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_analysis_functions_progress_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FunctionsProgressOutputBody]: + """Get function embedding progress for an analysis. + + Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_functions_progress_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionsProgressOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_analysis_functions_progress_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get function embedding progress for an analysis. + + Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_functions_progress_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionsProgressOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_analysis_functions_progress_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/progress/functions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_get_analysis_logs( self, diff --git a/revengai/api/binaries_api.py b/revengai/api/binaries_api.py index cb1b26d8..d4c30b10 100644 --- a/revengai/api/binaries_api.py +++ b/revengai/api/binaries_api.py @@ -27,6 +27,9 @@ from revengai.models.base_response_list_die_match import BaseResponseListDieMatch from revengai.models.get_additional_details_output_body import GetAdditionalDetailsOutputBody from revengai.models.get_additional_details_status_output_body import GetAdditionalDetailsStatusOutputBody +from revengai.models.get_die_info_output_body import GetDieInfoOutputBody +from revengai.models.get_related_binaries_output_body import GetRelatedBinariesOutputBody +from revengai.models.get_related_status_output_body import GetRelatedStatusOutputBody from revengai.models.upload_output_body import UploadOutputBody from revengai.api_client import ApiClient, RequestSerialized @@ -2701,6 +2704,828 @@ def _get_related_binaries_serialize( + @validate_call + def v3_get_binary_die_info( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetDieInfoOutputBody: + """Get Detect It Easy matches for a binary. + + Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_die_info_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDieInfoOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_binary_die_info_with_http_info( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetDieInfoOutputBody]: + """Get Detect It Easy matches for a binary. + + Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_die_info_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDieInfoOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_binary_die_info_without_preload_content( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Detect It Easy matches for a binary. + + Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_die_info_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDieInfoOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_binary_die_info_serialize( + self, + binary_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if binary_id is not None: + _path_params['binary_id'] = binary_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/binaries/{binary_id}/die-info', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_get_binary_related( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetRelatedBinariesOutputBody: + """Get the binaries related to this one by unpacking. + + Returns the binaries unpacked out of this one, and the archive it came out of when it was not uploaded directly. A related binary that has never been analysed carries a null `analysis_id`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_related_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetRelatedBinariesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_binary_related_with_http_info( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetRelatedBinariesOutputBody]: + """Get the binaries related to this one by unpacking. + + Returns the binaries unpacked out of this one, and the archive it came out of when it was not uploaded directly. A related binary that has never been analysed carries a null `analysis_id`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_related_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetRelatedBinariesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_binary_related_without_preload_content( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the binaries related to this one by unpacking. + + Returns the binaries unpacked out of this one, and the archive it came out of when it was not uploaded directly. A related binary that has never been analysed carries a null `analysis_id`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_related_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetRelatedBinariesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_binary_related_serialize( + self, + binary_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if binary_id is not None: + _path_params['binary_id'] = binary_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/binaries/{binary_id}/related', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_get_binary_related_status( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetRelatedStatusOutputBody: + """Get the archive-unpacking status for a binary. + + Returns the status of the task that unpacks an archive into its contents, which is what decides whether the related-binary list is still filling up. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_related_status_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetRelatedStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_binary_related_status_with_http_info( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetRelatedStatusOutputBody]: + """Get the archive-unpacking status for a binary. + + Returns the status of the task that unpacks an archive into its contents, which is what decides whether the related-binary list is still filling up. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_related_status_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetRelatedStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_binary_related_status_without_preload_content( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the archive-unpacking status for a binary. + + Returns the status of the task that unpacks an archive into its contents, which is what decides whether the related-binary list is still filling up. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: Binary ID (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_related_status_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetRelatedStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_binary_related_status_serialize( + self, + binary_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if binary_id is not None: + _path_params['binary_id'] = binary_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/binaries/{binary_id}/related/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_upload_file( self, diff --git a/revengai/api/config_api.py b/revengai/api/config_api.py index c5be2b1b..f6c8ac89 100644 --- a/revengai/api/config_api.py +++ b/revengai/api/config_api.py @@ -16,6 +16,8 @@ from typing_extensions import Annotated from revengai.models.base_response_config_response import BaseResponseConfigResponse +from revengai.models.get_config_output_body import GetConfigOutputBody +from revengai.models.get_models_output_body import GetModelsOutputBody from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -283,3 +285,500 @@ def _get_config_serialize( ) + + + @validate_call + def v3_get_config( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetConfigOutputBody: + """Get client configuration. + + Returns the settings a client needs to configure itself: where to send users to view results, the largest binary the calling user may submit, and what AI decompilation supports. The size limit reflects the caller's own role and tier. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetConfigOutputBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_config_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetConfigOutputBody]: + """Get client configuration. + + Returns the settings a client needs to configure itself: where to send users to view results, the largest binary the calling user may submit, and what AI decompilation supports. The size limit reflects the caller's own role and tier. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetConfigOutputBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_config_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get client configuration. + + Returns the settings a client needs to configure itself: where to send users to view results, the largest binary the calling user may submit, and what AI decompilation supports. The size limit reflects the caller's own role and tier. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetConfigOutputBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_config_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/config', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_get_models( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetModelsOutputBody: + """Get the models available for analysis. + + Returns the models a new analysis can be run on, by base name — the architecture and platform variants a model is built for are collapsed into one entry, and models no longer offered are omitted. **Error codes:** - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetModelsOutputBody", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_models_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetModelsOutputBody]: + """Get the models available for analysis. + + Returns the models a new analysis can be run on, by base name — the architecture and platform variants a model is built for are collapsed into one entry, and models no longer offered are omitted. **Error codes:** - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetModelsOutputBody", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_models_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the models available for analysis. + + Returns the models a new analysis can be run on, by base name — the architecture and platform variants a model is built for are collapsed into one entry, and models no longer offered are omitted. **Error codes:** - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetModelsOutputBody", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_models_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/models', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/revengai/api/functions_ai_decompilation_api.py b/revengai/api/functions_ai_decompilation_api.py index 2df3b606..9e930dcc 100644 --- a/revengai/api/functions_ai_decompilation_api.py +++ b/revengai/api/functions_ai_decompilation_api.py @@ -15,7 +15,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt +from pydantic import Field, StrictBool, StrictInt from typing import List, Optional, Union from typing_extensions import Annotated from revengai.models.base_response import BaseResponse @@ -58,6 +58,7 @@ def create_ai_decompilation( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], temperature: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=-1)], Annotated[int, Field(le=1, strict=True, ge=-1)]]], Field(description="LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default.")] = None, + type_suggestions: Annotated[Optional[StrictBool], Field(description="Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -79,6 +80,8 @@ def create_ai_decompilation( :type function_id: int :param temperature: LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. :type temperature: float + :param type_suggestions: Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. + :type type_suggestions: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -104,6 +107,7 @@ def create_ai_decompilation( _param = self._create_ai_decompilation_serialize( function_id=function_id, temperature=temperature, + type_suggestions=type_suggestions, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -135,6 +139,7 @@ def create_ai_decompilation_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], temperature: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=-1)], Annotated[int, Field(le=1, strict=True, ge=-1)]]], Field(description="LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default.")] = None, + type_suggestions: Annotated[Optional[StrictBool], Field(description="Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -156,6 +161,8 @@ def create_ai_decompilation_with_http_info( :type function_id: int :param temperature: LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. :type temperature: float + :param type_suggestions: Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. + :type type_suggestions: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -181,6 +188,7 @@ def create_ai_decompilation_with_http_info( _param = self._create_ai_decompilation_serialize( function_id=function_id, temperature=temperature, + type_suggestions=type_suggestions, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -212,6 +220,7 @@ def create_ai_decompilation_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], temperature: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=-1)], Annotated[int, Field(le=1, strict=True, ge=-1)]]], Field(description="LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default.")] = None, + type_suggestions: Annotated[Optional[StrictBool], Field(description="Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -233,6 +242,8 @@ def create_ai_decompilation_without_preload_content( :type function_id: int :param temperature: LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. :type temperature: float + :param type_suggestions: Ask the language model to name the suggested types and their members. Set to false to skip the model call; the statically derived layouts are still computed and stored. Cannot re-enable the pass when the server has it off. + :type type_suggestions: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -258,6 +269,7 @@ def create_ai_decompilation_without_preload_content( _param = self._create_ai_decompilation_serialize( function_id=function_id, temperature=temperature, + type_suggestions=type_suggestions, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -284,6 +296,7 @@ def _create_ai_decompilation_serialize( self, function_id, temperature, + type_suggestions, _request_auth, _content_type, _headers, @@ -312,6 +325,10 @@ def _create_ai_decompilation_serialize( _query_params.append(('temperature', temperature)) + if type_suggestions is not None: + + _query_params.append(('type_suggestions', type_suggestions)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/revengai/api_client.py b/revengai/api_client.py index 00168615..83c0b524 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/v4.46.0/python' + self.user_agent = 'OpenAPI-Generator/v4.51.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 9cef5523..7e8abcb5 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -541,8 +541,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v4.46.0\n"\ - "SDK Package Version: v4.46.0".\ + "Version of the API: v4.51.0\n"\ + "SDK Package Version: v4.51.0".\ 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 d39d8dc5..bc7b1ee1 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -367,6 +367,7 @@ from revengai.models.function_type_definition import FunctionTypeDefinition from revengai.models.functions_detail_response import FunctionsDetailResponse from revengai.models.functions_list_rename import FunctionsListRename +from revengai.models.functions_progress_output_body import FunctionsProgressOutputBody from revengai.models.generate_pdf_output_body import GeneratePDFOutputBody from revengai.models.get_additional_details_output_body import GetAdditionalDetailsOutputBody from revengai.models.get_additional_details_status_output_body import GetAdditionalDetailsStatusOutputBody @@ -374,12 +375,17 @@ from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody from revengai.models.get_collection_output_body import GetCollectionOutputBody +from revengai.models.get_config_output_body import GetConfigOutputBody from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody +from revengai.models.get_die_info_output_body import GetDieInfoOutputBody from revengai.models.get_function_signature_history_body import GetFunctionSignatureHistoryBody from revengai.models.get_matches_output_body import GetMatchesOutputBody from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody +from revengai.models.get_models_output_body import GetModelsOutputBody from revengai.models.get_products_output_body import GetProductsOutputBody from revengai.models.get_public_user_response import GetPublicUserResponse +from revengai.models.get_related_binaries_output_body import GetRelatedBinariesOutputBody +from revengai.models.get_related_status_output_body import GetRelatedStatusOutputBody from revengai.models.get_subscription_output_body import GetSubscriptionOutputBody from revengai.models.get_tokens_response import GetTokensResponse from revengai.models.hardcoded_secret_evidence import HardcodedSecretEvidence @@ -507,6 +513,7 @@ from revengai.models.regenerate_output_body import RegenerateOutputBody from revengai.models.register_user_input_body import RegisterUserInputBody from revengai.models.registry_operation import RegistryOperation +from revengai.models.related_binary import RelatedBinary from revengai.models.relative_binary_response import RelativeBinaryResponse from revengai.models.remediation_agent_response import RemediationAgentResponse from revengai.models.remediation_result import RemediationResult @@ -534,6 +541,8 @@ from revengai.models.sandbox_timeout import SandboxTimeout from revengai.models.scheduled_task_entry import ScheduledTaskEntry from revengai.models.scrape_third_party_config import ScrapeThirdPartyConfig +from revengai.models.screenshot_entry import ScreenshotEntry +from revengai.models.screenshots_index import ScreenshotsIndex from revengai.models.secrets_agent_response import SecretsAgentResponse from revengai.models.section_model import SectionModel from revengai.models.security_finding import SecurityFinding diff --git a/revengai/models/array_data_type.py b/revengai/models/array_data_type.py index 39fd7dcf..05b4db48 100644 --- a/revengai/models/array_data_type.py +++ b/revengai/models/array_data_type.py @@ -35,10 +35,11 @@ class ArrayDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -123,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/base_data_type.py b/revengai/models/base_data_type.py index 17ef7fa9..cd911c5b 100644 --- a/revengai/models/base_data_type.py +++ b/revengai/models/base_data_type.py @@ -33,10 +33,11 @@ class BaseDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -117,6 +118,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/bitfield_data_type.py b/revengai/models/bitfield_data_type.py index 34a8d61c..e4fee285 100644 --- a/revengai/models/bitfield_data_type.py +++ b/revengai/models/bitfield_data_type.py @@ -33,10 +33,11 @@ class BitfieldDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -117,6 +118,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/die_match.py b/revengai/models/die_match.py index 690b3457..53fd7b71 100644 --- a/revengai/models/die_match.py +++ b/revengai/models/die_match.py @@ -25,12 +25,12 @@ class DieMatch(BaseModel): """ DieMatch """ # noqa: E501 - name: StrictStr = Field(description="Canonical name of the matched signature/technology (e.g., 'UPX', 'GCC', 'MSVC').") - type: StrictStr = Field(description="Category assigned by DIE for the match (e.g., 'compiler', 'packer', 'file').") - display: StrictStr = Field(description="Human-readable description from DIE's 'string' field; suitable for UI/logs, not for parsing.") - version: StrictStr = Field(description="Extracted version string when available; may be empty/None if unknown.") + display: StrictStr = Field(description="Human-readable description from DIE; suitable for display, not parsing") + name: StrictStr = Field(description="Canonical name of the matched signature or technology") + type: StrictStr = Field(description="Category DIE assigns the match, such as compiler, packer or file") + version: StrictStr = Field(description="Version DIE extracted, empty when it could not determine one") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "type", "display", "version"] + __properties: ClassVar[List[str]] = ["display", "name", "type", "version"] model_config = ConfigDict( populate_by_name=True, @@ -90,9 +90,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "display": obj.get("display"), "name": obj.get("name"), "type": obj.get("type"), - "display": obj.get("display"), "version": obj.get("version") }) # store additional fields in additional_properties diff --git a/revengai/models/enum_data_type.py b/revengai/models/enum_data_type.py index e3a355af..02d03de0 100644 --- a/revengai/models/enum_data_type.py +++ b/revengai/models/enum_data_type.py @@ -35,10 +35,11 @@ class EnumDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -123,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/function_data_type.py b/revengai/models/function_data_type.py index 9d78264f..ed2f6a9f 100644 --- a/revengai/models/function_data_type.py +++ b/revengai/models/function_data_type.py @@ -35,10 +35,11 @@ class FunctionDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -123,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/functions_progress_output_body.py b/revengai/models/functions_progress_output_body.py new file mode 100644 index 00000000..1b484db4 --- /dev/null +++ b/revengai/models/functions_progress_output_body.py @@ -0,0 +1,103 @@ +# 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, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class FunctionsProgressOutputBody(BaseModel): + """ + FunctionsProgressOutputBody + """ # noqa: E501 + function_embeddings_count: StrictInt = Field(description="Functions whose embedding has been written back") + functions_count: StrictInt = Field(description="Functions found in the analysis") + percentage_completed: Union[StrictFloat, StrictInt] = Field(description="Embeddings as a percentage of functions, to 2 decimal places. 0 when the analysis has no functions") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["function_embeddings_count", "functions_count", "percentage_completed"] + + 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 FunctionsProgressOutputBody 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 + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionsProgressOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "function_embeddings_count": obj.get("function_embeddings_count"), + "functions_count": obj.get("functions_count"), + "percentage_completed": obj.get("percentage_completed") + }) + # 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/get_config_output_body.py b/revengai/models/get_config_output_body.py new file mode 100644 index 00000000..e20a4d44 --- /dev/null +++ b/revengai/models/get_config_output_body.py @@ -0,0 +1,106 @@ +# 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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class GetConfigOutputBody(BaseModel): + """ + GetConfigOutputBody + """ # noqa: E501 + ai_decompiler_unsupported_languages: Optional[List[StrictStr]] = Field(description="Source languages AI decompilation does not support") + max_file_size_bytes: StrictInt = Field(description="Largest binary the calling user may submit for analysis, in bytes") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["ai_decompiler_unsupported_languages", "max_file_size_bytes"] + + 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 GetConfigOutputBody 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 ai_decompiler_unsupported_languages (nullable) is None + # and model_fields_set contains the field + if self.ai_decompiler_unsupported_languages is None and "ai_decompiler_unsupported_languages" in self.model_fields_set: + _dict['ai_decompiler_unsupported_languages'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetConfigOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ai_decompiler_unsupported_languages": obj.get("ai_decompiler_unsupported_languages"), + "max_file_size_bytes": obj.get("max_file_size_bytes") + }) + # 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/get_die_info_output_body.py b/revengai/models/get_die_info_output_body.py new file mode 100644 index 00000000..f736310d --- /dev/null +++ b/revengai/models/get_die_info_output_body.py @@ -0,0 +1,112 @@ +# 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, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.die_match import DieMatch +from typing import Optional, Set +from typing_extensions import Self + +class GetDieInfoOutputBody(BaseModel): + """ + GetDieInfoOutputBody + """ # noqa: E501 + matches: Optional[List[DieMatch]] = Field(description="Signatures Detect It Easy recognised in the binary") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["matches"] + + 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 GetDieInfoOutputBody 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in matches (list) + _items = [] + if self.matches: + for _item_matches in self.matches: + if _item_matches: + _items.append(_item_matches.to_dict()) + _dict['matches'] = _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 matches (nullable) is None + # and model_fields_set contains the field + if self.matches is None and "matches" in self.model_fields_set: + _dict['matches'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetDieInfoOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "matches": [DieMatch.from_dict(_item) for _item in obj["matches"]] if obj.get("matches") is not None else None + }) + # 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/get_models_output_body.py b/revengai/models/get_models_output_body.py new file mode 100644 index 00000000..a11f4ac2 --- /dev/null +++ b/revengai/models/get_models_output_body.py @@ -0,0 +1,104 @@ +# 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, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class GetModelsOutputBody(BaseModel): + """ + GetModelsOutputBody + """ # noqa: E501 + models: Optional[List[StrictStr]] = Field(description="Models a new analysis may be run on") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["models"] + + 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 GetModelsOutputBody 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 models (nullable) is None + # and model_fields_set contains the field + if self.models is None and "models" in self.model_fields_set: + _dict['models'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetModelsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "models": obj.get("models") + }) + # 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/get_related_binaries_output_body.py b/revengai/models/get_related_binaries_output_body.py new file mode 100644 index 00000000..782e55a4 --- /dev/null +++ b/revengai/models/get_related_binaries_output_body.py @@ -0,0 +1,117 @@ +# 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, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.related_binary import RelatedBinary +from typing import Optional, Set +from typing_extensions import Self + +class GetRelatedBinariesOutputBody(BaseModel): + """ + GetRelatedBinariesOutputBody + """ # noqa: E501 + children: Optional[List[RelatedBinary]] = Field(description="Binaries unpacked out of this one") + parent: RelatedBinary = Field(description="Archive this binary was unpacked from, null when it was uploaded directly") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["children", "parent"] + + 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 GetRelatedBinariesOutputBody 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in children (list) + _items = [] + if self.children: + for _item_children in self.children: + if _item_children: + _items.append(_item_children.to_dict()) + _dict['children'] = _items + # override the default output from pydantic by calling `to_dict()` of parent + if self.parent: + _dict['parent'] = self.parent.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 children (nullable) is None + # and model_fields_set contains the field + if self.children is None and "children" in self.model_fields_set: + _dict['children'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetRelatedBinariesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "children": [RelatedBinary.from_dict(_item) for _item in obj["children"]] if obj.get("children") is not None else None, + "parent": RelatedBinary.from_dict(obj["parent"]) if obj.get("parent") is not None else None + }) + # 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/get_related_status_output_body.py b/revengai/models/get_related_status_output_body.py new file mode 100644 index 00000000..81fed0ef --- /dev/null +++ b/revengai/models/get_related_status_output_body.py @@ -0,0 +1,106 @@ +# 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, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GetRelatedStatusOutputBody(BaseModel): + """ + GetRelatedStatusOutputBody + """ # noqa: E501 + status: StrictStr = Field(description="Status of the task that unpacks an archive into its contents") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED', '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 GetRelatedStatusOutputBody 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 + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetRelatedStatusOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") + }) + # 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/pointer_data_type.py b/revengai/models/pointer_data_type.py index c3d736ec..6e3dd796 100644 --- a/revengai/models/pointer_data_type.py +++ b/revengai/models/pointer_data_type.py @@ -35,10 +35,11 @@ class PointerDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -123,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/related_binary.py b/revengai/models/related_binary.py new file mode 100644 index 00000000..76f95659 --- /dev/null +++ b/revengai/models/related_binary.py @@ -0,0 +1,110 @@ +# 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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RelatedBinary(BaseModel): + """ + RelatedBinary + """ # noqa: E501 + analysis_id: Optional[StrictInt] = Field(description="Most recent analysis of the related binary, null when it has never been analysed") + binary_id: StrictInt = Field(description="ID of the related binary") + name: StrictStr = Field(description="Name of the related binary") + sha256: StrictStr = Field(description="SHA-256 of the related binary") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_id", "binary_id", "name", "sha256"] + + 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 RelatedBinary 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 analysis_id (nullable) is None + # and model_fields_set contains the field + if self.analysis_id is None and "analysis_id" in self.model_fields_set: + _dict['analysis_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RelatedBinary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "analysis_id": obj.get("analysis_id"), + "binary_id": obj.get("binary_id"), + "name": obj.get("name"), + "sha256": obj.get("sha256") + }) + # 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/screenshot_entry.py b/revengai/models/screenshot_entry.py new file mode 100644 index 00000000..aea63c6a --- /dev/null +++ b/revengai/models/screenshot_entry.py @@ -0,0 +1,99 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ScreenshotEntry(BaseModel): + """ + ScreenshotEntry + """ # noqa: E501 + index: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["index"] + + 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 ScreenshotEntry 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 + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScreenshotEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index": obj.get("index") + }) + # 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/screenshots_index.py b/revengai/models/screenshots_index.py new file mode 100644 index 00000000..1fd2fe00 --- /dev/null +++ b/revengai/models/screenshots_index.py @@ -0,0 +1,114 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.screenshot_entry import ScreenshotEntry +from typing import Optional, Set +from typing_extensions import Self + +class ScreenshotsIndex(BaseModel): + """ + ScreenshotsIndex + """ # noqa: E501 + count: StrictInt + screenshots: Optional[List[ScreenshotEntry]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["count", "screenshots"] + + 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 ScreenshotsIndex 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in screenshots (list) + _items = [] + if self.screenshots: + for _item_screenshots in self.screenshots: + if _item_screenshots: + _items.append(_item_screenshots.to_dict()) + _dict['screenshots'] = _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 screenshots (nullable) is None + # and model_fields_set contains the field + if self.screenshots is None and "screenshots" in self.model_fields_set: + _dict['screenshots'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScreenshotsIndex from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count"), + "screenshots": [ScreenshotEntry.from_dict(_item) for _item in obj["screenshots"]] if obj.get("screenshots") is not None else None + }) + # 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/struct_data_type.py b/revengai/models/struct_data_type.py index f69cd0de..d79a4212 100644 --- a/revengai/models/struct_data_type.py +++ b/revengai/models/struct_data_type.py @@ -35,10 +35,11 @@ class StructDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -123,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/typedef_data_type.py b/revengai/models/typedef_data_type.py index 36fd4fa0..53a618a1 100644 --- a/revengai/models/typedef_data_type.py +++ b/revengai/models/typedef_data_type.py @@ -35,10 +35,11 @@ class TypedefDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -123,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/union_data_type.py b/revengai/models/union_data_type.py index 7f940527..c9cabdad 100644 --- a/revengai/models/union_data_type.py +++ b/revengai/models/union_data_type.py @@ -35,10 +35,11 @@ class UnionDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -123,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) diff --git a/revengai/models/unknown_data_type.py b/revengai/models/unknown_data_type.py index 9ddf1ad9..92adf3d5 100644 --- a/revengai/models/unknown_data_type.py +++ b/revengai/models/unknown_data_type.py @@ -33,10 +33,11 @@ class UnknownDataType(BaseModel): name: StrictStr = Field(description="Type name.") namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, when it could be resolved.") source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") source_type: StrictStr = Field(description="Where this type came from.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_analysis_id", "source_function_id", "source_type"] @field_validator('kind') def kind_validate_enum(cls, value): @@ -117,6 +118,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "namespace": obj.get("namespace"), "size": obj.get("size"), + "source_analysis_id": obj.get("source_analysis_id"), "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") })