diff --git a/.sdk-version b/.sdk-version index 26f4e1e..6ec2404 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v1.79.0 +v1.80.0 diff --git a/README.md b/README.md index ff45971..9207fb6 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,6 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**get_analysis_params**](docs/AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information *AnalysesCoreApi* | [**get_analysis_status**](docs/AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis *AnalysesCoreApi* | [**get_binary_ann**](docs/AnalysesCoreApi.md#get_binary_ann) | **POST** /v2/binary_ann/{analysis_id} | Binary Ann -*AnalysesCoreApi* | [**get_symbol_info_for_binary**](docs/AnalysesCoreApi.md#get_symbol_info_for_binary) | **GET** /v2/analyses/symbol_info/{binary_id} | Gets the symbol information of a binary *AnalysesCoreApi* | [**list_analyses**](docs/AnalysesCoreApi.md#list_analyses) | **GET** /v2/analyses/list | Gets the most recent analyses *AnalysesCoreApi* | [**lookup_binary_id**](docs/AnalysesCoreApi.md#lookup_binary_id) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID *AnalysesCoreApi* | [**requeue_analysis**](docs/AnalysesCoreApi.md#requeue_analysis) | **POST** /v2/analyses/{analysis_id}/requeue | Requeue Analysis @@ -265,7 +264,6 @@ Class | Method | HTTP request | Description - [BaseResponseSecurityChecksResponse](docs/BaseResponseSecurityChecksResponse.md) - [BaseResponseStatus](docs/BaseResponseStatus.md) - [BaseResponseStr](docs/BaseResponseStr.md) - - [BaseResponseSymbolsInfo](docs/BaseResponseSymbolsInfo.md) - [BaseResponseTTPS](docs/BaseResponseTTPS.md) - [BaseResponseTagSearchResponse](docs/BaseResponseTagSearchResponse.md) - [BaseResponseTaskResponse](docs/BaseResponseTaskResponse.md) @@ -284,7 +282,6 @@ Class | Method | HTTP request | Description - [BinaryTaskStatus](docs/BinaryTaskStatus.md) - [Block](docs/Block.md) - [BlockCommentsGenerationForFunctionResponse](docs/BlockCommentsGenerationForFunctionResponse.md) - - [Boundary](docs/Boundary.md) - [BoxPlotConfidence](docs/BoxPlotConfidence.md) - [CalleeFunctionInfo](docs/CalleeFunctionInfo.md) - [CalleesCallerFunctionsResponse](docs/CalleesCallerFunctionsResponse.md) @@ -443,7 +440,6 @@ Class | Method | HTTP request | Description - [Structure](docs/Structure.md) - [StructureMember](docs/StructureMember.md) - [Symbols](docs/Symbols.md) - - [SymbolsInfo](docs/SymbolsInfo.md) - [TTPS](docs/TTPS.md) - [TTPSAttack](docs/TTPSAttack.md) - [TTPSData](docs/TTPSData.md) diff --git a/docs/ANNFunction.md b/docs/ANNFunction.md index bddf677..e58dac4 100644 --- a/docs/ANNFunction.md +++ b/docs/ANNFunction.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **limit** | **int** | The amount of neighbours per function ID | [optional] [default to 5] **distance** | **float** | The distance between two neighbours | [optional] [default to 0.1] -**analysis_search_ids** | **List[int]** | Perform a search on functions within a list of analyses | [optional] [default to []] -**collection_search_ids** | **List[int]** | Search only within these collections | [optional] [default to []] +**analysis_search_ids** | **List[Optional[int]]** | Perform a search on functions within a list of analyses | [optional] [default to []] +**collection_search_ids** | **List[Optional[int]]** | Search only within these collections | [optional] [default to []] **search_binary_ids** | [**SearchBinaryIds**](SearchBinaryIds.md) | | [optional] **search_function_ids** | [**SearchFunctionIds**](SearchFunctionIds.md) | | [optional] **debug_only** | **bool** | Searches for only functions which are debug | [optional] [default to False] diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index f6e28ac..106db6c 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -13,7 +13,6 @@ Method | HTTP request | Description [**get_analysis_params**](AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information [**get_analysis_status**](AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis [**get_binary_ann**](AnalysesCoreApi.md#get_binary_ann) | **POST** /v2/binary_ann/{analysis_id} | Binary Ann -[**get_symbol_info_for_binary**](AnalysesCoreApi.md#get_symbol_info_for_binary) | **GET** /v2/analyses/symbol_info/{binary_id} | Gets the symbol information of a binary [**list_analyses**](AnalysesCoreApi.md#list_analyses) | **GET** /v2/analyses/list | Gets the most recent analyses [**lookup_binary_id**](AnalysesCoreApi.md#lookup_binary_id) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID [**requeue_analysis**](AnalysesCoreApi.md#requeue_analysis) | **POST** /v2/analyses/{analysis_id}/requeue | Requeue Analysis @@ -771,90 +770,6 @@ 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_symbol_info_for_binary** -> BaseResponseSymbolsInfo get_symbol_info_for_binary(binary_id, authorization=authorization) - -Gets the symbol information of a binary - -Given a binary ID gets the symbol information of the binary - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_symbols_info import BaseResponseSymbolsInfo -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' - -# Enter a context with an instance of the API client -with revengai.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = revengai.AnalysesCoreApi(api_client) - binary_id = 56 # int | - authorization = 'authorization_example' # str | API Key bearer token (optional) - - try: - # Gets the symbol information of a binary - api_response = api_instance.get_symbol_info_for_binary(binary_id, authorization=authorization) - print("The response of AnalysesCoreApi->get_symbol_info_for_binary:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AnalysesCoreApi->get_symbol_info_for_binary: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **binary_id** | **int**| | - **authorization** | **str**| API Key bearer token | [optional] - -### Return type - -[**BaseResponseSymbolsInfo**](BaseResponseSymbolsInfo.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | -**404** | Not Found | - | -**403** | Forbidden | - | - -[[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_analyses** > BaseResponseRecent list_analyses(search_term=search_term, workspace=workspace, status=status, model_name=model_name, dynamic_execution_status=dynamic_execution_status, usernames=usernames, limit=limit, offset=offset, order_by=order_by, order=order, authorization=authorization) diff --git a/docs/BaseResponseSymbolsInfo.md b/docs/BaseResponseSymbolsInfo.md deleted file mode 100644 index aad1f3f..0000000 --- a/docs/BaseResponseSymbolsInfo.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseSymbolsInfo - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**SymbolsInfo**](SymbolsInfo.md) | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_symbols_info import BaseResponseSymbolsInfo - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseSymbolsInfo from a JSON string -base_response_symbols_info_instance = BaseResponseSymbolsInfo.from_json(json) -# print the JSON string representation of the object -print(BaseResponseSymbolsInfo.to_json()) - -# convert the object into a dict -base_response_symbols_info_dict = base_response_symbols_info_instance.to_dict() -# create an instance of BaseResponseSymbolsInfo from a dict -base_response_symbols_info_from_dict = BaseResponseSymbolsInfo.from_dict(base_response_symbols_info_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Basic.md b/docs/Basic.md index 5744ac7..81cab49 100644 --- a/docs/Basic.md +++ b/docs/Basic.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **debug** | **bool** | Whether the current analysis was analysed with debug symbols | **function_count** | **int** | The number of functions in the binary | **is_advanced** | **bool** | Whether the analysis was advanced | +**base_address** | **int** | | ## Example diff --git a/docs/Boundary.md b/docs/Boundary.md deleted file mode 100644 index ca48b6c..0000000 --- a/docs/Boundary.md +++ /dev/null @@ -1,31 +0,0 @@ -# Boundary - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**start_addr** | **int** | Start address of the function boundary | -**end_addr** | **int** | End address of the function boundary | -**name** | **str** | Name of the function | - -## Example - -```python -from revengai.models.boundary import Boundary - -# TODO update the JSON string below -json = "{}" -# create an instance of Boundary from a JSON string -boundary_instance = Boundary.from_json(json) -# print the JSON string representation of the object -print(Boundary.to_json()) - -# convert the object into a dict -boundary_dict = boundary_instance.to_dict() -# create an instance of Boundary from a dict -boundary_from_dict = Boundary.from_dict(boundary_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/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 2a77ee5..adbfe4f 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -893,10 +893,10 @@ with revengai.ApiClient(configuration) as api_client: function_id = 56 # int | limit = 20 # int | Number of similar functions to return (optional) (default to 20) distance = 1.0 # float | Maximum cosine distance (optional) (default to 1.0) - collection_ids = [] # List[int] | Collection filtering by IDs (optional) (default to []) + collection_ids = [] # List[Optional[int]] | Collection filtering by IDs (optional) (default to []) debug = False # bool | Only return matching debug functions (optional) (default to False) debug_types = ["SYSTEM"] # List[str] | If limiting results to functions with debug names, which type of debug names to include? (optional) (default to ["SYSTEM"]) - binary_ids = [] # List[int] | Limit similar functions to specific binaries (optional) (default to []) + binary_ids = [] # List[Optional[int]] | Limit similar functions to specific binaries (optional) (default to []) authorization = 'authorization_example' # str | API Key bearer token (optional) try: @@ -918,10 +918,10 @@ Name | Type | Description | Notes **function_id** | **int**| | **limit** | **int**| Number of similar functions to return | [optional] [default to 20] **distance** | **float**| Maximum cosine distance | [optional] [default to 1.0] - **collection_ids** | [**List[int]**](int.md)| Collection filtering by IDs | [optional] [default to []] + **collection_ids** | [**List[Optional[int]]**](int.md)| Collection filtering by IDs | [optional] [default to []] **debug** | **bool**| Only return matching debug functions | [optional] [default to False] **debug_types** | [**List[str]**](str.md)| If limiting results to functions with debug names, which type of debug names to include? | [optional] [default to ["SYSTEM"]] - **binary_ids** | [**List[int]**](int.md)| Limit similar functions to specific binaries | [optional] [default to []] + **binary_ids** | [**List[Optional[int]]**](int.md)| Limit similar functions to specific binaries | [optional] [default to []] **authorization** | **str**| API Key bearer token | [optional] ### Return type diff --git a/docs/FunctionsDataTypesApi.md b/docs/FunctionsDataTypesApi.md index c194002..f87866d 100644 --- a/docs/FunctionsDataTypesApi.md +++ b/docs/FunctionsDataTypesApi.md @@ -303,7 +303,7 @@ with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) analysis_id = 56 # int | - function_ids = [56] # List[int] | (optional) + function_ids = [56] # List[Optional[int]] | (optional) authorization = 'authorization_example' # str | API Key bearer token (optional) try: @@ -323,7 +323,7 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_id** | **int**| | - **function_ids** | [**List[int]**](int.md)| | [optional] + **function_ids** | [**List[Optional[int]]**](int.md)| | [optional] **authorization** | **str**| API Key bearer token | [optional] ### Return type @@ -386,7 +386,7 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) - function_ids = [56] # List[int] | (optional) + function_ids = [56] # List[Optional[int]] | (optional) authorization = 'authorization_example' # str | API Key bearer token (optional) try: @@ -405,7 +405,7 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_ids** | [**List[int]**](int.md)| | [optional] + **function_ids** | [**List[Optional[int]]**](int.md)| | [optional] **authorization** | **str**| API Key bearer token | [optional] ### Return type diff --git a/docs/SymbolsInfo.md b/docs/SymbolsInfo.md deleted file mode 100644 index 8cd9c4c..0000000 --- a/docs/SymbolsInfo.md +++ /dev/null @@ -1,30 +0,0 @@ -# SymbolsInfo - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**base_addr** | **int** | | [optional] -**provided_boundaries** | [**Boundary**](Boundary.md) | | [optional] - -## Example - -```python -from revengai.models.symbols_info import SymbolsInfo - -# TODO update the JSON string below -json = "{}" -# create an instance of SymbolsInfo from a JSON string -symbols_info_instance = SymbolsInfo.from_json(json) -# print the JSON string representation of the object -print(SymbolsInfo.to_json()) - -# convert the object into a dict -symbols_info_dict = symbols_info_instance.to_dict() -# create an instance of SymbolsInfo from a dict -symbols_info_from_dict = SymbolsInfo.from_dict(symbols_info_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/revengai/__init__.py b/revengai/__init__.py index ee7ba4f..c93a211 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v1.79.0" +__version__ = "v1.80.0" # Define package exports __all__ = [ @@ -150,7 +150,6 @@ "BaseResponseSecurityChecksResponse", "BaseResponseStatus", "BaseResponseStr", - "BaseResponseSymbolsInfo", "BaseResponseTTPS", "BaseResponseTagSearchResponse", "BaseResponseTaskResponse", @@ -169,7 +168,6 @@ "BinaryTaskStatus", "Block", "BlockCommentsGenerationForFunctionResponse", - "Boundary", "BoxPlotConfidence", "CalleeFunctionInfo", "CalleesCallerFunctionsResponse", @@ -328,7 +326,6 @@ "Structure", "StructureMember", "Symbols", - "SymbolsInfo", "TTPS", "TTPSAttack", "TTPSData", @@ -496,7 +493,6 @@ from revengai.models.base_response_security_checks_response import BaseResponseSecurityChecksResponse as BaseResponseSecurityChecksResponse from revengai.models.base_response_status import BaseResponseStatus as BaseResponseStatus from revengai.models.base_response_str import BaseResponseStr as BaseResponseStr -from revengai.models.base_response_symbols_info import BaseResponseSymbolsInfo as BaseResponseSymbolsInfo from revengai.models.base_response_ttps import BaseResponseTTPS as BaseResponseTTPS from revengai.models.base_response_tag_search_response import BaseResponseTagSearchResponse as BaseResponseTagSearchResponse from revengai.models.base_response_task_response import BaseResponseTaskResponse as BaseResponseTaskResponse @@ -515,7 +511,6 @@ from revengai.models.binary_task_status import BinaryTaskStatus as BinaryTaskStatus from revengai.models.block import Block as Block from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse as BlockCommentsGenerationForFunctionResponse -from revengai.models.boundary import Boundary as Boundary from revengai.models.box_plot_confidence import BoxPlotConfidence as BoxPlotConfidence from revengai.models.callee_function_info import CalleeFunctionInfo as CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse as CalleesCallerFunctionsResponse @@ -674,7 +669,6 @@ from revengai.models.structure import Structure as Structure from revengai.models.structure_member import StructureMember as StructureMember from revengai.models.symbols import Symbols as Symbols -from revengai.models.symbols_info import SymbolsInfo as SymbolsInfo from revengai.models.ttps import TTPS as TTPS from revengai.models.ttps_attack import TTPSAttack as TTPSAttack from revengai.models.ttps_data import TTPSData as TTPSData diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 0d2ca33..ca95655 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -36,7 +36,6 @@ from revengai.models.base_response_params import BaseResponseParams from revengai.models.base_response_recent import BaseResponseRecent from revengai.models.base_response_status import BaseResponseStatus -from revengai.models.base_response_symbols_info import BaseResponseSymbolsInfo from revengai.models.base_response_upload_response import BaseResponseUploadResponse from revengai.models.binary_ann_form import BinaryAnnForm from revengai.models.dynamic_execution_status_input import DynamicExecutionStatusInput @@ -2657,291 +2656,6 @@ def _get_binary_ann_serialize( - @validate_call - def get_symbol_info_for_binary( - self, - binary_id: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = 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, - ) -> BaseResponseSymbolsInfo: - """Gets the symbol information of a binary - - Given a binary ID gets the symbol information of the binary - - :param binary_id: (required) - :type binary_id: int - :param authorization: API Key bearer token - :type authorization: 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 - (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._get_symbol_info_for_binary_serialize( - binary_id=binary_id, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseSymbolsInfo", - '422': "BaseResponse", - '404': "BaseResponse", - '403': "BaseResponse", - } - 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 get_symbol_info_for_binary_with_http_info( - self, - binary_id: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = 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[BaseResponseSymbolsInfo]: - """Gets the symbol information of a binary - - Given a binary ID gets the symbol information of the binary - - :param binary_id: (required) - :type binary_id: int - :param authorization: API Key bearer token - :type authorization: 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 - (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._get_symbol_info_for_binary_serialize( - binary_id=binary_id, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseSymbolsInfo", - '422': "BaseResponse", - '404': "BaseResponse", - '403': "BaseResponse", - } - 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 get_symbol_info_for_binary_without_preload_content( - self, - binary_id: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = 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: - """Gets the symbol information of a binary - - Given a binary ID gets the symbol information of the binary - - :param binary_id: (required) - :type binary_id: int - :param authorization: API Key bearer token - :type authorization: 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 - (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._get_symbol_info_for_binary_serialize( - binary_id=binary_id, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseSymbolsInfo", - '422': "BaseResponse", - '404': "BaseResponse", - '403': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_symbol_info_for_binary_serialize( - self, - binary_id, - authorization, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if binary_id is not None: - _path_params['binary_id'] = binary_id - # process the query parameters - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization - # 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' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/analyses/symbol_info/{binary_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_analyses( self, diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index 2957cb6..7b90187 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -3017,10 +3017,10 @@ def get_similar_functions( function_id: StrictInt, limit: Annotated[Optional[StrictInt], Field(description="Number of similar functions to return")] = None, distance: Annotated[Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Maximum cosine distance")] = None, - collection_ids: Annotated[Optional[List[StrictInt]], Field(description="Collection filtering by IDs")] = None, + collection_ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Collection filtering by IDs")] = None, debug: Annotated[Optional[StrictBool], Field(description="Only return matching debug functions")] = None, debug_types: Annotated[Optional[List[StrictStr]], Field(description="If limiting results to functions with debug names, which type of debug names to include?")] = None, - binary_ids: Annotated[Optional[List[StrictInt]], Field(description="Limit similar functions to specific binaries")] = None, + binary_ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Limit similar functions to specific binaries")] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -3045,13 +3045,13 @@ def get_similar_functions( :param distance: Maximum cosine distance :type distance: float :param collection_ids: Collection filtering by IDs - :type collection_ids: List[int] + :type collection_ids: List[Optional[int]] :param debug: Only return matching debug functions :type debug: bool :param debug_types: If limiting results to functions with debug names, which type of debug names to include? :type debug_types: List[str] :param binary_ids: Limit similar functions to specific binaries - :type binary_ids: List[int] + :type binary_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -3112,10 +3112,10 @@ def get_similar_functions_with_http_info( function_id: StrictInt, limit: Annotated[Optional[StrictInt], Field(description="Number of similar functions to return")] = None, distance: Annotated[Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Maximum cosine distance")] = None, - collection_ids: Annotated[Optional[List[StrictInt]], Field(description="Collection filtering by IDs")] = None, + collection_ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Collection filtering by IDs")] = None, debug: Annotated[Optional[StrictBool], Field(description="Only return matching debug functions")] = None, debug_types: Annotated[Optional[List[StrictStr]], Field(description="If limiting results to functions with debug names, which type of debug names to include?")] = None, - binary_ids: Annotated[Optional[List[StrictInt]], Field(description="Limit similar functions to specific binaries")] = None, + binary_ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Limit similar functions to specific binaries")] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -3140,13 +3140,13 @@ def get_similar_functions_with_http_info( :param distance: Maximum cosine distance :type distance: float :param collection_ids: Collection filtering by IDs - :type collection_ids: List[int] + :type collection_ids: List[Optional[int]] :param debug: Only return matching debug functions :type debug: bool :param debug_types: If limiting results to functions with debug names, which type of debug names to include? :type debug_types: List[str] :param binary_ids: Limit similar functions to specific binaries - :type binary_ids: List[int] + :type binary_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -3207,10 +3207,10 @@ def get_similar_functions_without_preload_content( function_id: StrictInt, limit: Annotated[Optional[StrictInt], Field(description="Number of similar functions to return")] = None, distance: Annotated[Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Maximum cosine distance")] = None, - collection_ids: Annotated[Optional[List[StrictInt]], Field(description="Collection filtering by IDs")] = None, + collection_ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Collection filtering by IDs")] = None, debug: Annotated[Optional[StrictBool], Field(description="Only return matching debug functions")] = None, debug_types: Annotated[Optional[List[StrictStr]], Field(description="If limiting results to functions with debug names, which type of debug names to include?")] = None, - binary_ids: Annotated[Optional[List[StrictInt]], Field(description="Limit similar functions to specific binaries")] = None, + binary_ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Limit similar functions to specific binaries")] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -3235,13 +3235,13 @@ def get_similar_functions_without_preload_content( :param distance: Maximum cosine distance :type distance: float :param collection_ids: Collection filtering by IDs - :type collection_ids: List[int] + :type collection_ids: List[Optional[int]] :param debug: Only return matching debug functions :type debug: bool :param debug_types: If limiting results to functions with debug names, which type of debug names to include? :type debug_types: List[str] :param binary_ids: Limit similar functions to specific binaries - :type binary_ids: List[int] + :type binary_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one diff --git a/revengai/api/functions_data_types_api.py b/revengai/api/functions_data_types_api.py index f0dc94c..3676057 100644 --- a/revengai/api/functions_data_types_api.py +++ b/revengai/api/functions_data_types_api.py @@ -940,7 +940,7 @@ def _get_function_data_types_serialize( def list_function_data_types_for_analysis( self, analysis_id: StrictInt, - function_ids: Optional[List[StrictInt]] = None, + function_ids: Optional[List[Optional[StrictInt]]] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -962,7 +962,7 @@ def list_function_data_types_for_analysis( :param analysis_id: (required) :type analysis_id: int :param function_ids: - :type function_ids: List[int] + :type function_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -1016,7 +1016,7 @@ def list_function_data_types_for_analysis( def list_function_data_types_for_analysis_with_http_info( self, analysis_id: StrictInt, - function_ids: Optional[List[StrictInt]] = None, + function_ids: Optional[List[Optional[StrictInt]]] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -1038,7 +1038,7 @@ def list_function_data_types_for_analysis_with_http_info( :param analysis_id: (required) :type analysis_id: int :param function_ids: - :type function_ids: List[int] + :type function_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -1092,7 +1092,7 @@ def list_function_data_types_for_analysis_with_http_info( def list_function_data_types_for_analysis_without_preload_content( self, analysis_id: StrictInt, - function_ids: Optional[List[StrictInt]] = None, + function_ids: Optional[List[Optional[StrictInt]]] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -1114,7 +1114,7 @@ def list_function_data_types_for_analysis_without_preload_content( :param analysis_id: (required) :type analysis_id: int :param function_ids: - :type function_ids: List[int] + :type function_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -1236,7 +1236,7 @@ def _list_function_data_types_for_analysis_serialize( @validate_call def list_function_data_types_for_functions( self, - function_ids: Optional[List[StrictInt]] = None, + function_ids: Optional[List[Optional[StrictInt]]] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -1256,7 +1256,7 @@ def list_function_data_types_for_functions( Returns data types for multiple function IDs :param function_ids: - :type function_ids: List[int] + :type function_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -1308,7 +1308,7 @@ def list_function_data_types_for_functions( @validate_call def list_function_data_types_for_functions_with_http_info( self, - function_ids: Optional[List[StrictInt]] = None, + function_ids: Optional[List[Optional[StrictInt]]] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -1328,7 +1328,7 @@ def list_function_data_types_for_functions_with_http_info( Returns data types for multiple function IDs :param function_ids: - :type function_ids: List[int] + :type function_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one @@ -1380,7 +1380,7 @@ def list_function_data_types_for_functions_with_http_info( @validate_call def list_function_data_types_for_functions_without_preload_content( self, - function_ids: Optional[List[StrictInt]] = None, + function_ids: Optional[List[Optional[StrictInt]]] = None, authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, _request_timeout: Union[ None, @@ -1400,7 +1400,7 @@ def list_function_data_types_for_functions_without_preload_content( Returns data types for multiple function IDs :param function_ids: - :type function_ids: List[int] + :type function_ids: List[Optional[int]] :param authorization: API Key bearer token :type authorization: str :param _request_timeout: timeout setting for this request. If one diff --git a/revengai/api_client.py b/revengai/api_client.py index fae567f..232d350 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/v1.79.0/python' + self.user_agent = 'OpenAPI-Generator/v1.80.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 999fe39..f05c1c6 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -529,8 +529,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v1.79.0\n"\ - "SDK Package Version: v1.79.0".\ + "Version of the API: v1.80.0\n"\ + "SDK Package Version: v1.80.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 efc2f45..c489150 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -116,7 +116,6 @@ from revengai.models.base_response_security_checks_response import BaseResponseSecurityChecksResponse from revengai.models.base_response_status import BaseResponseStatus from revengai.models.base_response_str import BaseResponseStr -from revengai.models.base_response_symbols_info import BaseResponseSymbolsInfo from revengai.models.base_response_ttps import BaseResponseTTPS from revengai.models.base_response_tag_search_response import BaseResponseTagSearchResponse from revengai.models.base_response_task_response import BaseResponseTaskResponse @@ -135,7 +134,6 @@ from revengai.models.binary_task_status import BinaryTaskStatus from revengai.models.block import Block from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse -from revengai.models.boundary import Boundary from revengai.models.box_plot_confidence import BoxPlotConfidence from revengai.models.callee_function_info import CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse @@ -294,7 +292,6 @@ from revengai.models.structure import Structure from revengai.models.structure_member import StructureMember from revengai.models.symbols import Symbols -from revengai.models.symbols_info import SymbolsInfo from revengai.models.ttps import TTPS from revengai.models.ttps_attack import TTPSAttack from revengai.models.ttps_data import TTPSData diff --git a/revengai/models/ann_function.py b/revengai/models/ann_function.py index 5801ea3..2fa3289 100644 --- a/revengai/models/ann_function.py +++ b/revengai/models/ann_function.py @@ -30,8 +30,8 @@ class ANNFunction(BaseModel): """ # noqa: E501 limit: Optional[StrictInt] = Field(default=5, description="The amount of neighbours per function ID") distance: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.1, description="The distance between two neighbours") - analysis_search_ids: Optional[List[StrictInt]] = Field(default=None, description="Perform a search on functions within a list of analyses") - collection_search_ids: Optional[Annotated[List[StrictInt], Field(max_length=5)]] = Field(default=None, description="Search only within these collections") + analysis_search_ids: Optional[List[Optional[StrictInt]]] = Field(default=None, description="Perform a search on functions within a list of analyses") + collection_search_ids: Optional[Annotated[List[Optional[StrictInt]], Field(max_length=5)]] = Field(default=None, description="Search only within these collections") search_binary_ids: Optional[SearchBinaryIds] = None search_function_ids: Optional[SearchFunctionIds] = None debug_only: Optional[StrictBool] = Field(default=False, description="Searches for only functions which are debug") diff --git a/revengai/models/base_response_symbols_info.py b/revengai/models/base_response_symbols_info.py deleted file mode 100644 index 4d7e9b2..0000000 --- a/revengai/models/base_response_symbols_info.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - 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, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.error_model import ErrorModel -from revengai.models.meta_model import MetaModel -from revengai.models.symbols_info import SymbolsInfo -from typing import Optional, Set -from typing_extensions import Self - -class BaseResponseSymbolsInfo(BaseModel): - """ - BaseResponseSymbolsInfo - """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[SymbolsInfo] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] - - 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 BaseResponseSymbolsInfo 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. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data - if self.data: - _dict['data'] = self.data.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseSymbolsInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": SymbolsInfo.from_dict(obj["data"]) if obj.get("data") is not None else None, - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None - }) - return _obj - - diff --git a/revengai/models/basic.py b/revengai/models/basic.py index 7906f54..c9287bb 100644 --- a/revengai/models/basic.py +++ b/revengai/models/basic.py @@ -18,7 +18,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -37,7 +37,8 @@ class Basic(BaseModel): debug: StrictBool = Field(description="Whether the current analysis was analysed with debug symbols") function_count: StrictInt = Field(description="The number of functions in the binary") is_advanced: StrictBool = Field(description="Whether the analysis was advanced") - __properties: ClassVar[List[str]] = ["binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "owner_username", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced"] + base_address: Optional[StrictInt] + __properties: ClassVar[List[str]] = ["binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "owner_username", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced", "base_address"] model_config = ConfigDict( populate_by_name=True, @@ -78,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if base_address (nullable) is None + # and model_fields_set contains the field + if self.base_address is None and "base_address" in self.model_fields_set: + _dict['base_address'] = None + return _dict @classmethod @@ -100,7 +106,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_owner": obj.get("is_owner"), "debug": obj.get("debug"), "function_count": obj.get("function_count"), - "is_advanced": obj.get("is_advanced") + "is_advanced": obj.get("is_advanced"), + "base_address": obj.get("base_address") }) return _obj diff --git a/revengai/models/boundary.py b/revengai/models/boundary.py deleted file mode 100644 index 9390d72..0000000 --- a/revengai/models/boundary.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - 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 Boundary(BaseModel): - """ - Boundary - """ # noqa: E501 - start_addr: StrictInt = Field(description="Start address of the function boundary") - end_addr: StrictInt = Field(description="End address of the function boundary") - name: StrictStr = Field(description="Name of the function") - __properties: ClassVar[List[str]] = ["start_addr", "end_addr", "name"] - - 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 Boundary 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. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Boundary from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "start_addr": obj.get("start_addr"), - "end_addr": obj.get("end_addr"), - "name": obj.get("name") - }) - return _obj - - diff --git a/revengai/models/symbols_info.py b/revengai/models/symbols_info.py deleted file mode 100644 index 110a2a0..0000000 --- a/revengai/models/symbols_info.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.boundary import Boundary -from typing import Optional, Set -from typing_extensions import Self - -class SymbolsInfo(BaseModel): - """ - SymbolsInfo - """ # noqa: E501 - base_addr: Optional[StrictInt] = None - provided_boundaries: Optional[Boundary] = None - __properties: ClassVar[List[str]] = ["base_addr", "provided_boundaries"] - - 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 SymbolsInfo 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. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of provided_boundaries - if self.provided_boundaries: - _dict['provided_boundaries'] = self.provided_boundaries.to_dict() - # set to None if base_addr (nullable) is None - # and model_fields_set contains the field - if self.base_addr is None and "base_addr" in self.model_fields_set: - _dict['base_addr'] = None - - # set to None if provided_boundaries (nullable) is None - # and model_fields_set contains the field - if self.provided_boundaries is None and "provided_boundaries" in self.model_fields_set: - _dict['provided_boundaries'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SymbolsInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "base_addr": obj.get("base_addr"), - "provided_boundaries": Boundary.from_dict(obj["provided_boundaries"]) if obj.get("provided_boundaries") is not None else None - }) - return _obj - - diff --git a/test/test_analyses_core_api.py b/test/test_analyses_core_api.py index 6bb7269..8da5b60 100644 --- a/test/test_analyses_core_api.py +++ b/test/test_analyses_core_api.py @@ -88,13 +88,6 @@ def test_get_binary_ann(self) -> None: """ pass - def test_get_symbol_info_for_binary(self) -> None: - """Test case for get_symbol_info_for_binary - - Gets the symbol information of a binary - """ - pass - def test_list_analyses(self) -> None: """Test case for list_analyses diff --git a/test/test_base_response_basic.py b/test/test_base_response_basic.py index a0dcb85..4cf3746 100644 --- a/test/test_base_response_basic.py +++ b/test/test_base_response_basic.py @@ -46,7 +46,8 @@ def make_instance(self, include_optional) -> BaseResponseBasic: is_owner = True, debug = True, function_count = 56, - is_advanced = True, ), + is_advanced = True, + base_address = 56, ), message = '', errors = [ revengai.models.error_model.ErrorModel( diff --git a/test/test_base_response_symbols_info.py b/test/test_base_response_symbols_info.py deleted file mode 100644 index 51dfc2b..0000000 --- a/test/test_base_response_symbols_info.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from revengai.models.base_response_symbols_info import BaseResponseSymbolsInfo - -class TestBaseResponseSymbolsInfo(unittest.TestCase): - """BaseResponseSymbolsInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> BaseResponseSymbolsInfo: - """Test BaseResponseSymbolsInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BaseResponseSymbolsInfo` - """ - model = BaseResponseSymbolsInfo() - if include_optional: - return BaseResponseSymbolsInfo( - status = True, - data = revengai.models.symbols_info.SymbolsInfo( - base_addr = 56, - provided_boundaries = revengai.models.boundary.Boundary( - start_addr = 56, - end_addr = 56, - name = '', ), ), - message = '', - errors = [ - revengai.models.error_model.ErrorModel( - code = '', - message = '', ) - ], - meta = revengai.models.meta_model.MetaModel( - pagination = revengai.models.pagination_model.PaginationModel( - page_size = 56, - page_number = 56, - has_next_page = True, ), ) - ) - else: - return BaseResponseSymbolsInfo( - ) - """ - - def testBaseResponseSymbolsInfo(self): - """Test BaseResponseSymbolsInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_basic.py b/test/test_basic.py index 7c0ca01..23ee497 100644 --- a/test/test_basic.py +++ b/test/test_basic.py @@ -44,7 +44,8 @@ def make_instance(self, include_optional) -> Basic: is_owner = True, debug = True, function_count = 56, - is_advanced = True + is_advanced = True, + base_address = 56 ) else: return Basic( @@ -59,6 +60,7 @@ def make_instance(self, include_optional) -> Basic: debug = True, function_count = 56, is_advanced = True, + base_address = 56, ) """ diff --git a/test/test_boundary.py b/test/test_boundary.py deleted file mode 100644 index 6f935b9..0000000 --- a/test/test_boundary.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from revengai.models.boundary import Boundary - -class TestBoundary(unittest.TestCase): - """Boundary unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Boundary: - """Test Boundary - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Boundary` - """ - model = Boundary() - if include_optional: - return Boundary( - start_addr = 56, - end_addr = 56, - name = '' - ) - else: - return Boundary( - start_addr = 56, - end_addr = 56, - name = '', - ) - """ - - def testBoundary(self): - """Test Boundary""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_symbols_info.py b/test/test_symbols_info.py deleted file mode 100644 index 73631a0..0000000 --- a/test/test_symbols_info.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from revengai.models.symbols_info import SymbolsInfo - -class TestSymbolsInfo(unittest.TestCase): - """SymbolsInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> SymbolsInfo: - """Test SymbolsInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `SymbolsInfo` - """ - model = SymbolsInfo() - if include_optional: - return SymbolsInfo( - base_addr = 56, - provided_boundaries = revengai.models.boundary.Boundary( - start_addr = 56, - end_addr = 56, - name = '', ) - ) - else: - return SymbolsInfo( - ) - """ - - def testSymbolsInfo(self): - """Test SymbolsInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main()