revengai 1.96.1__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of revengai might be problematic. Click here for more details.
- revengai/__init__.py +3 -11
- revengai/api/analyses_core_api.py +16 -295
- revengai/api_client.py +1 -1
- revengai/configuration.py +2 -2
- revengai/models/__init__.py +1 -5
- revengai/models/{app_api_rest_v2_similarity_schema_ann_function.py → ann_function.py} +18 -16
- revengai/models/app_api_rest_v2_functions_responses_function.py +2 -2
- revengai/models/app_api_rest_v2_functions_types_function.py +4 -2
- revengai/models/function_matching_request.py +1 -1
- revengai/models/matched_function_suggestion.py +11 -4
- {revengai-1.96.1.dist-info → revengai-2.0.0.dist-info}/METADATA +2 -7
- {revengai-1.96.1.dist-info → revengai-2.0.0.dist-info}/RECORD +14 -18
- revengai/models/app_api_rest_v1_ann_schema_ann_function.py +0 -134
- revengai/models/function_batch_ann.py +0 -105
- revengai/models/search_binary_ids.py +0 -137
- revengai/models/search_function_ids.py +0 -137
- {revengai-1.96.1.dist-info → revengai-2.0.0.dist-info}/WHEEL +0 -0
- {revengai-1.96.1.dist-info → revengai-2.0.0.dist-info}/licenses/LICENSE.md +0 -0
revengai/__init__.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
""" # noqa: E501
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
__version__ = "
|
|
16
|
+
__version__ = "v2.0.0"
|
|
17
17
|
|
|
18
18
|
# Define package exports
|
|
19
19
|
__all__ = [
|
|
@@ -45,6 +45,7 @@ __all__ = [
|
|
|
45
45
|
"ApiKeyError",
|
|
46
46
|
"ApiAttributeError",
|
|
47
47
|
"ApiException",
|
|
48
|
+
"ANNFunction",
|
|
48
49
|
"Addr",
|
|
49
50
|
"AiDecompilationRating",
|
|
50
51
|
"AiUnstripRequest",
|
|
@@ -63,14 +64,12 @@ __all__ = [
|
|
|
63
64
|
"AnalysisUpdateRequest",
|
|
64
65
|
"AnalysisUpdateTagsRequest",
|
|
65
66
|
"AnalysisUpdateTagsResponse",
|
|
66
|
-
"AppApiRestV1AnnSchemaANNFunction",
|
|
67
67
|
"AppApiRestV2AnalysesEnumsDynamicExecutionStatus",
|
|
68
68
|
"AppApiRestV2AnalysesEnumsOrderBy",
|
|
69
69
|
"AppApiRestV2AnalysesResponsesTagItem",
|
|
70
70
|
"AppApiRestV2CollectionsEnumsOrderBy",
|
|
71
71
|
"AppApiRestV2FunctionsResponsesFunction",
|
|
72
72
|
"AppApiRestV2FunctionsTypesFunction",
|
|
73
|
-
"AppApiRestV2SimilaritySchemaANNFunction",
|
|
74
73
|
"AppServicesBinaryAnnSchemaTagItem",
|
|
75
74
|
"AppServicesDynamicExecutionSchemasDynamicExecutionStatus",
|
|
76
75
|
"Argument",
|
|
@@ -216,7 +215,6 @@ __all__ = [
|
|
|
216
215
|
"FileHashes",
|
|
217
216
|
"FileMetadata",
|
|
218
217
|
"Filters",
|
|
219
|
-
"FunctionBatchAnn",
|
|
220
218
|
"FunctionBlockDestinationResponse",
|
|
221
219
|
"FunctionBlockResponse",
|
|
222
220
|
"FunctionBlocksResponse",
|
|
@@ -307,8 +305,6 @@ __all__ = [
|
|
|
307
305
|
"SBOMPackage",
|
|
308
306
|
"SandboxOptions",
|
|
309
307
|
"ScrapeThirdPartyConfig",
|
|
310
|
-
"SearchBinaryIds",
|
|
311
|
-
"SearchFunctionIds",
|
|
312
308
|
"SectionModel",
|
|
313
309
|
"SecurityChecksResponse",
|
|
314
310
|
"SecurityChecksResult",
|
|
@@ -387,6 +383,7 @@ from revengai.exceptions import ApiAttributeError as ApiAttributeError
|
|
|
387
383
|
from revengai.exceptions import ApiException as ApiException
|
|
388
384
|
|
|
389
385
|
# import models into sdk package
|
|
386
|
+
from revengai.models.ann_function import ANNFunction as ANNFunction
|
|
390
387
|
from revengai.models.addr import Addr as Addr
|
|
391
388
|
from revengai.models.ai_decompilation_rating import AiDecompilationRating as AiDecompilationRating
|
|
392
389
|
from revengai.models.ai_unstrip_request import AiUnstripRequest as AiUnstripRequest
|
|
@@ -405,14 +402,12 @@ from revengai.models.analysis_tags import AnalysisTags as AnalysisTags
|
|
|
405
402
|
from revengai.models.analysis_update_request import AnalysisUpdateRequest as AnalysisUpdateRequest
|
|
406
403
|
from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest as AnalysisUpdateTagsRequest
|
|
407
404
|
from revengai.models.analysis_update_tags_response import AnalysisUpdateTagsResponse as AnalysisUpdateTagsResponse
|
|
408
|
-
from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction as AppApiRestV1AnnSchemaANNFunction
|
|
409
405
|
from revengai.models.app_api_rest_v2_analyses_enums_dynamic_execution_status import AppApiRestV2AnalysesEnumsDynamicExecutionStatus as AppApiRestV2AnalysesEnumsDynamicExecutionStatus
|
|
410
406
|
from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy as AppApiRestV2AnalysesEnumsOrderBy
|
|
411
407
|
from revengai.models.app_api_rest_v2_analyses_responses_tag_item import AppApiRestV2AnalysesResponsesTagItem as AppApiRestV2AnalysesResponsesTagItem
|
|
412
408
|
from revengai.models.app_api_rest_v2_collections_enums_order_by import AppApiRestV2CollectionsEnumsOrderBy as AppApiRestV2CollectionsEnumsOrderBy
|
|
413
409
|
from revengai.models.app_api_rest_v2_functions_responses_function import AppApiRestV2FunctionsResponsesFunction as AppApiRestV2FunctionsResponsesFunction
|
|
414
410
|
from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction as AppApiRestV2FunctionsTypesFunction
|
|
415
|
-
from revengai.models.app_api_rest_v2_similarity_schema_ann_function import AppApiRestV2SimilaritySchemaANNFunction as AppApiRestV2SimilaritySchemaANNFunction
|
|
416
411
|
from revengai.models.app_services_binary_ann_schema_tag_item import AppServicesBinaryAnnSchemaTagItem as AppServicesBinaryAnnSchemaTagItem
|
|
417
412
|
from revengai.models.app_services_dynamic_execution_schemas_dynamic_execution_status import AppServicesDynamicExecutionSchemasDynamicExecutionStatus as AppServicesDynamicExecutionSchemasDynamicExecutionStatus
|
|
418
413
|
from revengai.models.argument import Argument as Argument
|
|
@@ -558,7 +553,6 @@ from revengai.models.file_format import FileFormat as FileFormat
|
|
|
558
553
|
from revengai.models.file_hashes import FileHashes as FileHashes
|
|
559
554
|
from revengai.models.file_metadata import FileMetadata as FileMetadata
|
|
560
555
|
from revengai.models.filters import Filters as Filters
|
|
561
|
-
from revengai.models.function_batch_ann import FunctionBatchAnn as FunctionBatchAnn
|
|
562
556
|
from revengai.models.function_block_destination_response import FunctionBlockDestinationResponse as FunctionBlockDestinationResponse
|
|
563
557
|
from revengai.models.function_block_response import FunctionBlockResponse as FunctionBlockResponse
|
|
564
558
|
from revengai.models.function_blocks_response import FunctionBlocksResponse as FunctionBlocksResponse
|
|
@@ -649,8 +643,6 @@ from revengai.models.sbom import SBOM as SBOM
|
|
|
649
643
|
from revengai.models.sbom_package import SBOMPackage as SBOMPackage
|
|
650
644
|
from revengai.models.sandbox_options import SandboxOptions as SandboxOptions
|
|
651
645
|
from revengai.models.scrape_third_party_config import ScrapeThirdPartyConfig as ScrapeThirdPartyConfig
|
|
652
|
-
from revengai.models.search_binary_ids import SearchBinaryIds as SearchBinaryIds
|
|
653
|
-
from revengai.models.search_function_ids import SearchFunctionIds as SearchFunctionIds
|
|
654
646
|
from revengai.models.section_model import SectionModel as SectionModel
|
|
655
647
|
from revengai.models.security_checks_response import SecurityChecksResponse as SecurityChecksResponse
|
|
656
648
|
from revengai.models.security_checks_result import SecurityChecksResult as SecurityChecksResult
|
|
@@ -18,12 +18,11 @@ from typing_extensions import Annotated
|
|
|
18
18
|
from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr
|
|
19
19
|
from typing import Any, List, Optional, Tuple, Union
|
|
20
20
|
from typing_extensions import Annotated
|
|
21
|
+
from revengai.models.ann_function import ANNFunction
|
|
21
22
|
from revengai.models.analysis_create_request import AnalysisCreateRequest
|
|
22
23
|
from revengai.models.analysis_update_request import AnalysisUpdateRequest
|
|
23
24
|
from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest
|
|
24
|
-
from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction
|
|
25
25
|
from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy
|
|
26
|
-
from revengai.models.app_api_rest_v2_similarity_schema_ann_function import AppApiRestV2SimilaritySchemaANNFunction
|
|
27
26
|
from revengai.models.base_response_analysis_create_response import BaseResponseAnalysisCreateResponse
|
|
28
27
|
from revengai.models.base_response_analysis_detail_response import BaseResponseAnalysisDetailResponse
|
|
29
28
|
from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping
|
|
@@ -40,7 +39,6 @@ from revengai.models.base_response_status import BaseResponseStatus
|
|
|
40
39
|
from revengai.models.base_response_upload_response import BaseResponseUploadResponse
|
|
41
40
|
from revengai.models.binary_ann_form import BinaryAnnForm
|
|
42
41
|
from revengai.models.dynamic_execution_status_input import DynamicExecutionStatusInput
|
|
43
|
-
from revengai.models.function_batch_ann import FunctionBatchAnn
|
|
44
42
|
from revengai.models.model_name import ModelName
|
|
45
43
|
from revengai.models.order import Order
|
|
46
44
|
from revengai.models.re_analysis_form import ReAnalysisForm
|
|
@@ -66,283 +64,6 @@ class AnalysesCoreApi:
|
|
|
66
64
|
self.api_client = api_client
|
|
67
65
|
|
|
68
66
|
|
|
69
|
-
@validate_call
|
|
70
|
-
def batch_symbol_ann(
|
|
71
|
-
self,
|
|
72
|
-
app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction,
|
|
73
|
-
_request_timeout: Union[
|
|
74
|
-
None,
|
|
75
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
76
|
-
Tuple[
|
|
77
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
78
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
79
|
-
]
|
|
80
|
-
] = None,
|
|
81
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
82
|
-
_content_type: Optional[StrictStr] = None,
|
|
83
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
84
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
85
|
-
) -> FunctionBatchAnn:
|
|
86
|
-
"""Batch Symbol ANN using function IDs
|
|
87
|
-
|
|
88
|
-
Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database
|
|
89
|
-
|
|
90
|
-
:param app_api_rest_v1_ann_schema_ann_function: (required)
|
|
91
|
-
:type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction
|
|
92
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
93
|
-
number provided, it will be total request
|
|
94
|
-
timeout. It can also be a pair (tuple) of
|
|
95
|
-
(connection, read) timeouts.
|
|
96
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
97
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
98
|
-
request; this effectively ignores the
|
|
99
|
-
authentication in the spec for a single request.
|
|
100
|
-
:type _request_auth: dict, optional
|
|
101
|
-
:param _content_type: force content-type for the request.
|
|
102
|
-
:type _content_type: str, Optional
|
|
103
|
-
:param _headers: set to override the headers for a single
|
|
104
|
-
request; this effectively ignores the headers
|
|
105
|
-
in the spec for a single request.
|
|
106
|
-
:type _headers: dict, optional
|
|
107
|
-
:param _host_index: set to override the host_index for a single
|
|
108
|
-
request; this effectively ignores the host_index
|
|
109
|
-
in the spec for a single request.
|
|
110
|
-
:type _host_index: int, optional
|
|
111
|
-
:return: Returns the result object.
|
|
112
|
-
""" # noqa: E501
|
|
113
|
-
|
|
114
|
-
_param = self._batch_symbol_ann_serialize(
|
|
115
|
-
app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function,
|
|
116
|
-
_request_auth=_request_auth,
|
|
117
|
-
_content_type=_content_type,
|
|
118
|
-
_headers=_headers,
|
|
119
|
-
_host_index=_host_index
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
123
|
-
'200': "FunctionBatchAnn",
|
|
124
|
-
'422': "BaseResponse",
|
|
125
|
-
}
|
|
126
|
-
response_data = self.api_client.call_api(
|
|
127
|
-
*_param,
|
|
128
|
-
_request_timeout=_request_timeout
|
|
129
|
-
)
|
|
130
|
-
response_data.read()
|
|
131
|
-
return self.api_client.response_deserialize(
|
|
132
|
-
response_data=response_data,
|
|
133
|
-
response_types_map=_response_types_map,
|
|
134
|
-
).data
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
@validate_call
|
|
138
|
-
def batch_symbol_ann_with_http_info(
|
|
139
|
-
self,
|
|
140
|
-
app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction,
|
|
141
|
-
_request_timeout: Union[
|
|
142
|
-
None,
|
|
143
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
144
|
-
Tuple[
|
|
145
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
146
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
147
|
-
]
|
|
148
|
-
] = None,
|
|
149
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
150
|
-
_content_type: Optional[StrictStr] = None,
|
|
151
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
152
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
153
|
-
) -> ApiResponse[FunctionBatchAnn]:
|
|
154
|
-
"""Batch Symbol ANN using function IDs
|
|
155
|
-
|
|
156
|
-
Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database
|
|
157
|
-
|
|
158
|
-
:param app_api_rest_v1_ann_schema_ann_function: (required)
|
|
159
|
-
:type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction
|
|
160
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
161
|
-
number provided, it will be total request
|
|
162
|
-
timeout. It can also be a pair (tuple) of
|
|
163
|
-
(connection, read) timeouts.
|
|
164
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
165
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
166
|
-
request; this effectively ignores the
|
|
167
|
-
authentication in the spec for a single request.
|
|
168
|
-
:type _request_auth: dict, optional
|
|
169
|
-
:param _content_type: force content-type for the request.
|
|
170
|
-
:type _content_type: str, Optional
|
|
171
|
-
:param _headers: set to override the headers for a single
|
|
172
|
-
request; this effectively ignores the headers
|
|
173
|
-
in the spec for a single request.
|
|
174
|
-
:type _headers: dict, optional
|
|
175
|
-
:param _host_index: set to override the host_index for a single
|
|
176
|
-
request; this effectively ignores the host_index
|
|
177
|
-
in the spec for a single request.
|
|
178
|
-
:type _host_index: int, optional
|
|
179
|
-
:return: Returns the result object.
|
|
180
|
-
""" # noqa: E501
|
|
181
|
-
|
|
182
|
-
_param = self._batch_symbol_ann_serialize(
|
|
183
|
-
app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function,
|
|
184
|
-
_request_auth=_request_auth,
|
|
185
|
-
_content_type=_content_type,
|
|
186
|
-
_headers=_headers,
|
|
187
|
-
_host_index=_host_index
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
191
|
-
'200': "FunctionBatchAnn",
|
|
192
|
-
'422': "BaseResponse",
|
|
193
|
-
}
|
|
194
|
-
response_data = self.api_client.call_api(
|
|
195
|
-
*_param,
|
|
196
|
-
_request_timeout=_request_timeout
|
|
197
|
-
)
|
|
198
|
-
response_data.read()
|
|
199
|
-
return self.api_client.response_deserialize(
|
|
200
|
-
response_data=response_data,
|
|
201
|
-
response_types_map=_response_types_map,
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
@validate_call
|
|
206
|
-
def batch_symbol_ann_without_preload_content(
|
|
207
|
-
self,
|
|
208
|
-
app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction,
|
|
209
|
-
_request_timeout: Union[
|
|
210
|
-
None,
|
|
211
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
212
|
-
Tuple[
|
|
213
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
214
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
215
|
-
]
|
|
216
|
-
] = None,
|
|
217
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
218
|
-
_content_type: Optional[StrictStr] = None,
|
|
219
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
220
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
221
|
-
) -> RESTResponseType:
|
|
222
|
-
"""Batch Symbol ANN using function IDs
|
|
223
|
-
|
|
224
|
-
Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database
|
|
225
|
-
|
|
226
|
-
:param app_api_rest_v1_ann_schema_ann_function: (required)
|
|
227
|
-
:type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction
|
|
228
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
229
|
-
number provided, it will be total request
|
|
230
|
-
timeout. It can also be a pair (tuple) of
|
|
231
|
-
(connection, read) timeouts.
|
|
232
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
233
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
234
|
-
request; this effectively ignores the
|
|
235
|
-
authentication in the spec for a single request.
|
|
236
|
-
:type _request_auth: dict, optional
|
|
237
|
-
:param _content_type: force content-type for the request.
|
|
238
|
-
:type _content_type: str, Optional
|
|
239
|
-
:param _headers: set to override the headers for a single
|
|
240
|
-
request; this effectively ignores the headers
|
|
241
|
-
in the spec for a single request.
|
|
242
|
-
:type _headers: dict, optional
|
|
243
|
-
:param _host_index: set to override the host_index for a single
|
|
244
|
-
request; this effectively ignores the host_index
|
|
245
|
-
in the spec for a single request.
|
|
246
|
-
:type _host_index: int, optional
|
|
247
|
-
:return: Returns the result object.
|
|
248
|
-
""" # noqa: E501
|
|
249
|
-
|
|
250
|
-
_param = self._batch_symbol_ann_serialize(
|
|
251
|
-
app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function,
|
|
252
|
-
_request_auth=_request_auth,
|
|
253
|
-
_content_type=_content_type,
|
|
254
|
-
_headers=_headers,
|
|
255
|
-
_host_index=_host_index
|
|
256
|
-
)
|
|
257
|
-
|
|
258
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
259
|
-
'200': "FunctionBatchAnn",
|
|
260
|
-
'422': "BaseResponse",
|
|
261
|
-
}
|
|
262
|
-
response_data = self.api_client.call_api(
|
|
263
|
-
*_param,
|
|
264
|
-
_request_timeout=_request_timeout
|
|
265
|
-
)
|
|
266
|
-
return response_data.response
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
def _batch_symbol_ann_serialize(
|
|
270
|
-
self,
|
|
271
|
-
app_api_rest_v1_ann_schema_ann_function,
|
|
272
|
-
_request_auth,
|
|
273
|
-
_content_type,
|
|
274
|
-
_headers,
|
|
275
|
-
_host_index,
|
|
276
|
-
) -> RequestSerialized:
|
|
277
|
-
|
|
278
|
-
_host = None
|
|
279
|
-
|
|
280
|
-
_collection_formats: Dict[str, str] = {
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
_path_params: Dict[str, str] = {}
|
|
284
|
-
_query_params: List[Tuple[str, str]] = []
|
|
285
|
-
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
286
|
-
_form_params: List[Tuple[str, str]] = []
|
|
287
|
-
_files: Dict[
|
|
288
|
-
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
289
|
-
] = {}
|
|
290
|
-
_body_params: Optional[bytes] = None
|
|
291
|
-
|
|
292
|
-
# process the path parameters
|
|
293
|
-
# process the query parameters
|
|
294
|
-
# process the header parameters
|
|
295
|
-
# process the form parameters
|
|
296
|
-
# process the body parameter
|
|
297
|
-
if app_api_rest_v1_ann_schema_ann_function is not None:
|
|
298
|
-
_body_params = app_api_rest_v1_ann_schema_ann_function
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
# set the HTTP header `Accept`
|
|
302
|
-
if 'Accept' not in _header_params:
|
|
303
|
-
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
304
|
-
[
|
|
305
|
-
'application/json'
|
|
306
|
-
]
|
|
307
|
-
)
|
|
308
|
-
|
|
309
|
-
# set the HTTP header `Content-Type`
|
|
310
|
-
if _content_type:
|
|
311
|
-
_header_params['Content-Type'] = _content_type
|
|
312
|
-
else:
|
|
313
|
-
_default_content_type = (
|
|
314
|
-
self.api_client.select_header_content_type(
|
|
315
|
-
[
|
|
316
|
-
'application/json'
|
|
317
|
-
]
|
|
318
|
-
)
|
|
319
|
-
)
|
|
320
|
-
if _default_content_type is not None:
|
|
321
|
-
_header_params['Content-Type'] = _default_content_type
|
|
322
|
-
|
|
323
|
-
# authentication setting
|
|
324
|
-
_auth_settings: List[str] = [
|
|
325
|
-
'APIKey'
|
|
326
|
-
]
|
|
327
|
-
|
|
328
|
-
return self.api_client.param_serialize(
|
|
329
|
-
method='POST',
|
|
330
|
-
resource_path='/v1/ann/symbol/batch',
|
|
331
|
-
path_params=_path_params,
|
|
332
|
-
query_params=_query_params,
|
|
333
|
-
header_params=_header_params,
|
|
334
|
-
body=_body_params,
|
|
335
|
-
post_params=_form_params,
|
|
336
|
-
files=_files,
|
|
337
|
-
auth_settings=_auth_settings,
|
|
338
|
-
collection_formats=_collection_formats,
|
|
339
|
-
_host=_host,
|
|
340
|
-
_request_auth=_request_auth
|
|
341
|
-
)
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
67
|
@validate_call
|
|
347
68
|
def create_analysis(
|
|
348
69
|
self,
|
|
@@ -900,7 +621,7 @@ class AnalysesCoreApi:
|
|
|
900
621
|
def find_similar_functions_batch(
|
|
901
622
|
self,
|
|
902
623
|
analysis_id: StrictInt,
|
|
903
|
-
|
|
624
|
+
ann_function: ANNFunction,
|
|
904
625
|
_request_timeout: Union[
|
|
905
626
|
None,
|
|
906
627
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -920,8 +641,8 @@ class AnalysesCoreApi:
|
|
|
920
641
|
|
|
921
642
|
:param analysis_id: (required)
|
|
922
643
|
:type analysis_id: int
|
|
923
|
-
:param
|
|
924
|
-
:type
|
|
644
|
+
:param ann_function: (required)
|
|
645
|
+
:type ann_function: ANNFunction
|
|
925
646
|
:param _request_timeout: timeout setting for this request. If one
|
|
926
647
|
number provided, it will be total request
|
|
927
648
|
timeout. It can also be a pair (tuple) of
|
|
@@ -946,7 +667,7 @@ class AnalysesCoreApi:
|
|
|
946
667
|
|
|
947
668
|
_param = self._find_similar_functions_batch_serialize(
|
|
948
669
|
analysis_id=analysis_id,
|
|
949
|
-
|
|
670
|
+
ann_function=ann_function,
|
|
950
671
|
_request_auth=_request_auth,
|
|
951
672
|
_content_type=_content_type,
|
|
952
673
|
_headers=_headers,
|
|
@@ -972,7 +693,7 @@ class AnalysesCoreApi:
|
|
|
972
693
|
def find_similar_functions_batch_with_http_info(
|
|
973
694
|
self,
|
|
974
695
|
analysis_id: StrictInt,
|
|
975
|
-
|
|
696
|
+
ann_function: ANNFunction,
|
|
976
697
|
_request_timeout: Union[
|
|
977
698
|
None,
|
|
978
699
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -992,8 +713,8 @@ class AnalysesCoreApi:
|
|
|
992
713
|
|
|
993
714
|
:param analysis_id: (required)
|
|
994
715
|
:type analysis_id: int
|
|
995
|
-
:param
|
|
996
|
-
:type
|
|
716
|
+
:param ann_function: (required)
|
|
717
|
+
:type ann_function: ANNFunction
|
|
997
718
|
:param _request_timeout: timeout setting for this request. If one
|
|
998
719
|
number provided, it will be total request
|
|
999
720
|
timeout. It can also be a pair (tuple) of
|
|
@@ -1018,7 +739,7 @@ class AnalysesCoreApi:
|
|
|
1018
739
|
|
|
1019
740
|
_param = self._find_similar_functions_batch_serialize(
|
|
1020
741
|
analysis_id=analysis_id,
|
|
1021
|
-
|
|
742
|
+
ann_function=ann_function,
|
|
1022
743
|
_request_auth=_request_auth,
|
|
1023
744
|
_content_type=_content_type,
|
|
1024
745
|
_headers=_headers,
|
|
@@ -1044,7 +765,7 @@ class AnalysesCoreApi:
|
|
|
1044
765
|
def find_similar_functions_batch_without_preload_content(
|
|
1045
766
|
self,
|
|
1046
767
|
analysis_id: StrictInt,
|
|
1047
|
-
|
|
768
|
+
ann_function: ANNFunction,
|
|
1048
769
|
_request_timeout: Union[
|
|
1049
770
|
None,
|
|
1050
771
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -1064,8 +785,8 @@ class AnalysesCoreApi:
|
|
|
1064
785
|
|
|
1065
786
|
:param analysis_id: (required)
|
|
1066
787
|
:type analysis_id: int
|
|
1067
|
-
:param
|
|
1068
|
-
:type
|
|
788
|
+
:param ann_function: (required)
|
|
789
|
+
:type ann_function: ANNFunction
|
|
1069
790
|
:param _request_timeout: timeout setting for this request. If one
|
|
1070
791
|
number provided, it will be total request
|
|
1071
792
|
timeout. It can also be a pair (tuple) of
|
|
@@ -1090,7 +811,7 @@ class AnalysesCoreApi:
|
|
|
1090
811
|
|
|
1091
812
|
_param = self._find_similar_functions_batch_serialize(
|
|
1092
813
|
analysis_id=analysis_id,
|
|
1093
|
-
|
|
814
|
+
ann_function=ann_function,
|
|
1094
815
|
_request_auth=_request_auth,
|
|
1095
816
|
_content_type=_content_type,
|
|
1096
817
|
_headers=_headers,
|
|
@@ -1111,7 +832,7 @@ class AnalysesCoreApi:
|
|
|
1111
832
|
def _find_similar_functions_batch_serialize(
|
|
1112
833
|
self,
|
|
1113
834
|
analysis_id,
|
|
1114
|
-
|
|
835
|
+
ann_function,
|
|
1115
836
|
_request_auth,
|
|
1116
837
|
_content_type,
|
|
1117
838
|
_headers,
|
|
@@ -1139,8 +860,8 @@ class AnalysesCoreApi:
|
|
|
1139
860
|
# process the header parameters
|
|
1140
861
|
# process the form parameters
|
|
1141
862
|
# process the body parameter
|
|
1142
|
-
if
|
|
1143
|
-
_body_params =
|
|
863
|
+
if ann_function is not None:
|
|
864
|
+
_body_params = ann_function
|
|
1144
865
|
|
|
1145
866
|
|
|
1146
867
|
# set the HTTP header `Accept`
|
revengai/api_client.py
CHANGED
|
@@ -90,7 +90,7 @@ class ApiClient:
|
|
|
90
90
|
self.default_headers[header_name] = header_value
|
|
91
91
|
self.cookie = cookie
|
|
92
92
|
# Set default User-Agent.
|
|
93
|
-
self.user_agent = 'OpenAPI-Generator/
|
|
93
|
+
self.user_agent = 'OpenAPI-Generator/v2.0.0/python'
|
|
94
94
|
self.client_side_validation = configuration.client_side_validation
|
|
95
95
|
|
|
96
96
|
def __enter__(self):
|
revengai/configuration.py
CHANGED
|
@@ -529,8 +529,8 @@ conf = revengai.Configuration(
|
|
|
529
529
|
return "Python SDK Debug Report:\n"\
|
|
530
530
|
"OS: {env}\n"\
|
|
531
531
|
"Python Version: {pyversion}\n"\
|
|
532
|
-
"Version of the API:
|
|
533
|
-
"SDK Package Version:
|
|
532
|
+
"Version of the API: v2.0.0\n"\
|
|
533
|
+
"SDK Package Version: v2.0.0".\
|
|
534
534
|
format(env=sys.platform, pyversion=sys.version)
|
|
535
535
|
|
|
536
536
|
def get_host_settings(self) -> List[HostSetting]:
|
revengai/models/__init__.py
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
""" # noqa: E501
|
|
13
13
|
|
|
14
14
|
# import models into model package
|
|
15
|
+
from revengai.models.ann_function import ANNFunction
|
|
15
16
|
from revengai.models.addr import Addr
|
|
16
17
|
from revengai.models.ai_decompilation_rating import AiDecompilationRating
|
|
17
18
|
from revengai.models.ai_unstrip_request import AiUnstripRequest
|
|
@@ -30,14 +31,12 @@ from revengai.models.analysis_tags import AnalysisTags
|
|
|
30
31
|
from revengai.models.analysis_update_request import AnalysisUpdateRequest
|
|
31
32
|
from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest
|
|
32
33
|
from revengai.models.analysis_update_tags_response import AnalysisUpdateTagsResponse
|
|
33
|
-
from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction
|
|
34
34
|
from revengai.models.app_api_rest_v2_analyses_enums_dynamic_execution_status import AppApiRestV2AnalysesEnumsDynamicExecutionStatus
|
|
35
35
|
from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy
|
|
36
36
|
from revengai.models.app_api_rest_v2_analyses_responses_tag_item import AppApiRestV2AnalysesResponsesTagItem
|
|
37
37
|
from revengai.models.app_api_rest_v2_collections_enums_order_by import AppApiRestV2CollectionsEnumsOrderBy
|
|
38
38
|
from revengai.models.app_api_rest_v2_functions_responses_function import AppApiRestV2FunctionsResponsesFunction
|
|
39
39
|
from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction
|
|
40
|
-
from revengai.models.app_api_rest_v2_similarity_schema_ann_function import AppApiRestV2SimilaritySchemaANNFunction
|
|
41
40
|
from revengai.models.app_services_binary_ann_schema_tag_item import AppServicesBinaryAnnSchemaTagItem
|
|
42
41
|
from revengai.models.app_services_dynamic_execution_schemas_dynamic_execution_status import AppServicesDynamicExecutionSchemasDynamicExecutionStatus
|
|
43
42
|
from revengai.models.argument import Argument
|
|
@@ -183,7 +182,6 @@ from revengai.models.file_format import FileFormat
|
|
|
183
182
|
from revengai.models.file_hashes import FileHashes
|
|
184
183
|
from revengai.models.file_metadata import FileMetadata
|
|
185
184
|
from revengai.models.filters import Filters
|
|
186
|
-
from revengai.models.function_batch_ann import FunctionBatchAnn
|
|
187
185
|
from revengai.models.function_block_destination_response import FunctionBlockDestinationResponse
|
|
188
186
|
from revengai.models.function_block_response import FunctionBlockResponse
|
|
189
187
|
from revengai.models.function_blocks_response import FunctionBlocksResponse
|
|
@@ -274,8 +272,6 @@ from revengai.models.sbom import SBOM
|
|
|
274
272
|
from revengai.models.sbom_package import SBOMPackage
|
|
275
273
|
from revengai.models.sandbox_options import SandboxOptions
|
|
276
274
|
from revengai.models.scrape_third_party_config import ScrapeThirdPartyConfig
|
|
277
|
-
from revengai.models.search_binary_ids import SearchBinaryIds
|
|
278
|
-
from revengai.models.search_function_ids import SearchFunctionIds
|
|
279
275
|
from revengai.models.section_model import SectionModel
|
|
280
276
|
from revengai.models.security_checks_response import SecurityChecksResponse
|
|
281
277
|
from revengai.models.security_checks_result import SecurityChecksResult
|
|
@@ -19,21 +19,19 @@ import json
|
|
|
19
19
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt
|
|
20
20
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
|
-
from revengai.models.search_binary_ids import SearchBinaryIds
|
|
23
|
-
from revengai.models.search_function_ids import SearchFunctionIds
|
|
24
22
|
from typing import Optional, Set
|
|
25
23
|
from typing_extensions import Self
|
|
26
24
|
|
|
27
|
-
class
|
|
25
|
+
class ANNFunction(BaseModel):
|
|
28
26
|
"""
|
|
29
|
-
|
|
27
|
+
ANNFunction
|
|
30
28
|
""" # noqa: E501
|
|
31
29
|
limit: Optional[StrictInt] = Field(default=5, description="The amount of neighbours per function ID")
|
|
32
30
|
distance: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.1, description="The distance between two neighbours")
|
|
33
31
|
analysis_search_ids: Optional[List[Optional[StrictInt]]] = Field(default=None, description="Perform a search on functions within a list of analyses")
|
|
34
32
|
collection_search_ids: Optional[Annotated[List[Optional[StrictInt]], Field(max_length=5)]] = Field(default=None, description="Search only within these collections")
|
|
35
|
-
search_binary_ids: Optional[
|
|
36
|
-
search_function_ids: Optional[
|
|
33
|
+
search_binary_ids: Optional[List[StrictInt]] = None
|
|
34
|
+
search_function_ids: Optional[List[StrictInt]] = None
|
|
37
35
|
debug_only: Optional[StrictBool] = Field(default=False, description="Searches for only functions which are debug")
|
|
38
36
|
additional_properties: Dict[str, Any] = {}
|
|
39
37
|
__properties: ClassVar[List[str]] = ["limit", "distance", "analysis_search_ids", "collection_search_ids", "search_binary_ids", "search_function_ids", "debug_only"]
|
|
@@ -56,7 +54,7 @@ class AppApiRestV2SimilaritySchemaANNFunction(BaseModel):
|
|
|
56
54
|
|
|
57
55
|
@classmethod
|
|
58
56
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
-
"""Create an instance of
|
|
57
|
+
"""Create an instance of ANNFunction from a JSON string"""
|
|
60
58
|
return cls.from_dict(json.loads(json_str))
|
|
61
59
|
|
|
62
60
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -79,22 +77,26 @@ class AppApiRestV2SimilaritySchemaANNFunction(BaseModel):
|
|
|
79
77
|
exclude=excluded_fields,
|
|
80
78
|
exclude_none=True,
|
|
81
79
|
)
|
|
82
|
-
# override the default output from pydantic by calling `to_dict()` of search_binary_ids
|
|
83
|
-
if self.search_binary_ids:
|
|
84
|
-
_dict['search_binary_ids'] = self.search_binary_ids.to_dict()
|
|
85
|
-
# override the default output from pydantic by calling `to_dict()` of search_function_ids
|
|
86
|
-
if self.search_function_ids:
|
|
87
|
-
_dict['search_function_ids'] = self.search_function_ids.to_dict()
|
|
88
80
|
# puts key-value pairs in additional_properties in the top level
|
|
89
81
|
if self.additional_properties is not None:
|
|
90
82
|
for _key, _value in self.additional_properties.items():
|
|
91
83
|
_dict[_key] = _value
|
|
92
84
|
|
|
85
|
+
# set to None if search_binary_ids (nullable) is None
|
|
86
|
+
# and model_fields_set contains the field
|
|
87
|
+
if self.search_binary_ids is None and "search_binary_ids" in self.model_fields_set:
|
|
88
|
+
_dict['search_binary_ids'] = None
|
|
89
|
+
|
|
90
|
+
# set to None if search_function_ids (nullable) is None
|
|
91
|
+
# and model_fields_set contains the field
|
|
92
|
+
if self.search_function_ids is None and "search_function_ids" in self.model_fields_set:
|
|
93
|
+
_dict['search_function_ids'] = None
|
|
94
|
+
|
|
93
95
|
return _dict
|
|
94
96
|
|
|
95
97
|
@classmethod
|
|
96
98
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
-
"""Create an instance of
|
|
99
|
+
"""Create an instance of ANNFunction from a dict"""
|
|
98
100
|
if obj is None:
|
|
99
101
|
return None
|
|
100
102
|
|
|
@@ -106,8 +108,8 @@ class AppApiRestV2SimilaritySchemaANNFunction(BaseModel):
|
|
|
106
108
|
"distance": obj.get("distance") if obj.get("distance") is not None else 0.1,
|
|
107
109
|
"analysis_search_ids": obj.get("analysis_search_ids"),
|
|
108
110
|
"collection_search_ids": obj.get("collection_search_ids"),
|
|
109
|
-
"search_binary_ids":
|
|
110
|
-
"search_function_ids":
|
|
111
|
+
"search_binary_ids": obj.get("search_binary_ids"),
|
|
112
|
+
"search_function_ids": obj.get("search_function_ids"),
|
|
111
113
|
"debug_only": obj.get("debug_only") if obj.get("debug_only") is not None else False
|
|
112
114
|
})
|
|
113
115
|
# store additional fields in additional_properties
|
|
@@ -16,7 +16,7 @@ import pprint
|
|
|
16
16
|
import re # noqa: F401
|
|
17
17
|
import json
|
|
18
18
|
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
20
20
|
from typing import Any, ClassVar, Dict, List
|
|
21
21
|
from typing import Optional, Set
|
|
22
22
|
from typing_extensions import Self
|
|
@@ -26,7 +26,7 @@ class AppApiRestV2FunctionsResponsesFunction(BaseModel):
|
|
|
26
26
|
Function schema used in function strings response.
|
|
27
27
|
""" # noqa: E501
|
|
28
28
|
function_id: StrictInt
|
|
29
|
-
function_vaddr: StrictInt
|
|
29
|
+
function_vaddr: StrictInt = Field(description="Function virtual address")
|
|
30
30
|
__properties: ClassVar[List[str]] = ["function_id", "function_vaddr"]
|
|
31
31
|
|
|
32
32
|
model_config = ConfigDict(
|