From 039deb79bbeee9691bf136edc45745f33817a40a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Jul 2026 06:58:30 +0000 Subject: [PATCH] Update SDK to version v3.110.0 - Generated from OpenAPI spec version v3.110.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 8 + docs/AnalysesCoreApi.md | 16 +- docs/ArchiveContentEntry.md | 31 + docs/BatchBinaryMatchResult.md | 1 + docs/FunctionsCoreApi.md | 214 ++++- docs/ImportedFunctionCallerEntry.md | 32 + docs/ImportedFunctionDetailOutputBody.md | 37 + docs/ImportedFunctionEntry.md | 36 + docs/ListArchiveContentsOutputBody.md | 33 + docs/ListImportedFunctionsOutputBody.md | 30 + docs/StartMatchingForAnalysisInputBody.md | 1 + docs/StartMatchingForFunctionsInputBody.md | 1 + docs/StartMatchingOutputBody.md | 1 + docs/TriggerDynamicExecutionInputBody.md | 3 + revengai/__init__.py | 14 +- revengai/api/analyses_core_api.py | 52 +- revengai/api/functions_core_api.py | 763 ++++++++++++++++-- revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/__init__.py | 6 + revengai/models/archive_content_entry.py | 103 +++ revengai/models/batch_binary_match_result.py | 4 +- .../models/imported_function_caller_entry.py | 105 +++ .../imported_function_detail_output_body.py | 133 +++ revengai/models/imported_function_entry.py | 118 +++ .../list_archive_contents_output_body.py | 120 +++ .../list_imported_functions_output_body.py | 114 +++ .../start_matching_for_analysis_input_body.py | 6 +- ...start_matching_for_functions_input_body.py | 4 +- revengai/models/start_matching_output_body.py | 4 +- .../trigger_dynamic_execution_input_body.py | 18 +- 32 files changed, 1922 insertions(+), 94 deletions(-) create mode 100644 docs/ArchiveContentEntry.md create mode 100644 docs/ImportedFunctionCallerEntry.md create mode 100644 docs/ImportedFunctionDetailOutputBody.md create mode 100644 docs/ImportedFunctionEntry.md create mode 100644 docs/ListArchiveContentsOutputBody.md create mode 100644 docs/ListImportedFunctionsOutputBody.md create mode 100644 revengai/models/archive_content_entry.py create mode 100644 revengai/models/imported_function_caller_entry.py create mode 100644 revengai/models/imported_function_detail_output_body.py create mode 100644 revengai/models/imported_function_entry.py create mode 100644 revengai/models/list_archive_contents_output_body.py create mode 100644 revengai/models/list_imported_functions_output_body.py diff --git a/.sdk-version b/.sdk-version index 74fbdf9..498b115 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.107.0 +v3.110.0 diff --git a/README.md b/README.md index 08da3a3..8c8203b 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,9 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**get_functions_callees_callers**](docs/FunctionsCoreApi.md#get_functions_callees_callers) | **GET** /v3/functions/callees-callers | Get callees and callers for many functions *FunctionsCoreApi* | [**get_functions_matches**](docs/FunctionsCoreApi.md#get_functions_matches) | **GET** /v3/functions/matches | Get function-matching results for an explicit set of functions *FunctionsCoreApi* | [**get_functions_matching_status**](docs/FunctionsCoreApi.md#get_functions_matching_status) | **GET** /v3/functions/matches/status | Get function-matching status for an explicit set of functions +*FunctionsCoreApi* | [**get_imported_function**](docs/FunctionsCoreApi.md#get_imported_function) | **GET** /v3/analyses/{analysis_id}/imported-functions/{imported_function_id} | Get an imported function with its callers *FunctionsCoreApi* | [**list_analysis_functions**](docs/FunctionsCoreApi.md#list_analysis_functions) | **GET** /v3/analyses/{analysis_id}/functions | List functions in an analysis +*FunctionsCoreApi* | [**list_imported_functions**](docs/FunctionsCoreApi.md#list_imported_functions) | **GET** /v3/analyses/{analysis_id}/imported-functions | List imported functions in an analysis *FunctionsCoreApi* | [**start_functions_matching**](docs/FunctionsCoreApi.md#start_functions_matching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions *FunctionsDataTypesApi* | [**batch_update_function_data_types**](docs/FunctionsDataTypesApi.md#batch_update_function_data_types) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types *FunctionsDataTypesApi* | [**generate_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_analysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types @@ -251,6 +253,7 @@ Class | Method | HTTP request | Description - [AppApiRestV2FunctionsResponsesFunction](docs/AppApiRestV2FunctionsResponsesFunction.md) - [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md) - [AppApiRestV2InfoTypesCapability](docs/AppApiRestV2InfoTypesCapability.md) + - [ArchiveContentEntry](docs/ArchiveContentEntry.md) - [Argument](docs/Argument.md) - [Artifact](docs/Artifact.md) - [AttemptFailedEvent](docs/AttemptFailedEvent.md) @@ -513,6 +516,9 @@ Class | Method | HTTP request | Description - [ISA](docs/ISA.md) - [IconModel](docs/IconModel.md) - [ImportModel](docs/ImportModel.md) + - [ImportedFunctionCallerEntry](docs/ImportedFunctionCallerEntry.md) + - [ImportedFunctionDetailOutputBody](docs/ImportedFunctionDetailOutputBody.md) + - [ImportedFunctionEntry](docs/ImportedFunctionEntry.md) - [InlineComment](docs/InlineComment.md) - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) - [InviteUserInputBody](docs/InviteUserInputBody.md) @@ -520,11 +526,13 @@ Class | Method | HTTP request | Description - [ListAnalysisFunctionsDataTypesOutputBody](docs/ListAnalysisFunctionsDataTypesOutputBody.md) - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) + - [ListArchiveContentsOutputBody](docs/ListArchiveContentsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) - [ListExampleAnalysesOutputBody](docs/ListExampleAnalysesOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) - [ListFunctionsDataTypesOutputBody](docs/ListFunctionsDataTypesOutputBody.md) + - [ListImportedFunctionsOutputBody](docs/ListImportedFunctionsOutputBody.md) - [ListTeamsOutputBody](docs/ListTeamsOutputBody.md) - [ListUsersOutputBody](docs/ListUsersOutputBody.md) - [LocationOutputBody](docs/LocationOutputBody.md) diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index cd40b82..1e6ffcd 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -666,7 +666,7 @@ 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) # **get_analysis_function_matches** -> GetMatchesOutputBody get_analysis_function_matches(analysis_id) +> GetMatchesOutputBody get_analysis_function_matches(analysis_id, match_id=match_id) Get function-matching results for an analysis @@ -675,6 +675,7 @@ Returns the matches blob when the matching workflow has completed. While the wor **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example @@ -714,10 +715,11 @@ 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 + match_id = 'match_id_example' # str | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) try: # Get function-matching results for an analysis - api_response = api_instance.get_analysis_function_matches(analysis_id) + api_response = api_instance.get_analysis_function_matches(analysis_id, match_id=match_id) print("The response of AnalysesCoreApi->get_analysis_function_matches:\n") pprint(api_response) except Exception as e: @@ -732,6 +734,7 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_id** | **int**| Analysis ID | + **match_id** | **str**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] ### Return type @@ -751,6 +754,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **403** | Forbidden | - | **404** | Not Found | - | **422** | Unprocessable Entity | - | @@ -759,7 +763,7 @@ 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) # **get_analysis_function_matching_status** -> GetMatchesStatusOutputBody get_analysis_function_matching_status(analysis_id) +> GetMatchesStatusOutputBody get_analysis_function_matching_status(analysis_id, match_id=match_id) Get function-matching status for an analysis @@ -768,6 +772,7 @@ Returns the matching workflow's current status. Does not include the matches blo **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example @@ -807,10 +812,11 @@ 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 + match_id = 'match_id_example' # str | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) try: # Get function-matching status for an analysis - api_response = api_instance.get_analysis_function_matching_status(analysis_id) + api_response = api_instance.get_analysis_function_matching_status(analysis_id, match_id=match_id) print("The response of AnalysesCoreApi->get_analysis_function_matching_status:\n") pprint(api_response) except Exception as e: @@ -825,6 +831,7 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_id** | **int**| Analysis ID | + **match_id** | **str**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] ### Return type @@ -844,6 +851,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **403** | Forbidden | - | **404** | Not Found | - | **422** | Unprocessable Entity | - | diff --git a/docs/ArchiveContentEntry.md b/docs/ArchiveContentEntry.md new file mode 100644 index 0000000..7e94d1e --- /dev/null +++ b/docs/ArchiveContentEntry.md @@ -0,0 +1,31 @@ +# ArchiveContentEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**encrypted** | **bool** | Whether this entry is password-protected | +**path** | **str** | Path relative to the archive root | +**size** | **int** | Uncompressed size in bytes | + +## Example + +```python +from revengai.models.archive_content_entry import ArchiveContentEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ArchiveContentEntry from a JSON string +archive_content_entry_instance = ArchiveContentEntry.from_json(json) +# print the JSON string representation of the object +print(ArchiveContentEntry.to_json()) + +# convert the object into a dict +archive_content_entry_dict = archive_content_entry_instance.to_dict() +# create an instance of ArchiveContentEntry from a dict +archive_content_entry_from_dict = ArchiveContentEntry.from_dict(archive_content_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/BatchBinaryMatchResult.md b/docs/BatchBinaryMatchResult.md index 9a439a6..4f5b6f6 100644 --- a/docs/BatchBinaryMatchResult.md +++ b/docs/BatchBinaryMatchResult.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **binary_id** | **int** | Target binary | **error_message** | **str** | Error description when status=FAILED. | [optional] +**match_id** | **str** | Opaque token for this binary's matching run. Present on dispatch and when statuses were fetched by token. | [optional] **matched_function_count** | **int** | Number of source functions that received at least one candidate match. Only meaningful when status=COMPLETED. | **status** | **str** | Per-binary workflow status | diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 9315db3..6c308dc 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -28,7 +28,9 @@ Method | HTTP request | Description [**get_functions_callees_callers**](FunctionsCoreApi.md#get_functions_callees_callers) | **GET** /v3/functions/callees-callers | Get callees and callers for many functions [**get_functions_matches**](FunctionsCoreApi.md#get_functions_matches) | **GET** /v3/functions/matches | Get function-matching results for an explicit set of functions [**get_functions_matching_status**](FunctionsCoreApi.md#get_functions_matching_status) | **GET** /v3/functions/matches/status | Get function-matching status for an explicit set of functions +[**get_imported_function**](FunctionsCoreApi.md#get_imported_function) | **GET** /v3/analyses/{analysis_id}/imported-functions/{imported_function_id} | Get an imported function with its callers [**list_analysis_functions**](FunctionsCoreApi.md#list_analysis_functions) | **GET** /v3/analyses/{analysis_id}/functions | List functions in an analysis +[**list_imported_functions**](FunctionsCoreApi.md#list_imported_functions) | **GET** /v3/analyses/{analysis_id}/imported-functions | List imported functions in an analysis [**start_functions_matching**](FunctionsCoreApi.md#start_functions_matching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions @@ -2017,7 +2019,7 @@ 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) # **get_functions_matches** -> GetMatchesOutputBody get_functions_matches(function_ids) +> GetMatchesOutputBody get_functions_matches(match_id=match_id, function_ids=function_ids) Get function-matching results for an explicit set of functions @@ -2065,11 +2067,12 @@ configuration = revengai.Configuration( with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsCoreApi(api_client) - function_ids = [56] # List[int] | Source function IDs whose matches to fetch. + match_id = 'match_id_example' # str | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + function_ids = [56] # List[int] | Source function IDs whose matches to fetch. Required unless match_id is supplied. (optional) try: # Get function-matching results for an explicit set of functions - api_response = api_instance.get_functions_matches(function_ids) + api_response = api_instance.get_functions_matches(match_id=match_id, function_ids=function_ids) print("The response of FunctionsCoreApi->get_functions_matches:\n") pprint(api_response) except Exception as e: @@ -2083,7 +2086,8 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_ids** | [**List[int]**](int.md)| Source function IDs whose matches to fetch. | + **match_id** | **str**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] + **function_ids** | [**List[int]**](int.md)| Source function IDs whose matches to fetch. Required unless match_id is supplied. | [optional] ### Return type @@ -2112,7 +2116,7 @@ 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) # **get_functions_matching_status** -> GetMatchesStatusOutputBody get_functions_matching_status(function_ids) +> GetMatchesStatusOutputBody get_functions_matching_status(match_id=match_id, function_ids=function_ids) Get function-matching status for an explicit set of functions @@ -2160,11 +2164,12 @@ configuration = revengai.Configuration( with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsCoreApi(api_client) - function_ids = [56] # List[int] | Source function IDs whose matches to fetch. + match_id = 'match_id_example' # str | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + function_ids = [56] # List[int] | Source function IDs whose matches to fetch. Required unless match_id is supplied. (optional) try: # Get function-matching status for an explicit set of functions - api_response = api_instance.get_functions_matching_status(function_ids) + api_response = api_instance.get_functions_matching_status(match_id=match_id, function_ids=function_ids) print("The response of FunctionsCoreApi->get_functions_matching_status:\n") pprint(api_response) except Exception as e: @@ -2178,7 +2183,8 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_ids** | [**List[int]**](int.md)| Source function IDs whose matches to fetch. | + **match_id** | **str**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] + **function_ids** | [**List[int]**](int.md)| Source function IDs whose matches to fetch. Required unless match_id is supplied. | [optional] ### Return type @@ -2206,6 +2212,101 @@ 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) +# **get_imported_function** +> ImportedFunctionDetailOutputBody get_imported_function(analysis_id, imported_function_id) + +Get an imported function with its callers + +Returns a single imported symbol plus the internal functions that call it, resolved via the import's PLT/stub addresses within the binary. Answers "which functions call `free`?" for binary navigation. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.imported_function_detail_output_body import ImportedFunctionDetailOutputBody +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.FunctionsCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + imported_function_id = 56 # int | Imported function ID + + try: + # Get an imported function with its callers + api_response = api_instance.get_imported_function(analysis_id, imported_function_id) + print("The response of FunctionsCoreApi->get_imported_function:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_imported_function: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **imported_function_id** | **int**| Imported function ID | + +### Return type + +[**ImportedFunctionDetailOutputBody**](ImportedFunctionDetailOutputBody.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) + # **list_analysis_functions** > ListAnalysisFunctionsOutputBody list_analysis_functions(analysis_id, offset=offset, limit=limit) @@ -2303,6 +2404,103 @@ 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) +# **list_imported_functions** +> ListImportedFunctionsOutputBody list_imported_functions(analysis_id, offset=offset, limit=limit) + +List imported functions in an analysis + +Returns a paginated list of external/imported symbols (e.g. libc's `free`) linked by the analysis's binary. These are display-only: they carry no embeddings, cannot be renamed, and never participate in match/diff. `total_count` is the full population size, ignoring pagination. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody +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.FunctionsCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + offset = 56 # int | Pagination offset. Defaults to 0. (optional) + limit = 56 # int | Page size. Defaults to 100. (optional) + + try: + # List imported functions in an analysis + api_response = api_instance.list_imported_functions(analysis_id, offset=offset, limit=limit) + print("The response of FunctionsCoreApi->list_imported_functions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->list_imported_functions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **offset** | **int**| Pagination offset. Defaults to 0. | [optional] + **limit** | **int**| Page size. Defaults to 100. | [optional] + +### Return type + +[**ListImportedFunctionsOutputBody**](ListImportedFunctionsOutputBody.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) + # **start_functions_matching** > StartMatchingOutputBody start_functions_matching(start_matching_for_functions_input_body) diff --git a/docs/ImportedFunctionCallerEntry.md b/docs/ImportedFunctionCallerEntry.md new file mode 100644 index 0000000..71dbe18 --- /dev/null +++ b/docs/ImportedFunctionCallerEntry.md @@ -0,0 +1,32 @@ +# ImportedFunctionCallerEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_id** | **int** | | +**function_name** | **str** | | +**function_vaddr** | **int** | | +**stub_vaddr** | **int** | The PLT/stub address this caller targets. | + +## Example + +```python +from revengai.models.imported_function_caller_entry import ImportedFunctionCallerEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ImportedFunctionCallerEntry from a JSON string +imported_function_caller_entry_instance = ImportedFunctionCallerEntry.from_json(json) +# print the JSON string representation of the object +print(ImportedFunctionCallerEntry.to_json()) + +# convert the object into a dict +imported_function_caller_entry_dict = imported_function_caller_entry_instance.to_dict() +# create an instance of ImportedFunctionCallerEntry from a dict +imported_function_caller_entry_from_dict = ImportedFunctionCallerEntry.from_dict(imported_function_caller_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/ImportedFunctionDetailOutputBody.md b/docs/ImportedFunctionDetailOutputBody.md new file mode 100644 index 0000000..2ff1490 --- /dev/null +++ b/docs/ImportedFunctionDetailOutputBody.md @@ -0,0 +1,37 @@ +# ImportedFunctionDetailOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**callers** | [**List[ImportedFunctionCallerEntry]**](ImportedFunctionCallerEntry.md) | Internal functions that call this import, resolved via its PLT/stub addresses. | +**imported_function_id** | **int** | | +**is_function** | **bool** | False for imported data symbols. | +**library_name** | **str** | Library the symbol is imported from. '<EXTERNAL>' for unattributed imports. | +**library_version** | **str** | Versioned symbol tag, when the loader records one. | [optional] +**name** | **str** | | +**original_name** | **str** | Pre-demangling / pre-aliasing name, when it differs from name. | [optional] +**stub_vaddrs** | **List[int]** | PLT/stub addresses that resolve external call edges (function_call_edges.callee_vaddr) to this import. Use these to link a caller's external callee to this import. | +**vaddr** | **int** | Virtual address of the import, when known. | [optional] + +## Example + +```python +from revengai.models.imported_function_detail_output_body import ImportedFunctionDetailOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ImportedFunctionDetailOutputBody from a JSON string +imported_function_detail_output_body_instance = ImportedFunctionDetailOutputBody.from_json(json) +# print the JSON string representation of the object +print(ImportedFunctionDetailOutputBody.to_json()) + +# convert the object into a dict +imported_function_detail_output_body_dict = imported_function_detail_output_body_instance.to_dict() +# create an instance of ImportedFunctionDetailOutputBody from a dict +imported_function_detail_output_body_from_dict = ImportedFunctionDetailOutputBody.from_dict(imported_function_detail_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/ImportedFunctionEntry.md b/docs/ImportedFunctionEntry.md new file mode 100644 index 0000000..92e0320 --- /dev/null +++ b/docs/ImportedFunctionEntry.md @@ -0,0 +1,36 @@ +# ImportedFunctionEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**imported_function_id** | **int** | | +**is_function** | **bool** | False for imported data symbols. | +**library_name** | **str** | Library the symbol is imported from. '<EXTERNAL>' for unattributed imports. | +**library_version** | **str** | Versioned symbol tag, when the loader records one. | [optional] +**name** | **str** | | +**original_name** | **str** | Pre-demangling / pre-aliasing name, when it differs from name. | [optional] +**stub_vaddrs** | **List[int]** | PLT/stub addresses that resolve external call edges (function_call_edges.callee_vaddr) to this import. Use these to link a caller's external callee to this import. | +**vaddr** | **int** | Virtual address of the import, when known. | [optional] + +## Example + +```python +from revengai.models.imported_function_entry import ImportedFunctionEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ImportedFunctionEntry from a JSON string +imported_function_entry_instance = ImportedFunctionEntry.from_json(json) +# print the JSON string representation of the object +print(ImportedFunctionEntry.to_json()) + +# convert the object into a dict +imported_function_entry_dict = imported_function_entry_instance.to_dict() +# create an instance of ImportedFunctionEntry from a dict +imported_function_entry_from_dict = ImportedFunctionEntry.from_dict(imported_function_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/ListArchiveContentsOutputBody.md b/docs/ListArchiveContentsOutputBody.md new file mode 100644 index 0000000..b70fc3b --- /dev/null +++ b/docs/ListArchiveContentsOutputBody.md @@ -0,0 +1,33 @@ +# ListArchiveContentsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entries** | [**List[ArchiveContentEntry]**](ArchiveContentEntry.md) | Files inside the archive, with paths relative to the archive root | +**has_next** | **bool** | Whether a further page of entries follows this one. | +**page** | **int** | Page number of this response (1-indexed). | +**page_size** | **int** | Number of entries per page. | +**total_count** | **int** | Total number of file entries in the archive, ignoring pagination. | + +## Example + +```python +from revengai.models.list_archive_contents_output_body import ListArchiveContentsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListArchiveContentsOutputBody from a JSON string +list_archive_contents_output_body_instance = ListArchiveContentsOutputBody.from_json(json) +# print the JSON string representation of the object +print(ListArchiveContentsOutputBody.to_json()) + +# convert the object into a dict +list_archive_contents_output_body_dict = list_archive_contents_output_body_instance.to_dict() +# create an instance of ListArchiveContentsOutputBody from a dict +list_archive_contents_output_body_from_dict = ListArchiveContentsOutputBody.from_dict(list_archive_contents_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/ListImportedFunctionsOutputBody.md b/docs/ListImportedFunctionsOutputBody.md new file mode 100644 index 0000000..6e6ce27 --- /dev/null +++ b/docs/ListImportedFunctionsOutputBody.md @@ -0,0 +1,30 @@ +# ListImportedFunctionsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**imported_functions** | [**List[ImportedFunctionEntry]**](ImportedFunctionEntry.md) | | +**total_count** | **int** | Total imported functions for the binary, ignoring pagination. | + +## Example + +```python +from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListImportedFunctionsOutputBody from a JSON string +list_imported_functions_output_body_instance = ListImportedFunctionsOutputBody.from_json(json) +# print the JSON string representation of the object +print(ListImportedFunctionsOutputBody.to_json()) + +# convert the object into a dict +list_imported_functions_output_body_dict = list_imported_functions_output_body_instance.to_dict() +# create an instance of ListImportedFunctionsOutputBody from a dict +list_imported_functions_output_body_from_dict = ListImportedFunctionsOutputBody.from_dict(list_imported_functions_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/StartMatchingForAnalysisInputBody.md b/docs/StartMatchingForAnalysisInputBody.md index 0b29d3c..f3af166 100644 --- a/docs/StartMatchingForAnalysisInputBody.md +++ b/docs/StartMatchingForAnalysisInputBody.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **filters** | [**MatchFilters**](MatchFilters.md) | Narrow the candidate pool. | [optional] **min_similarity** | **float** | Similarity floor as a percentage. Defaults to 90. | [optional] +**no_cache** | **bool** | By default a completed matching run for the same request is reused (response status=COMPLETED, no new run). Set true to force a fresh run. | [optional] **results_per_function** | **int** | Max matches returned per source function. Defaults to 1. | [optional] ## Example diff --git a/docs/StartMatchingForFunctionsInputBody.md b/docs/StartMatchingForFunctionsInputBody.md index 823bfbd..f65df1f 100644 --- a/docs/StartMatchingForFunctionsInputBody.md +++ b/docs/StartMatchingForFunctionsInputBody.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **filters** | [**MatchFilters**](MatchFilters.md) | Narrow the candidate pool. | [optional] **function_ids** | **List[int]** | Source function IDs to match against the rest of the corpus. | **min_similarity** | **float** | Similarity floor as a percentage. Defaults to 90. | [optional] +**no_cache** | **bool** | By default a completed matching run for the same request is reused (response status=COMPLETED, no new run). Set true to force a fresh run. | [optional] **results_per_function** | **int** | Max matches returned per source function. Defaults to 1. | [optional] **use_canonical_names** | **bool** | Collapse near-duplicate candidate names into canonical buckets and return per-name confidences (the response 'confidences' array). Adds a canonicalisation step; defaults to false. | [optional] diff --git a/docs/StartMatchingOutputBody.md b/docs/StartMatchingOutputBody.md index ff6c767..11ae8fb 100644 --- a/docs/StartMatchingOutputBody.md +++ b/docs/StartMatchingOutputBody.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**match_id** | **str** | Opaque token for this matching run. Pass it to the GET/status endpoints' match_id query parameter to fetch this exact run. | **messages** | [**List[ProgressMessage]**](ProgressMessage.md) | Log messages emitted during execution | **status** | **str** | Current workflow status | **step** | **str** | Name of the current step | diff --git a/docs/TriggerDynamicExecutionInputBody.md b/docs/TriggerDynamicExecutionInputBody.md index c617e9c..7bdb5bc 100644 --- a/docs/TriggerDynamicExecutionInputBody.md +++ b/docs/TriggerDynamicExecutionInputBody.md @@ -5,6 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**archive_entry_path** | **str** | Relative path of the entry inside the archive to execute | [optional] +**archive_password** | **str** | Password for an encrypted archive | [optional] +**archive_sha_256_hash** | **str** | SHA-256 of the archive object to send to the sandbox instead of the analysed binary | [optional] **command_line_args** | **str** | Command-line arguments passed to the sample when the sandbox launches it | [optional] **start_method** | **str** | How the sandbox launches the sample. Defaults to the sandbox's standard behaviour when omitted. | [optional] **timeout** | **int** | Maximum sandbox execution time in seconds | [optional] [default to 120] diff --git a/revengai/__init__.py b/revengai/__init__.py index 5805c33..fb65e44 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.107.0" +__version__ = "v3.110.0" # Define package exports __all__ = [ @@ -96,6 +96,7 @@ "AppApiRestV2FunctionsResponsesFunction", "AppApiRestV2FunctionsTypesFunction", "AppApiRestV2InfoTypesCapability", + "ArchiveContentEntry", "Argument", "Artifact", "AttemptFailedEvent", @@ -358,6 +359,9 @@ "ISA", "IconModel", "ImportModel", + "ImportedFunctionCallerEntry", + "ImportedFunctionDetailOutputBody", + "ImportedFunctionEntry", "InlineComment", "InsertAnalysisLogRequest", "InviteUserInputBody", @@ -365,11 +369,13 @@ "ListAnalysisFunctionsDataTypesOutputBody", "ListAnalysisFunctionsOutputBody", "ListAnalysisStringsOutputBody", + "ListArchiveContentsOutputBody", "ListCollectionResults", "ListCollectionsOutputBody", "ListExampleAnalysesOutputBody", "ListFunctionStringsOutputBody", "ListFunctionsDataTypesOutputBody", + "ListImportedFunctionsOutputBody", "ListTeamsOutputBody", "ListUsersOutputBody", "LocationOutputBody", @@ -633,6 +639,7 @@ from revengai.models.app_api_rest_v2_functions_responses_function import AppApiRestV2FunctionsResponsesFunction as AppApiRestV2FunctionsResponsesFunction from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction as AppApiRestV2FunctionsTypesFunction from revengai.models.app_api_rest_v2_info_types_capability import AppApiRestV2InfoTypesCapability as AppApiRestV2InfoTypesCapability +from revengai.models.archive_content_entry import ArchiveContentEntry as ArchiveContentEntry from revengai.models.argument import Argument as Argument from revengai.models.artifact import Artifact as Artifact from revengai.models.attempt_failed_event import AttemptFailedEvent as AttemptFailedEvent @@ -895,6 +902,9 @@ from revengai.models.isa import ISA as ISA from revengai.models.icon_model import IconModel as IconModel from revengai.models.import_model import ImportModel as ImportModel +from revengai.models.imported_function_caller_entry import ImportedFunctionCallerEntry as ImportedFunctionCallerEntry +from revengai.models.imported_function_detail_output_body import ImportedFunctionDetailOutputBody as ImportedFunctionDetailOutputBody +from revengai.models.imported_function_entry import ImportedFunctionEntry as ImportedFunctionEntry from revengai.models.inline_comment import InlineComment as InlineComment from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest as InsertAnalysisLogRequest from revengai.models.invite_user_input_body import InviteUserInputBody as InviteUserInputBody @@ -902,11 +912,13 @@ from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody as ListAnalysisFunctionsDataTypesOutputBody from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody as ListAnalysisFunctionsOutputBody from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody as ListAnalysisStringsOutputBody +from revengai.models.list_archive_contents_output_body import ListArchiveContentsOutputBody as ListArchiveContentsOutputBody from revengai.models.list_collection_results import ListCollectionResults as ListCollectionResults from revengai.models.list_collections_output_body import ListCollectionsOutputBody as ListCollectionsOutputBody from revengai.models.list_example_analyses_output_body import ListExampleAnalysesOutputBody as ListExampleAnalysesOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody as ListFunctionStringsOutputBody from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody as ListFunctionsDataTypesOutputBody +from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody as ListImportedFunctionsOutputBody from revengai.models.list_teams_output_body import ListTeamsOutputBody as ListTeamsOutputBody from revengai.models.list_users_output_body import ListUsersOutputBody as ListUsersOutputBody from revengai.models.location_output_body import LocationOutputBody as LocationOutputBody diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 78c6714..133065e 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -2051,6 +2051,7 @@ def _get_analysis_function_map_serialize( def get_analysis_function_matches( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2066,10 +2067,12 @@ def get_analysis_function_matches( ) -> GetMatchesOutputBody: """Get function-matching results for an analysis - Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param analysis_id: Analysis ID (required) :type analysis_id: int + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str :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 @@ -2094,6 +2097,7 @@ def get_analysis_function_matches( _param = self._get_analysis_function_matches_serialize( analysis_id=analysis_id, + match_id=match_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2102,6 +2106,7 @@ def get_analysis_function_matches( _response_types_map: Dict[str, Optional[str]] = { '200': "GetMatchesOutputBody", + '400': "APIError", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2122,6 +2127,7 @@ def get_analysis_function_matches( def get_analysis_function_matches_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2137,10 +2143,12 @@ def get_analysis_function_matches_with_http_info( ) -> ApiResponse[GetMatchesOutputBody]: """Get function-matching results for an analysis - Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param analysis_id: Analysis ID (required) :type analysis_id: int + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str :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 @@ -2165,6 +2173,7 @@ def get_analysis_function_matches_with_http_info( _param = self._get_analysis_function_matches_serialize( analysis_id=analysis_id, + match_id=match_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2173,6 +2182,7 @@ def get_analysis_function_matches_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "GetMatchesOutputBody", + '400': "APIError", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2193,6 +2203,7 @@ def get_analysis_function_matches_with_http_info( def get_analysis_function_matches_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2208,10 +2219,12 @@ def get_analysis_function_matches_without_preload_content( ) -> RESTResponseType: """Get function-matching results for an analysis - Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param analysis_id: Analysis ID (required) :type analysis_id: int + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str :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 @@ -2236,6 +2249,7 @@ def get_analysis_function_matches_without_preload_content( _param = self._get_analysis_function_matches_serialize( analysis_id=analysis_id, + match_id=match_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2244,6 +2258,7 @@ def get_analysis_function_matches_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "GetMatchesOutputBody", + '400': "APIError", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2259,6 +2274,7 @@ def get_analysis_function_matches_without_preload_content( def _get_analysis_function_matches_serialize( self, analysis_id, + match_id, _request_auth, _content_type, _headers, @@ -2283,6 +2299,10 @@ def _get_analysis_function_matches_serialize( if analysis_id is not None: _path_params['analysis_id'] = analysis_id # process the query parameters + if match_id is not None: + + _query_params.append(('match_id', match_id)) + # process the header parameters # process the form parameters # process the body parameter @@ -2325,6 +2345,7 @@ def _get_analysis_function_matches_serialize( def get_analysis_function_matching_status( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2340,10 +2361,12 @@ def get_analysis_function_matching_status( ) -> GetMatchesStatusOutputBody: """Get function-matching status for an analysis - Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param analysis_id: Analysis ID (required) :type analysis_id: int + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str :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 @@ -2368,6 +2391,7 @@ def get_analysis_function_matching_status( _param = self._get_analysis_function_matching_status_serialize( analysis_id=analysis_id, + match_id=match_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2376,6 +2400,7 @@ def get_analysis_function_matching_status( _response_types_map: Dict[str, Optional[str]] = { '200': "GetMatchesStatusOutputBody", + '400': "APIError", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2396,6 +2421,7 @@ def get_analysis_function_matching_status( def get_analysis_function_matching_status_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2411,10 +2437,12 @@ def get_analysis_function_matching_status_with_http_info( ) -> ApiResponse[GetMatchesStatusOutputBody]: """Get function-matching status for an analysis - Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param analysis_id: Analysis ID (required) :type analysis_id: int + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str :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 @@ -2439,6 +2467,7 @@ def get_analysis_function_matching_status_with_http_info( _param = self._get_analysis_function_matching_status_serialize( analysis_id=analysis_id, + match_id=match_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2447,6 +2476,7 @@ def get_analysis_function_matching_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "GetMatchesStatusOutputBody", + '400': "APIError", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2467,6 +2497,7 @@ def get_analysis_function_matching_status_with_http_info( def get_analysis_function_matching_status_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2482,10 +2513,12 @@ def get_analysis_function_matching_status_without_preload_content( ) -> RESTResponseType: """Get function-matching status for an analysis - Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param analysis_id: Analysis ID (required) :type analysis_id: int + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str :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 @@ -2510,6 +2543,7 @@ def get_analysis_function_matching_status_without_preload_content( _param = self._get_analysis_function_matching_status_serialize( analysis_id=analysis_id, + match_id=match_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2518,6 +2552,7 @@ def get_analysis_function_matching_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "GetMatchesStatusOutputBody", + '400': "APIError", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2533,6 +2568,7 @@ def get_analysis_function_matching_status_without_preload_content( def _get_analysis_function_matching_status_serialize( self, analysis_id, + match_id, _request_auth, _content_type, _headers, @@ -2557,6 +2593,10 @@ def _get_analysis_function_matching_status_serialize( if analysis_id is not None: _path_params['analysis_id'] = analysis_id # process the query parameters + if match_id is not None: + + _query_params.append(('match_id', match_id)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index 0271493..8d154fd 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -40,8 +40,10 @@ from revengai.models.function_matching_response import FunctionMatchingResponse from revengai.models.get_matches_output_body import GetMatchesOutputBody from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody +from revengai.models.imported_function_detail_output_body import ImportedFunctionDetailOutputBody from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody +from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody from revengai.models.start_matching_for_functions_input_body import StartMatchingForFunctionsInputBody from revengai.models.start_matching_output_body import StartMatchingOutputBody @@ -6373,7 +6375,8 @@ def _get_functions_callees_callers_serialize( @validate_call def get_functions_matches( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch. Required unless match_id is supplied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6391,7 +6394,9 @@ def get_functions_matches( Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_ids: Source function IDs whose matches to fetch. (required) + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str + :param function_ids: Source function IDs whose matches to fetch. Required unless match_id is supplied. :type function_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6416,6 +6421,7 @@ def get_functions_matches( """ # noqa: E501 _param = self._get_functions_matches_serialize( + match_id=match_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -6445,7 +6451,8 @@ def get_functions_matches( @validate_call def get_functions_matches_with_http_info( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch. Required unless match_id is supplied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6463,7 +6470,9 @@ def get_functions_matches_with_http_info( Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_ids: Source function IDs whose matches to fetch. (required) + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str + :param function_ids: Source function IDs whose matches to fetch. Required unless match_id is supplied. :type function_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6488,6 +6497,7 @@ def get_functions_matches_with_http_info( """ # noqa: E501 _param = self._get_functions_matches_serialize( + match_id=match_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -6517,7 +6527,8 @@ def get_functions_matches_with_http_info( @validate_call def get_functions_matches_without_preload_content( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch. Required unless match_id is supplied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6535,7 +6546,9 @@ def get_functions_matches_without_preload_content( Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_ids: Source function IDs whose matches to fetch. (required) + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str + :param function_ids: Source function IDs whose matches to fetch. Required unless match_id is supplied. :type function_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6560,6 +6573,7 @@ def get_functions_matches_without_preload_content( """ # noqa: E501 _param = self._get_functions_matches_serialize( + match_id=match_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -6584,6 +6598,7 @@ def get_functions_matches_without_preload_content( def _get_functions_matches_serialize( self, + match_id, function_ids, _request_auth, _content_type, @@ -6608,6 +6623,10 @@ def _get_functions_matches_serialize( # process the path parameters # process the query parameters + if match_id is not None: + + _query_params.append(('match_id', match_id)) + if function_ids is not None: _query_params.append(('function_ids', function_ids)) @@ -6653,7 +6672,8 @@ def _get_functions_matches_serialize( @validate_call def get_functions_matching_status( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch. Required unless match_id is supplied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6671,7 +6691,9 @@ def get_functions_matching_status( Returns the matching workflow's current status for the supplied function IDs. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_ids: Source function IDs whose matches to fetch. (required) + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str + :param function_ids: Source function IDs whose matches to fetch. Required unless match_id is supplied. :type function_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6696,6 +6718,7 @@ def get_functions_matching_status( """ # noqa: E501 _param = self._get_functions_matching_status_serialize( + match_id=match_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -6725,7 +6748,8 @@ def get_functions_matching_status( @validate_call def get_functions_matching_status_with_http_info( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch. Required unless match_id is supplied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6743,7 +6767,9 @@ def get_functions_matching_status_with_http_info( Returns the matching workflow's current status for the supplied function IDs. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_ids: Source function IDs whose matches to fetch. (required) + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str + :param function_ids: Source function IDs whose matches to fetch. Required unless match_id is supplied. :type function_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6768,6 +6794,7 @@ def get_functions_matching_status_with_http_info( """ # noqa: E501 _param = self._get_functions_matching_status_serialize( + match_id=match_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -6797,7 +6824,8 @@ def get_functions_matching_status_with_http_info( @validate_call def get_functions_matching_status_without_preload_content( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + match_id: Annotated[Optional[StrictStr], Field(description="Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest.")] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch. Required unless match_id is supplied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6815,7 +6843,9 @@ def get_functions_matching_status_without_preload_content( Returns the matching workflow's current status for the supplied function IDs. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_ids: Source function IDs whose matches to fetch. (required) + :param match_id: Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. + :type match_id: str + :param function_ids: Source function IDs whose matches to fetch. Required unless match_id is supplied. :type function_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6840,6 +6870,7 @@ def get_functions_matching_status_without_preload_content( """ # noqa: E501 _param = self._get_functions_matching_status_serialize( + match_id=match_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -6864,6 +6895,7 @@ def get_functions_matching_status_without_preload_content( def _get_functions_matching_status_serialize( self, + match_id, function_ids, _request_auth, _content_type, @@ -6888,6 +6920,10 @@ def _get_functions_matching_status_serialize( # process the path parameters # process the query parameters + if match_id is not None: + + _query_params.append(('match_id', match_id)) + if function_ids is not None: _query_params.append(('function_ids', function_ids)) @@ -6931,11 +6967,10 @@ def _get_functions_matching_status_serialize( @validate_call - def list_analysis_functions( + def get_imported_function( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + imported_function_id: Annotated[int, Field(strict=True, ge=1, description="Imported function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6948,17 +6983,15 @@ def list_analysis_functions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListAnalysisFunctionsOutputBody: - """List functions in an analysis + ) -> ImportedFunctionDetailOutputBody: + """Get an imported function with its callers - Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Returns a single imported symbol plus the internal functions that call it, resolved via the import's PLT/stub addresses within the binary. Answers \"which functions call `free`?\" for binary navigation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int - :param offset: Pagination offset. Defaults to 0. - :type offset: int - :param limit: Page size. Defaults to 100. - :type limit: int + :param imported_function_id: Imported function ID (required) + :type imported_function_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 @@ -6981,10 +7014,9 @@ def list_analysis_functions( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analysis_functions_serialize( + _param = self._get_imported_function_serialize( analysis_id=analysis_id, - offset=offset, - limit=limit, + imported_function_id=imported_function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6992,7 +7024,7 @@ def list_analysis_functions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisFunctionsOutputBody", + '200': "ImportedFunctionDetailOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -7010,11 +7042,10 @@ def list_analysis_functions( @validate_call - def list_analysis_functions_with_http_info( + def get_imported_function_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + imported_function_id: Annotated[int, Field(strict=True, ge=1, description="Imported function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7027,17 +7058,15 @@ def list_analysis_functions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListAnalysisFunctionsOutputBody]: - """List functions in an analysis + ) -> ApiResponse[ImportedFunctionDetailOutputBody]: + """Get an imported function with its callers - Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Returns a single imported symbol plus the internal functions that call it, resolved via the import's PLT/stub addresses within the binary. Answers \"which functions call `free`?\" for binary navigation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int - :param offset: Pagination offset. Defaults to 0. - :type offset: int - :param limit: Page size. Defaults to 100. - :type limit: int + :param imported_function_id: Imported function ID (required) + :type imported_function_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 @@ -7060,10 +7089,9 @@ def list_analysis_functions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analysis_functions_serialize( + _param = self._get_imported_function_serialize( analysis_id=analysis_id, - offset=offset, - limit=limit, + imported_function_id=imported_function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7071,7 +7099,7 @@ def list_analysis_functions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisFunctionsOutputBody", + '200': "ImportedFunctionDetailOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -7089,11 +7117,10 @@ def list_analysis_functions_with_http_info( @validate_call - def list_analysis_functions_without_preload_content( + def get_imported_function_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + imported_function_id: Annotated[int, Field(strict=True, ge=1, description="Imported function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7107,16 +7134,14 @@ def list_analysis_functions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List functions in an analysis + """Get an imported function with its callers - Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Returns a single imported symbol plus the internal functions that call it, resolved via the import's PLT/stub addresses within the binary. Answers \"which functions call `free`?\" for binary navigation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int - :param offset: Pagination offset. Defaults to 0. - :type offset: int - :param limit: Page size. Defaults to 100. - :type limit: int + :param imported_function_id: Imported function ID (required) + :type imported_function_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 @@ -7139,10 +7164,9 @@ def list_analysis_functions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analysis_functions_serialize( + _param = self._get_imported_function_serialize( analysis_id=analysis_id, - offset=offset, - limit=limit, + imported_function_id=imported_function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7150,7 +7174,7 @@ def list_analysis_functions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisFunctionsOutputBody", + '200': "ImportedFunctionDetailOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -7163,11 +7187,10 @@ def list_analysis_functions_without_preload_content( return response_data.response - def _list_analysis_functions_serialize( + def _get_imported_function_serialize( self, analysis_id, - offset, - limit, + imported_function_id, _request_auth, _content_type, _headers, @@ -7191,15 +7214,9 @@ def _list_analysis_functions_serialize( # process the path parameters if analysis_id is not None: _path_params['analysis_id'] = analysis_id + if imported_function_id is not None: + _path_params['imported_function_id'] = imported_function_id # process the query parameters - if offset is not None: - - _query_params.append(('offset', offset)) - - if limit is not None: - - _query_params.append(('limit', limit)) - # process the header parameters # process the form parameters # process the body parameter @@ -7222,7 +7239,623 @@ def _list_analysis_functions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/functions', + resource_path='/v3/analyses/{analysis_id}/imported-functions/{imported_function_id}', + 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 list_analysis_functions( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + _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, + ) -> ListAnalysisFunctionsOutputBody: + """List functions in an analysis + + Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsOutputBody", + '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 list_analysis_functions_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + _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[ListAnalysisFunctionsOutputBody]: + """List functions in an analysis + + Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsOutputBody", + '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 list_analysis_functions_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + _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: + """List functions in an analysis + + Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsOutputBody", + '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 _list_analysis_functions_serialize( + self, + analysis_id, + offset, + limit, + _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 + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # 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}/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 list_imported_functions( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + _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, + ) -> ListImportedFunctionsOutputBody: + """List imported functions in an analysis + + Returns a paginated list of external/imported symbols (e.g. libc's `free`) linked by the analysis's binary. These are display-only: they carry no embeddings, cannot be renamed, and never participate in match/diff. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_imported_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListImportedFunctionsOutputBody", + '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 list_imported_functions_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + _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[ListImportedFunctionsOutputBody]: + """List imported functions in an analysis + + Returns a paginated list of external/imported symbols (e.g. libc's `free`) linked by the analysis's binary. These are display-only: they carry no embeddings, cannot be renamed, and never participate in match/diff. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_imported_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListImportedFunctionsOutputBody", + '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 list_imported_functions_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + _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: + """List imported functions in an analysis + + Returns a paginated list of external/imported symbols (e.g. libc's `free`) linked by the analysis's binary. These are display-only: they carry no embeddings, cannot be renamed, and never participate in match/diff. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_imported_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListImportedFunctionsOutputBody", + '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 _list_imported_functions_serialize( + self, + analysis_id, + offset, + limit, + _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 + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # 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}/imported-functions', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api_client.py b/revengai/api_client.py index cdea497..c6e8df6 100644 --- a/revengai/api_client.py +++ b/revengai/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v3.107.0/python' + self.user_agent = 'OpenAPI-Generator/v3.110.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 28afcad..0ae4ef3 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: v3.107.0\n"\ - "SDK Package Version: v3.107.0".\ + "Version of the API: v3.110.0\n"\ + "SDK Package Version: v3.110.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 93e227d..2503865 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -61,6 +61,7 @@ from revengai.models.app_api_rest_v2_functions_responses_function import AppApiRestV2FunctionsResponsesFunction from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction from revengai.models.app_api_rest_v2_info_types_capability import AppApiRestV2InfoTypesCapability +from revengai.models.archive_content_entry import ArchiveContentEntry from revengai.models.argument import Argument from revengai.models.artifact import Artifact from revengai.models.attempt_failed_event import AttemptFailedEvent @@ -323,6 +324,9 @@ from revengai.models.isa import ISA from revengai.models.icon_model import IconModel from revengai.models.import_model import ImportModel +from revengai.models.imported_function_caller_entry import ImportedFunctionCallerEntry +from revengai.models.imported_function_detail_output_body import ImportedFunctionDetailOutputBody +from revengai.models.imported_function_entry import ImportedFunctionEntry from revengai.models.inline_comment import InlineComment from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest from revengai.models.invite_user_input_body import InviteUserInputBody @@ -330,11 +334,13 @@ from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody +from revengai.models.list_archive_contents_output_body import ListArchiveContentsOutputBody from revengai.models.list_collection_results import ListCollectionResults from revengai.models.list_collections_output_body import ListCollectionsOutputBody from revengai.models.list_example_analyses_output_body import ListExampleAnalysesOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody +from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody from revengai.models.list_teams_output_body import ListTeamsOutputBody from revengai.models.list_users_output_body import ListUsersOutputBody from revengai.models.location_output_body import LocationOutputBody diff --git a/revengai/models/archive_content_entry.py b/revengai/models/archive_content_entry.py new file mode 100644 index 0000000..31bf356 --- /dev/null +++ b/revengai/models/archive_content_entry.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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ArchiveContentEntry(BaseModel): + """ + ArchiveContentEntry + """ # noqa: E501 + encrypted: StrictBool = Field(description="Whether this entry is password-protected") + path: StrictStr = Field(description="Path relative to the archive root") + size: StrictInt = Field(description="Uncompressed size in bytes") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["encrypted", "path", "size"] + + 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 ArchiveContentEntry 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 ArchiveContentEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "encrypted": obj.get("encrypted"), + "path": obj.get("path"), + "size": obj.get("size") + }) + # 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/batch_binary_match_result.py b/revengai/models/batch_binary_match_result.py index a87684a..6b89798 100644 --- a/revengai/models/batch_binary_match_result.py +++ b/revengai/models/batch_binary_match_result.py @@ -27,10 +27,11 @@ class BatchBinaryMatchResult(BaseModel): """ # noqa: E501 binary_id: StrictInt = Field(description="Target binary") error_message: Optional[StrictStr] = Field(default=None, description="Error description when status=FAILED.") + match_id: Optional[StrictStr] = Field(default=None, description="Opaque token for this binary's matching run. Present on dispatch and when statuses were fetched by token.") matched_function_count: StrictInt = Field(description="Number of source functions that received at least one candidate match. Only meaningful when status=COMPLETED.") status: StrictStr = Field(description="Per-binary workflow status") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["binary_id", "error_message", "matched_function_count", "status"] + __properties: ClassVar[List[str]] = ["binary_id", "error_message", "match_id", "matched_function_count", "status"] @field_validator('status') def status_validate_enum(cls, value): @@ -99,6 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "binary_id": obj.get("binary_id"), "error_message": obj.get("error_message"), + "match_id": obj.get("match_id"), "matched_function_count": obj.get("matched_function_count"), "status": obj.get("status") }) diff --git a/revengai/models/imported_function_caller_entry.py b/revengai/models/imported_function_caller_entry.py new file mode 100644 index 0000000..c0d8eb1 --- /dev/null +++ b/revengai/models/imported_function_caller_entry.py @@ -0,0 +1,105 @@ +# 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 +from typing import Optional, Set +from typing_extensions import Self + +class ImportedFunctionCallerEntry(BaseModel): + """ + ImportedFunctionCallerEntry + """ # noqa: E501 + function_id: StrictInt + function_name: StrictStr + function_vaddr: StrictInt + stub_vaddr: StrictInt = Field(description="The PLT/stub address this caller targets.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["function_id", "function_name", "function_vaddr", "stub_vaddr"] + + 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 ImportedFunctionCallerEntry 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 ImportedFunctionCallerEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "function_vaddr": obj.get("function_vaddr"), + "stub_vaddr": obj.get("stub_vaddr") + }) + # 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/imported_function_detail_output_body.py b/revengai/models/imported_function_detail_output_body.py new file mode 100644 index 0000000..645065b --- /dev/null +++ b/revengai/models/imported_function_detail_output_body.py @@ -0,0 +1,133 @@ +# 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.imported_function_caller_entry import ImportedFunctionCallerEntry +from typing import Optional, Set +from typing_extensions import Self + +class ImportedFunctionDetailOutputBody(BaseModel): + """ + ImportedFunctionDetailOutputBody + """ # noqa: E501 + callers: Optional[List[ImportedFunctionCallerEntry]] = Field(description="Internal functions that call this import, resolved via its PLT/stub addresses.") + imported_function_id: StrictInt + is_function: StrictBool = Field(description="False for imported data symbols.") + library_name: StrictStr = Field(description="Library the symbol is imported from. '' for unattributed imports.") + library_version: Optional[StrictStr] = Field(default=None, description="Versioned symbol tag, when the loader records one.") + name: StrictStr + original_name: Optional[StrictStr] = Field(default=None, description="Pre-demangling / pre-aliasing name, when it differs from name.") + stub_vaddrs: Optional[List[StrictInt]] = Field(description="PLT/stub addresses that resolve external call edges (function_call_edges.callee_vaddr) to this import. Use these to link a caller's external callee to this import.") + vaddr: Optional[StrictInt] = Field(default=None, description="Virtual address of the import, when known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["callers", "imported_function_id", "is_function", "library_name", "library_version", "name", "original_name", "stub_vaddrs", "vaddr"] + + 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 ImportedFunctionDetailOutputBody 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 callers (list) + _items = [] + if self.callers: + for _item_callers in self.callers: + if _item_callers: + _items.append(_item_callers.to_dict()) + _dict['callers'] = _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 callers (nullable) is None + # and model_fields_set contains the field + if self.callers is None and "callers" in self.model_fields_set: + _dict['callers'] = None + + # set to None if stub_vaddrs (nullable) is None + # and model_fields_set contains the field + if self.stub_vaddrs is None and "stub_vaddrs" in self.model_fields_set: + _dict['stub_vaddrs'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImportedFunctionDetailOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callers": [ImportedFunctionCallerEntry.from_dict(_item) for _item in obj["callers"]] if obj.get("callers") is not None else None, + "imported_function_id": obj.get("imported_function_id"), + "is_function": obj.get("is_function"), + "library_name": obj.get("library_name"), + "library_version": obj.get("library_version"), + "name": obj.get("name"), + "original_name": obj.get("original_name"), + "stub_vaddrs": obj.get("stub_vaddrs"), + "vaddr": obj.get("vaddr") + }) + # 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/imported_function_entry.py b/revengai/models/imported_function_entry.py new file mode 100644 index 0000000..4919822 --- /dev/null +++ b/revengai/models/imported_function_entry.py @@ -0,0 +1,118 @@ +# 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ImportedFunctionEntry(BaseModel): + """ + ImportedFunctionEntry + """ # noqa: E501 + imported_function_id: StrictInt + is_function: StrictBool = Field(description="False for imported data symbols.") + library_name: StrictStr = Field(description="Library the symbol is imported from. '' for unattributed imports.") + library_version: Optional[StrictStr] = Field(default=None, description="Versioned symbol tag, when the loader records one.") + name: StrictStr + original_name: Optional[StrictStr] = Field(default=None, description="Pre-demangling / pre-aliasing name, when it differs from name.") + stub_vaddrs: Optional[List[StrictInt]] = Field(description="PLT/stub addresses that resolve external call edges (function_call_edges.callee_vaddr) to this import. Use these to link a caller's external callee to this import.") + vaddr: Optional[StrictInt] = Field(default=None, description="Virtual address of the import, when known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["imported_function_id", "is_function", "library_name", "library_version", "name", "original_name", "stub_vaddrs", "vaddr"] + + 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 ImportedFunctionEntry 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 stub_vaddrs (nullable) is None + # and model_fields_set contains the field + if self.stub_vaddrs is None and "stub_vaddrs" in self.model_fields_set: + _dict['stub_vaddrs'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImportedFunctionEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imported_function_id": obj.get("imported_function_id"), + "is_function": obj.get("is_function"), + "library_name": obj.get("library_name"), + "library_version": obj.get("library_version"), + "name": obj.get("name"), + "original_name": obj.get("original_name"), + "stub_vaddrs": obj.get("stub_vaddrs"), + "vaddr": obj.get("vaddr") + }) + # 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/list_archive_contents_output_body.py b/revengai/models/list_archive_contents_output_body.py new file mode 100644 index 0000000..cd22a7b --- /dev/null +++ b/revengai/models/list_archive_contents_output_body.py @@ -0,0 +1,120 @@ +# 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, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.archive_content_entry import ArchiveContentEntry +from typing import Optional, Set +from typing_extensions import Self + +class ListArchiveContentsOutputBody(BaseModel): + """ + ListArchiveContentsOutputBody + """ # noqa: E501 + entries: Optional[List[ArchiveContentEntry]] = Field(description="Files inside the archive, with paths relative to the archive root") + has_next: StrictBool = Field(description="Whether a further page of entries follows this one.") + page: StrictInt = Field(description="Page number of this response (1-indexed).") + page_size: StrictInt = Field(description="Number of entries per page.") + total_count: StrictInt = Field(description="Total number of file entries in the archive, ignoring pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["entries", "has_next", "page", "page_size", "total_count"] + + 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 ListArchiveContentsOutputBody 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 entries (list) + _items = [] + if self.entries: + for _item_entries in self.entries: + if _item_entries: + _items.append(_item_entries.to_dict()) + _dict['entries'] = _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 entries (nullable) is None + # and model_fields_set contains the field + if self.entries is None and "entries" in self.model_fields_set: + _dict['entries'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListArchiveContentsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "entries": [ArchiveContentEntry.from_dict(_item) for _item in obj["entries"]] if obj.get("entries") is not None else None, + "has_next": obj.get("has_next"), + "page": obj.get("page"), + "page_size": obj.get("page_size"), + "total_count": obj.get("total_count") + }) + # 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/list_imported_functions_output_body.py b/revengai/models/list_imported_functions_output_body.py new file mode 100644 index 0000000..9db1989 --- /dev/null +++ b/revengai/models/list_imported_functions_output_body.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, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.imported_function_entry import ImportedFunctionEntry +from typing import Optional, Set +from typing_extensions import Self + +class ListImportedFunctionsOutputBody(BaseModel): + """ + ListImportedFunctionsOutputBody + """ # noqa: E501 + imported_functions: Optional[List[ImportedFunctionEntry]] + total_count: StrictInt = Field(description="Total imported functions for the binary, ignoring pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["imported_functions", "total_count"] + + 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 ListImportedFunctionsOutputBody 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 imported_functions (list) + _items = [] + if self.imported_functions: + for _item_imported_functions in self.imported_functions: + if _item_imported_functions: + _items.append(_item_imported_functions.to_dict()) + _dict['imported_functions'] = _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 imported_functions (nullable) is None + # and model_fields_set contains the field + if self.imported_functions is None and "imported_functions" in self.model_fields_set: + _dict['imported_functions'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListImportedFunctionsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imported_functions": [ImportedFunctionEntry.from_dict(_item) for _item in obj["imported_functions"]] if obj.get("imported_functions") is not None else None, + "total_count": obj.get("total_count") + }) + # 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/start_matching_for_analysis_input_body.py b/revengai/models/start_matching_for_analysis_input_body.py index cb98e22..8be8f24 100644 --- a/revengai/models/start_matching_for_analysis_input_body.py +++ b/revengai/models/start_matching_for_analysis_input_body.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated from revengai.models.match_filters import MatchFilters @@ -29,9 +29,10 @@ class StartMatchingForAnalysisInputBody(BaseModel): """ # noqa: E501 filters: Optional[MatchFilters] = Field(default=None, description="Narrow the candidate pool.") min_similarity: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Similarity floor as a percentage. Defaults to 90.") + no_cache: Optional[StrictBool] = Field(default=None, description="By default a completed matching run for the same request is reused (response status=COMPLETED, no new run). Set true to force a fresh run.") results_per_function: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Max matches returned per source function. Defaults to 1.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["filters", "min_similarity", "results_per_function"] + __properties: ClassVar[List[str]] = ["filters", "min_similarity", "no_cache", "results_per_function"] model_config = ConfigDict( populate_by_name=True, @@ -96,6 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "filters": MatchFilters.from_dict(obj["filters"]) if obj.get("filters") is not None else None, "min_similarity": obj.get("min_similarity"), + "no_cache": obj.get("no_cache"), "results_per_function": obj.get("results_per_function") }) # store additional fields in additional_properties diff --git a/revengai/models/start_matching_for_functions_input_body.py b/revengai/models/start_matching_for_functions_input_body.py index 20aaaff..a7d571f 100644 --- a/revengai/models/start_matching_for_functions_input_body.py +++ b/revengai/models/start_matching_for_functions_input_body.py @@ -30,10 +30,11 @@ class StartMatchingForFunctionsInputBody(BaseModel): filters: Optional[MatchFilters] = Field(default=None, description="Narrow the candidate pool.") function_ids: Optional[Annotated[List[StrictInt], Field(min_length=1)]] = Field(description="Source function IDs to match against the rest of the corpus.") min_similarity: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Similarity floor as a percentage. Defaults to 90.") + no_cache: Optional[StrictBool] = Field(default=None, description="By default a completed matching run for the same request is reused (response status=COMPLETED, no new run). Set true to force a fresh run.") results_per_function: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Max matches returned per source function. Defaults to 1.") use_canonical_names: Optional[StrictBool] = Field(default=None, description="Collapse near-duplicate candidate names into canonical buckets and return per-name confidences (the response 'confidences' array). Adds a canonicalisation step; defaults to false.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["filters", "function_ids", "min_similarity", "results_per_function", "use_canonical_names"] + __properties: ClassVar[List[str]] = ["filters", "function_ids", "min_similarity", "no_cache", "results_per_function", "use_canonical_names"] model_config = ConfigDict( populate_by_name=True, @@ -104,6 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "filters": MatchFilters.from_dict(obj["filters"]) if obj.get("filters") is not None else None, "function_ids": obj.get("function_ids"), "min_similarity": obj.get("min_similarity"), + "no_cache": obj.get("no_cache"), "results_per_function": obj.get("results_per_function"), "use_canonical_names": obj.get("use_canonical_names") }) diff --git a/revengai/models/start_matching_output_body.py b/revengai/models/start_matching_output_body.py index 3d5b18c..7a3a3ec 100644 --- a/revengai/models/start_matching_output_body.py +++ b/revengai/models/start_matching_output_body.py @@ -26,13 +26,14 @@ class StartMatchingOutputBody(BaseModel): """ StartMatchingOutputBody """ # noqa: E501 + match_id: StrictStr = Field(description="Opaque token for this matching run. Pass it to the GET/status endpoints' match_id query parameter to fetch this exact run.") messages: Optional[List[ProgressMessage]] = Field(description="Log messages emitted during execution") status: StrictStr = Field(description="Current workflow status") step: StrictStr = Field(description="Name of the current step") step_index: StrictInt = Field(description="Zero-based index of the current step") steps_total: StrictInt = Field(description="Total number of steps in the workflow") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["messages", "status", "step", "step_index", "steps_total"] + __properties: ClassVar[List[str]] = ["match_id", "messages", "status", "step", "step_index", "steps_total"] @field_validator('status') def status_validate_enum(cls, value): @@ -111,6 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "match_id": obj.get("match_id"), "messages": [ProgressMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None, "status": obj.get("status"), "step": obj.get("step"), diff --git a/revengai/models/trigger_dynamic_execution_input_body.py b/revengai/models/trigger_dynamic_execution_input_body.py index 5540972..0f41649 100644 --- a/revengai/models/trigger_dynamic_execution_input_body.py +++ b/revengai/models/trigger_dynamic_execution_input_body.py @@ -26,11 +26,24 @@ class TriggerDynamicExecutionInputBody(BaseModel): """ TriggerDynamicExecutionInputBody """ # noqa: E501 + archive_entry_path: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = Field(default=None, description="Relative path of the entry inside the archive to execute") + archive_password: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="Password for an encrypted archive") + archive_sha_256_hash: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="SHA-256 of the archive object to send to the sandbox instead of the analysed binary") command_line_args: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = Field(default=None, description="Command-line arguments passed to the sample when the sandbox launches it") start_method: Optional[StrictStr] = Field(default=None, description="How the sandbox launches the sample. Defaults to the sandbox's standard behaviour when omitted.") timeout: Optional[StrictInt] = Field(default=120, description="Maximum sandbox execution time in seconds") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["command_line_args", "start_method", "timeout"] + __properties: ClassVar[List[str]] = ["archive_entry_path", "archive_password", "archive_sha_256_hash", "command_line_args", "start_method", "timeout"] + + @field_validator('archive_sha_256_hash') + def archive_sha_256_hash_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-fA-F0-9]{64}$", value): + raise ValueError(r"must validate the regular expression /^[a-fA-F0-9]{64}$/") + return value @field_validator('start_method') def start_method_validate_enum(cls, value): @@ -110,6 +123,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "archive_entry_path": obj.get("archive_entry_path"), + "archive_password": obj.get("archive_password"), + "archive_sha_256_hash": obj.get("archive_sha_256_hash"), "command_line_args": obj.get("command_line_args"), "start_method": obj.get("start_method"), "timeout": obj.get("timeout") if obj.get("timeout") is not None else 120