revengai 1.84.0__py3-none-any.whl → 1.85.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 +9 -3
- revengai/api/__init__.py +1 -0
- revengai/api/analyses_core_api.py +16 -16
- revengai/api/v1_api.py +334 -0
- revengai/api_client.py +1 -1
- revengai/configuration.py +2 -2
- revengai/models/__init__.py +3 -1
- revengai/models/app_api_rest_v1_ann_schema_ann_function.py +134 -0
- revengai/models/{ann_function.py → app_api_rest_v2_similarity_schema_ann_function.py} +4 -4
- revengai/models/function_batch_ann.py +105 -0
- {revengai-1.84.0.dist-info → revengai-1.85.0.dist-info}/METADATA +5 -2
- {revengai-1.84.0.dist-info → revengai-1.85.0.dist-info}/RECORD +13 -10
- {revengai-1.84.0.dist-info → revengai-1.85.0.dist-info}/WHEEL +0 -0
revengai/__init__.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
""" # noqa: E501
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
__version__ = "v1.
|
|
16
|
+
__version__ = "v1.85.0"
|
|
17
17
|
|
|
18
18
|
# Define package exports
|
|
19
19
|
__all__ = [
|
|
@@ -37,6 +37,7 @@ __all__ = [
|
|
|
37
37
|
"FunctionsThreatScoreApi",
|
|
38
38
|
"ModelsApi",
|
|
39
39
|
"SearchApi",
|
|
40
|
+
"V1Api",
|
|
40
41
|
"ApiResponse",
|
|
41
42
|
"ApiClient",
|
|
42
43
|
"Configuration",
|
|
@@ -46,7 +47,6 @@ __all__ = [
|
|
|
46
47
|
"ApiKeyError",
|
|
47
48
|
"ApiAttributeError",
|
|
48
49
|
"ApiException",
|
|
49
|
-
"ANNFunction",
|
|
50
50
|
"Addr",
|
|
51
51
|
"AiDecompilationRating",
|
|
52
52
|
"AiUnstripRequest",
|
|
@@ -65,12 +65,14 @@ __all__ = [
|
|
|
65
65
|
"AnalysisUpdateRequest",
|
|
66
66
|
"AnalysisUpdateTagsRequest",
|
|
67
67
|
"AnalysisUpdateTagsResponse",
|
|
68
|
+
"AppApiRestV1AnnSchemaANNFunction",
|
|
68
69
|
"AppApiRestV2AnalysesEnumsDynamicExecutionStatus",
|
|
69
70
|
"AppApiRestV2AnalysesEnumsOrderBy",
|
|
70
71
|
"AppApiRestV2AnalysesResponsesTagItem",
|
|
71
72
|
"AppApiRestV2CollectionsEnumsOrderBy",
|
|
72
73
|
"AppApiRestV2FunctionsResponsesFunction",
|
|
73
74
|
"AppApiRestV2FunctionsTypesFunction",
|
|
75
|
+
"AppApiRestV2SimilaritySchemaANNFunction",
|
|
74
76
|
"AppServicesBinaryAnnSchemaTagItem",
|
|
75
77
|
"AppServicesDynamicExecutionSchemasDynamicExecutionStatus",
|
|
76
78
|
"Argument",
|
|
@@ -220,6 +222,7 @@ __all__ = [
|
|
|
220
222
|
"FileMetadata",
|
|
221
223
|
"Filters",
|
|
222
224
|
"FunctionAnalysisThreatScoreData",
|
|
225
|
+
"FunctionBatchAnn",
|
|
223
226
|
"FunctionBlockDestinationResponse",
|
|
224
227
|
"FunctionBlockResponse",
|
|
225
228
|
"FunctionBlocksResponse",
|
|
@@ -373,6 +376,7 @@ from revengai.api.functions_renaming_history_api import FunctionsRenamingHistory
|
|
|
373
376
|
from revengai.api.functions_threat_score_api import FunctionsThreatScoreApi as FunctionsThreatScoreApi
|
|
374
377
|
from revengai.api.models_api import ModelsApi as ModelsApi
|
|
375
378
|
from revengai.api.search_api import SearchApi as SearchApi
|
|
379
|
+
from revengai.api.v1_api import V1Api as V1Api
|
|
376
380
|
|
|
377
381
|
# import ApiClient
|
|
378
382
|
from revengai.api_response import ApiResponse as ApiResponse
|
|
@@ -386,7 +390,6 @@ from revengai.exceptions import ApiAttributeError as ApiAttributeError
|
|
|
386
390
|
from revengai.exceptions import ApiException as ApiException
|
|
387
391
|
|
|
388
392
|
# import models into sdk package
|
|
389
|
-
from revengai.models.ann_function import ANNFunction as ANNFunction
|
|
390
393
|
from revengai.models.addr import Addr as Addr
|
|
391
394
|
from revengai.models.ai_decompilation_rating import AiDecompilationRating as AiDecompilationRating
|
|
392
395
|
from revengai.models.ai_unstrip_request import AiUnstripRequest as AiUnstripRequest
|
|
@@ -405,12 +408,14 @@ from revengai.models.analysis_threat_score_data import AnalysisThreatScoreData a
|
|
|
405
408
|
from revengai.models.analysis_update_request import AnalysisUpdateRequest as AnalysisUpdateRequest
|
|
406
409
|
from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest as AnalysisUpdateTagsRequest
|
|
407
410
|
from revengai.models.analysis_update_tags_response import AnalysisUpdateTagsResponse as AnalysisUpdateTagsResponse
|
|
411
|
+
from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction as AppApiRestV1AnnSchemaANNFunction
|
|
408
412
|
from revengai.models.app_api_rest_v2_analyses_enums_dynamic_execution_status import AppApiRestV2AnalysesEnumsDynamicExecutionStatus as AppApiRestV2AnalysesEnumsDynamicExecutionStatus
|
|
409
413
|
from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy as AppApiRestV2AnalysesEnumsOrderBy
|
|
410
414
|
from revengai.models.app_api_rest_v2_analyses_responses_tag_item import AppApiRestV2AnalysesResponsesTagItem as AppApiRestV2AnalysesResponsesTagItem
|
|
411
415
|
from revengai.models.app_api_rest_v2_collections_enums_order_by import AppApiRestV2CollectionsEnumsOrderBy as AppApiRestV2CollectionsEnumsOrderBy
|
|
412
416
|
from revengai.models.app_api_rest_v2_functions_responses_function import AppApiRestV2FunctionsResponsesFunction as AppApiRestV2FunctionsResponsesFunction
|
|
413
417
|
from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction as AppApiRestV2FunctionsTypesFunction
|
|
418
|
+
from revengai.models.app_api_rest_v2_similarity_schema_ann_function import AppApiRestV2SimilaritySchemaANNFunction as AppApiRestV2SimilaritySchemaANNFunction
|
|
414
419
|
from revengai.models.app_services_binary_ann_schema_tag_item import AppServicesBinaryAnnSchemaTagItem as AppServicesBinaryAnnSchemaTagItem
|
|
415
420
|
from revengai.models.app_services_dynamic_execution_schemas_dynamic_execution_status import AppServicesDynamicExecutionSchemasDynamicExecutionStatus as AppServicesDynamicExecutionSchemasDynamicExecutionStatus
|
|
416
421
|
from revengai.models.argument import Argument as Argument
|
|
@@ -560,6 +565,7 @@ from revengai.models.file_hashes import FileHashes as FileHashes
|
|
|
560
565
|
from revengai.models.file_metadata import FileMetadata as FileMetadata
|
|
561
566
|
from revengai.models.filters import Filters as Filters
|
|
562
567
|
from revengai.models.function_analysis_threat_score_data import FunctionAnalysisThreatScoreData as FunctionAnalysisThreatScoreData
|
|
568
|
+
from revengai.models.function_batch_ann import FunctionBatchAnn as FunctionBatchAnn
|
|
563
569
|
from revengai.models.function_block_destination_response import FunctionBlockDestinationResponse as FunctionBlockDestinationResponse
|
|
564
570
|
from revengai.models.function_block_response import FunctionBlockResponse as FunctionBlockResponse
|
|
565
571
|
from revengai.models.function_blocks_response import FunctionBlocksResponse as FunctionBlocksResponse
|
revengai/api/__init__.py
CHANGED
|
@@ -21,4 +21,5 @@ from revengai.api.functions_renaming_history_api import FunctionsRenamingHistory
|
|
|
21
21
|
from revengai.api.functions_threat_score_api import FunctionsThreatScoreApi
|
|
22
22
|
from revengai.api.models_api import ModelsApi
|
|
23
23
|
from revengai.api.search_api import SearchApi
|
|
24
|
+
from revengai.api.v1_api import V1Api
|
|
24
25
|
|
|
@@ -18,11 +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
|
|
22
21
|
from revengai.models.analysis_create_request import AnalysisCreateRequest
|
|
23
22
|
from revengai.models.analysis_update_request import AnalysisUpdateRequest
|
|
24
23
|
from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest
|
|
25
24
|
from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy
|
|
25
|
+
from revengai.models.app_api_rest_v2_similarity_schema_ann_function import AppApiRestV2SimilaritySchemaANNFunction
|
|
26
26
|
from revengai.models.base_response_analysis_create_response import BaseResponseAnalysisCreateResponse
|
|
27
27
|
from revengai.models.base_response_analysis_detail_response import BaseResponseAnalysisDetailResponse
|
|
28
28
|
from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping
|
|
@@ -651,7 +651,7 @@ class AnalysesCoreApi:
|
|
|
651
651
|
def find_similar_functions_batch(
|
|
652
652
|
self,
|
|
653
653
|
analysis_id: StrictInt,
|
|
654
|
-
|
|
654
|
+
app_api_rest_v2_similarity_schema_ann_function: AppApiRestV2SimilaritySchemaANNFunction,
|
|
655
655
|
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
656
656
|
_request_timeout: Union[
|
|
657
657
|
None,
|
|
@@ -672,8 +672,8 @@ class AnalysesCoreApi:
|
|
|
672
672
|
|
|
673
673
|
:param analysis_id: (required)
|
|
674
674
|
:type analysis_id: int
|
|
675
|
-
:param
|
|
676
|
-
:type
|
|
675
|
+
:param app_api_rest_v2_similarity_schema_ann_function: (required)
|
|
676
|
+
:type app_api_rest_v2_similarity_schema_ann_function: AppApiRestV2SimilaritySchemaANNFunction
|
|
677
677
|
:param authorization: API Key bearer token
|
|
678
678
|
:type authorization: str
|
|
679
679
|
:param _request_timeout: timeout setting for this request. If one
|
|
@@ -700,7 +700,7 @@ class AnalysesCoreApi:
|
|
|
700
700
|
|
|
701
701
|
_param = self._find_similar_functions_batch_serialize(
|
|
702
702
|
analysis_id=analysis_id,
|
|
703
|
-
|
|
703
|
+
app_api_rest_v2_similarity_schema_ann_function=app_api_rest_v2_similarity_schema_ann_function,
|
|
704
704
|
authorization=authorization,
|
|
705
705
|
_request_auth=_request_auth,
|
|
706
706
|
_content_type=_content_type,
|
|
@@ -727,7 +727,7 @@ class AnalysesCoreApi:
|
|
|
727
727
|
def find_similar_functions_batch_with_http_info(
|
|
728
728
|
self,
|
|
729
729
|
analysis_id: StrictInt,
|
|
730
|
-
|
|
730
|
+
app_api_rest_v2_similarity_schema_ann_function: AppApiRestV2SimilaritySchemaANNFunction,
|
|
731
731
|
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
732
732
|
_request_timeout: Union[
|
|
733
733
|
None,
|
|
@@ -748,8 +748,8 @@ class AnalysesCoreApi:
|
|
|
748
748
|
|
|
749
749
|
:param analysis_id: (required)
|
|
750
750
|
:type analysis_id: int
|
|
751
|
-
:param
|
|
752
|
-
:type
|
|
751
|
+
:param app_api_rest_v2_similarity_schema_ann_function: (required)
|
|
752
|
+
:type app_api_rest_v2_similarity_schema_ann_function: AppApiRestV2SimilaritySchemaANNFunction
|
|
753
753
|
:param authorization: API Key bearer token
|
|
754
754
|
:type authorization: str
|
|
755
755
|
:param _request_timeout: timeout setting for this request. If one
|
|
@@ -776,7 +776,7 @@ class AnalysesCoreApi:
|
|
|
776
776
|
|
|
777
777
|
_param = self._find_similar_functions_batch_serialize(
|
|
778
778
|
analysis_id=analysis_id,
|
|
779
|
-
|
|
779
|
+
app_api_rest_v2_similarity_schema_ann_function=app_api_rest_v2_similarity_schema_ann_function,
|
|
780
780
|
authorization=authorization,
|
|
781
781
|
_request_auth=_request_auth,
|
|
782
782
|
_content_type=_content_type,
|
|
@@ -803,7 +803,7 @@ class AnalysesCoreApi:
|
|
|
803
803
|
def find_similar_functions_batch_without_preload_content(
|
|
804
804
|
self,
|
|
805
805
|
analysis_id: StrictInt,
|
|
806
|
-
|
|
806
|
+
app_api_rest_v2_similarity_schema_ann_function: AppApiRestV2SimilaritySchemaANNFunction,
|
|
807
807
|
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
808
808
|
_request_timeout: Union[
|
|
809
809
|
None,
|
|
@@ -824,8 +824,8 @@ class AnalysesCoreApi:
|
|
|
824
824
|
|
|
825
825
|
:param analysis_id: (required)
|
|
826
826
|
:type analysis_id: int
|
|
827
|
-
:param
|
|
828
|
-
:type
|
|
827
|
+
:param app_api_rest_v2_similarity_schema_ann_function: (required)
|
|
828
|
+
:type app_api_rest_v2_similarity_schema_ann_function: AppApiRestV2SimilaritySchemaANNFunction
|
|
829
829
|
:param authorization: API Key bearer token
|
|
830
830
|
:type authorization: str
|
|
831
831
|
:param _request_timeout: timeout setting for this request. If one
|
|
@@ -852,7 +852,7 @@ class AnalysesCoreApi:
|
|
|
852
852
|
|
|
853
853
|
_param = self._find_similar_functions_batch_serialize(
|
|
854
854
|
analysis_id=analysis_id,
|
|
855
|
-
|
|
855
|
+
app_api_rest_v2_similarity_schema_ann_function=app_api_rest_v2_similarity_schema_ann_function,
|
|
856
856
|
authorization=authorization,
|
|
857
857
|
_request_auth=_request_auth,
|
|
858
858
|
_content_type=_content_type,
|
|
@@ -874,7 +874,7 @@ class AnalysesCoreApi:
|
|
|
874
874
|
def _find_similar_functions_batch_serialize(
|
|
875
875
|
self,
|
|
876
876
|
analysis_id,
|
|
877
|
-
|
|
877
|
+
app_api_rest_v2_similarity_schema_ann_function,
|
|
878
878
|
authorization,
|
|
879
879
|
_request_auth,
|
|
880
880
|
_content_type,
|
|
@@ -905,8 +905,8 @@ class AnalysesCoreApi:
|
|
|
905
905
|
_header_params['authorization'] = authorization
|
|
906
906
|
# process the form parameters
|
|
907
907
|
# process the body parameter
|
|
908
|
-
if
|
|
909
|
-
_body_params =
|
|
908
|
+
if app_api_rest_v2_similarity_schema_ann_function is not None:
|
|
909
|
+
_body_params = app_api_rest_v2_similarity_schema_ann_function
|
|
910
910
|
|
|
911
911
|
|
|
912
912
|
# set the HTTP header `Accept`
|
revengai/api/v1_api.py
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
RevEng.AI API
|
|
5
|
+
|
|
6
|
+
RevEng.AI is Similarity Search Engine for executable binaries
|
|
7
|
+
|
|
8
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
9
|
+
|
|
10
|
+
Do not edit the class manually.
|
|
11
|
+
""" # noqa: E501
|
|
12
|
+
|
|
13
|
+
import warnings
|
|
14
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
from typing_extensions import Annotated
|
|
17
|
+
|
|
18
|
+
from pydantic import Field, StrictStr
|
|
19
|
+
from typing import Optional
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction
|
|
22
|
+
from revengai.models.function_batch_ann import FunctionBatchAnn
|
|
23
|
+
|
|
24
|
+
from revengai.api_client import ApiClient, RequestSerialized
|
|
25
|
+
from revengai.api_response import ApiResponse
|
|
26
|
+
from revengai.rest import RESTResponseType
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class V1Api:
|
|
30
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
31
|
+
Ref: https://openapi-generator.tech
|
|
32
|
+
|
|
33
|
+
Do not edit the class manually.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, api_client=None) -> None:
|
|
37
|
+
if api_client is None:
|
|
38
|
+
api_client = ApiClient.get_default()
|
|
39
|
+
self.api_client = api_client
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@validate_call
|
|
43
|
+
def batch_symbol_ann(
|
|
44
|
+
self,
|
|
45
|
+
app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction,
|
|
46
|
+
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
47
|
+
_request_timeout: Union[
|
|
48
|
+
None,
|
|
49
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
50
|
+
Tuple[
|
|
51
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
52
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
53
|
+
]
|
|
54
|
+
] = None,
|
|
55
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
56
|
+
_content_type: Optional[StrictStr] = None,
|
|
57
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
58
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
59
|
+
) -> FunctionBatchAnn:
|
|
60
|
+
"""(Deprecated) Batch Symbol ANN using function IDs
|
|
61
|
+
|
|
62
|
+
Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database
|
|
63
|
+
|
|
64
|
+
:param app_api_rest_v1_ann_schema_ann_function: (required)
|
|
65
|
+
:type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction
|
|
66
|
+
:param authorization: API Key bearer token
|
|
67
|
+
:type authorization: str
|
|
68
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
69
|
+
number provided, it will be total request
|
|
70
|
+
timeout. It can also be a pair (tuple) of
|
|
71
|
+
(connection, read) timeouts.
|
|
72
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
73
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
74
|
+
request; this effectively ignores the
|
|
75
|
+
authentication in the spec for a single request.
|
|
76
|
+
:type _request_auth: dict, optional
|
|
77
|
+
:param _content_type: force content-type for the request.
|
|
78
|
+
:type _content_type: str, Optional
|
|
79
|
+
:param _headers: set to override the headers for a single
|
|
80
|
+
request; this effectively ignores the headers
|
|
81
|
+
in the spec for a single request.
|
|
82
|
+
:type _headers: dict, optional
|
|
83
|
+
:param _host_index: set to override the host_index for a single
|
|
84
|
+
request; this effectively ignores the host_index
|
|
85
|
+
in the spec for a single request.
|
|
86
|
+
:type _host_index: int, optional
|
|
87
|
+
:return: Returns the result object.
|
|
88
|
+
""" # noqa: E501
|
|
89
|
+
warnings.warn("POST /v1/ann/symbol/batch is deprecated.", DeprecationWarning)
|
|
90
|
+
|
|
91
|
+
_param = self._batch_symbol_ann_serialize(
|
|
92
|
+
app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function,
|
|
93
|
+
authorization=authorization,
|
|
94
|
+
_request_auth=_request_auth,
|
|
95
|
+
_content_type=_content_type,
|
|
96
|
+
_headers=_headers,
|
|
97
|
+
_host_index=_host_index
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
101
|
+
'200': "FunctionBatchAnn",
|
|
102
|
+
'422': "BaseResponse",
|
|
103
|
+
}
|
|
104
|
+
response_data = self.api_client.call_api(
|
|
105
|
+
*_param,
|
|
106
|
+
_request_timeout=_request_timeout
|
|
107
|
+
)
|
|
108
|
+
response_data.read()
|
|
109
|
+
return self.api_client.response_deserialize(
|
|
110
|
+
response_data=response_data,
|
|
111
|
+
response_types_map=_response_types_map,
|
|
112
|
+
).data
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@validate_call
|
|
116
|
+
def batch_symbol_ann_with_http_info(
|
|
117
|
+
self,
|
|
118
|
+
app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction,
|
|
119
|
+
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
120
|
+
_request_timeout: Union[
|
|
121
|
+
None,
|
|
122
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
123
|
+
Tuple[
|
|
124
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
125
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
126
|
+
]
|
|
127
|
+
] = None,
|
|
128
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
129
|
+
_content_type: Optional[StrictStr] = None,
|
|
130
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
131
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
132
|
+
) -> ApiResponse[FunctionBatchAnn]:
|
|
133
|
+
"""(Deprecated) Batch Symbol ANN using function IDs
|
|
134
|
+
|
|
135
|
+
Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database
|
|
136
|
+
|
|
137
|
+
:param app_api_rest_v1_ann_schema_ann_function: (required)
|
|
138
|
+
:type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction
|
|
139
|
+
:param authorization: API Key bearer token
|
|
140
|
+
:type authorization: str
|
|
141
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
142
|
+
number provided, it will be total request
|
|
143
|
+
timeout. It can also be a pair (tuple) of
|
|
144
|
+
(connection, read) timeouts.
|
|
145
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
146
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
147
|
+
request; this effectively ignores the
|
|
148
|
+
authentication in the spec for a single request.
|
|
149
|
+
:type _request_auth: dict, optional
|
|
150
|
+
:param _content_type: force content-type for the request.
|
|
151
|
+
:type _content_type: str, Optional
|
|
152
|
+
:param _headers: set to override the headers for a single
|
|
153
|
+
request; this effectively ignores the headers
|
|
154
|
+
in the spec for a single request.
|
|
155
|
+
:type _headers: dict, optional
|
|
156
|
+
:param _host_index: set to override the host_index for a single
|
|
157
|
+
request; this effectively ignores the host_index
|
|
158
|
+
in the spec for a single request.
|
|
159
|
+
:type _host_index: int, optional
|
|
160
|
+
:return: Returns the result object.
|
|
161
|
+
""" # noqa: E501
|
|
162
|
+
warnings.warn("POST /v1/ann/symbol/batch is deprecated.", DeprecationWarning)
|
|
163
|
+
|
|
164
|
+
_param = self._batch_symbol_ann_serialize(
|
|
165
|
+
app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function,
|
|
166
|
+
authorization=authorization,
|
|
167
|
+
_request_auth=_request_auth,
|
|
168
|
+
_content_type=_content_type,
|
|
169
|
+
_headers=_headers,
|
|
170
|
+
_host_index=_host_index
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
174
|
+
'200': "FunctionBatchAnn",
|
|
175
|
+
'422': "BaseResponse",
|
|
176
|
+
}
|
|
177
|
+
response_data = self.api_client.call_api(
|
|
178
|
+
*_param,
|
|
179
|
+
_request_timeout=_request_timeout
|
|
180
|
+
)
|
|
181
|
+
response_data.read()
|
|
182
|
+
return self.api_client.response_deserialize(
|
|
183
|
+
response_data=response_data,
|
|
184
|
+
response_types_map=_response_types_map,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
@validate_call
|
|
189
|
+
def batch_symbol_ann_without_preload_content(
|
|
190
|
+
self,
|
|
191
|
+
app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction,
|
|
192
|
+
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
193
|
+
_request_timeout: Union[
|
|
194
|
+
None,
|
|
195
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
196
|
+
Tuple[
|
|
197
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
198
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
199
|
+
]
|
|
200
|
+
] = None,
|
|
201
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
202
|
+
_content_type: Optional[StrictStr] = None,
|
|
203
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
204
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
205
|
+
) -> RESTResponseType:
|
|
206
|
+
"""(Deprecated) Batch Symbol ANN using function IDs
|
|
207
|
+
|
|
208
|
+
Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database
|
|
209
|
+
|
|
210
|
+
:param app_api_rest_v1_ann_schema_ann_function: (required)
|
|
211
|
+
:type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction
|
|
212
|
+
:param authorization: API Key bearer token
|
|
213
|
+
:type authorization: str
|
|
214
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
215
|
+
number provided, it will be total request
|
|
216
|
+
timeout. It can also be a pair (tuple) of
|
|
217
|
+
(connection, read) timeouts.
|
|
218
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
219
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
220
|
+
request; this effectively ignores the
|
|
221
|
+
authentication in the spec for a single request.
|
|
222
|
+
:type _request_auth: dict, optional
|
|
223
|
+
:param _content_type: force content-type for the request.
|
|
224
|
+
:type _content_type: str, Optional
|
|
225
|
+
:param _headers: set to override the headers for a single
|
|
226
|
+
request; this effectively ignores the headers
|
|
227
|
+
in the spec for a single request.
|
|
228
|
+
:type _headers: dict, optional
|
|
229
|
+
:param _host_index: set to override the host_index for a single
|
|
230
|
+
request; this effectively ignores the host_index
|
|
231
|
+
in the spec for a single request.
|
|
232
|
+
:type _host_index: int, optional
|
|
233
|
+
:return: Returns the result object.
|
|
234
|
+
""" # noqa: E501
|
|
235
|
+
warnings.warn("POST /v1/ann/symbol/batch is deprecated.", DeprecationWarning)
|
|
236
|
+
|
|
237
|
+
_param = self._batch_symbol_ann_serialize(
|
|
238
|
+
app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function,
|
|
239
|
+
authorization=authorization,
|
|
240
|
+
_request_auth=_request_auth,
|
|
241
|
+
_content_type=_content_type,
|
|
242
|
+
_headers=_headers,
|
|
243
|
+
_host_index=_host_index
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
247
|
+
'200': "FunctionBatchAnn",
|
|
248
|
+
'422': "BaseResponse",
|
|
249
|
+
}
|
|
250
|
+
response_data = self.api_client.call_api(
|
|
251
|
+
*_param,
|
|
252
|
+
_request_timeout=_request_timeout
|
|
253
|
+
)
|
|
254
|
+
return response_data.response
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def _batch_symbol_ann_serialize(
|
|
258
|
+
self,
|
|
259
|
+
app_api_rest_v1_ann_schema_ann_function,
|
|
260
|
+
authorization,
|
|
261
|
+
_request_auth,
|
|
262
|
+
_content_type,
|
|
263
|
+
_headers,
|
|
264
|
+
_host_index,
|
|
265
|
+
) -> RequestSerialized:
|
|
266
|
+
|
|
267
|
+
_host = None
|
|
268
|
+
|
|
269
|
+
_collection_formats: Dict[str, str] = {
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
_path_params: Dict[str, str] = {}
|
|
273
|
+
_query_params: List[Tuple[str, str]] = []
|
|
274
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
275
|
+
_form_params: List[Tuple[str, str]] = []
|
|
276
|
+
_files: Dict[
|
|
277
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
278
|
+
] = {}
|
|
279
|
+
_body_params: Optional[bytes] = None
|
|
280
|
+
|
|
281
|
+
# process the path parameters
|
|
282
|
+
# process the query parameters
|
|
283
|
+
# process the header parameters
|
|
284
|
+
if authorization is not None:
|
|
285
|
+
_header_params['authorization'] = authorization
|
|
286
|
+
# process the form parameters
|
|
287
|
+
# process the body parameter
|
|
288
|
+
if app_api_rest_v1_ann_schema_ann_function is not None:
|
|
289
|
+
_body_params = app_api_rest_v1_ann_schema_ann_function
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
# set the HTTP header `Accept`
|
|
293
|
+
if 'Accept' not in _header_params:
|
|
294
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
295
|
+
[
|
|
296
|
+
'application/json'
|
|
297
|
+
]
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
# set the HTTP header `Content-Type`
|
|
301
|
+
if _content_type:
|
|
302
|
+
_header_params['Content-Type'] = _content_type
|
|
303
|
+
else:
|
|
304
|
+
_default_content_type = (
|
|
305
|
+
self.api_client.select_header_content_type(
|
|
306
|
+
[
|
|
307
|
+
'application/json'
|
|
308
|
+
]
|
|
309
|
+
)
|
|
310
|
+
)
|
|
311
|
+
if _default_content_type is not None:
|
|
312
|
+
_header_params['Content-Type'] = _default_content_type
|
|
313
|
+
|
|
314
|
+
# authentication setting
|
|
315
|
+
_auth_settings: List[str] = [
|
|
316
|
+
'APIKey'
|
|
317
|
+
]
|
|
318
|
+
|
|
319
|
+
return self.api_client.param_serialize(
|
|
320
|
+
method='POST',
|
|
321
|
+
resource_path='/v1/ann/symbol/batch',
|
|
322
|
+
path_params=_path_params,
|
|
323
|
+
query_params=_query_params,
|
|
324
|
+
header_params=_header_params,
|
|
325
|
+
body=_body_params,
|
|
326
|
+
post_params=_form_params,
|
|
327
|
+
files=_files,
|
|
328
|
+
auth_settings=_auth_settings,
|
|
329
|
+
collection_formats=_collection_formats,
|
|
330
|
+
_host=_host,
|
|
331
|
+
_request_auth=_request_auth
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
|
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/v1.
|
|
93
|
+
self.user_agent = 'OpenAPI-Generator/v1.85.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: v1.
|
|
533
|
-
"SDK Package Version: v1.
|
|
532
|
+
"Version of the API: v1.85.0\n"\
|
|
533
|
+
"SDK Package Version: v1.85.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,7 +12,6 @@
|
|
|
12
12
|
""" # noqa: E501
|
|
13
13
|
|
|
14
14
|
# import models into model package
|
|
15
|
-
from revengai.models.ann_function import ANNFunction
|
|
16
15
|
from revengai.models.addr import Addr
|
|
17
16
|
from revengai.models.ai_decompilation_rating import AiDecompilationRating
|
|
18
17
|
from revengai.models.ai_unstrip_request import AiUnstripRequest
|
|
@@ -31,12 +30,14 @@ from revengai.models.analysis_threat_score_data import AnalysisThreatScoreData
|
|
|
31
30
|
from revengai.models.analysis_update_request import AnalysisUpdateRequest
|
|
32
31
|
from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest
|
|
33
32
|
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
|
|
40
41
|
from revengai.models.app_services_binary_ann_schema_tag_item import AppServicesBinaryAnnSchemaTagItem
|
|
41
42
|
from revengai.models.app_services_dynamic_execution_schemas_dynamic_execution_status import AppServicesDynamicExecutionSchemasDynamicExecutionStatus
|
|
42
43
|
from revengai.models.argument import Argument
|
|
@@ -186,6 +187,7 @@ from revengai.models.file_hashes import FileHashes
|
|
|
186
187
|
from revengai.models.file_metadata import FileMetadata
|
|
187
188
|
from revengai.models.filters import Filters
|
|
188
189
|
from revengai.models.function_analysis_threat_score_data import FunctionAnalysisThreatScoreData
|
|
190
|
+
from revengai.models.function_batch_ann import FunctionBatchAnn
|
|
189
191
|
from revengai.models.function_block_destination_response import FunctionBlockDestinationResponse
|
|
190
192
|
from revengai.models.function_block_response import FunctionBlockResponse
|
|
191
193
|
from revengai.models.function_blocks_response import FunctionBlocksResponse
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
RevEng.AI API
|
|
5
|
+
|
|
6
|
+
RevEng.AI is Similarity Search Engine for executable binaries
|
|
7
|
+
|
|
8
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
9
|
+
|
|
10
|
+
Do not edit the class manually.
|
|
11
|
+
""" # noqa: E501
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
import pprint
|
|
16
|
+
import re # noqa: F401
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class AppApiRestV1AnnSchemaANNFunction(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
AppApiRestV1AnnSchemaANNFunction
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
result_per_function: Optional[Annotated[int, Field(le=20, strict=True)]] = None
|
|
30
|
+
distance: Optional[Union[StrictFloat, StrictInt]] = None
|
|
31
|
+
function_id_list: List[Optional[StrictInt]] = Field(description="List of function ids to compare")
|
|
32
|
+
speculative_function_ids: Optional[List[Any]] = None
|
|
33
|
+
collection: Optional[List[Optional[StrictStr]]] = Field(default=None, description="Perform a search on functions within a list of collections")
|
|
34
|
+
collection_search_list: Optional[List[Optional[StrictInt]]] = Field(default=None, description="Perform a search on functions within a list of collections")
|
|
35
|
+
debug_mode: Optional[StrictBool] = None
|
|
36
|
+
debug_types: Optional[List[StrictStr]] = Field(default=None, description="If limiting results to functions with debug names, which type of debug names to include?")
|
|
37
|
+
binaries_search_list: Optional[List[Optional[StrictInt]]] = Field(default=None, description="Perform a search on functions within a list of analyses")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["result_per_function", "distance", "function_id_list", "speculative_function_ids", "collection", "collection_search_list", "debug_mode", "debug_types", "binaries_search_list"]
|
|
39
|
+
|
|
40
|
+
@field_validator('debug_types')
|
|
41
|
+
def debug_types_validate_enum(cls, value):
|
|
42
|
+
"""Validates the enum"""
|
|
43
|
+
if value is None:
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
for i in value:
|
|
47
|
+
if i not in set(['USER', 'SYSTEM', 'EXTERNAL']):
|
|
48
|
+
raise ValueError("each list item must be one of ('USER', 'SYSTEM', 'EXTERNAL')")
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
populate_by_name=True,
|
|
53
|
+
validate_assignment=True,
|
|
54
|
+
protected_namespaces=(),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def to_str(self) -> str:
|
|
59
|
+
"""Returns the string representation of the model using alias"""
|
|
60
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
61
|
+
|
|
62
|
+
def to_json(self) -> str:
|
|
63
|
+
"""Returns the JSON representation of the model using alias"""
|
|
64
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
65
|
+
return json.dumps(self.to_dict())
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of AppApiRestV1AnnSchemaANNFunction from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
"""
|
|
82
|
+
excluded_fields: Set[str] = set([
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
_dict = self.model_dump(
|
|
86
|
+
by_alias=True,
|
|
87
|
+
exclude=excluded_fields,
|
|
88
|
+
exclude_none=True,
|
|
89
|
+
)
|
|
90
|
+
# set to None if result_per_function (nullable) is None
|
|
91
|
+
# and model_fields_set contains the field
|
|
92
|
+
if self.result_per_function is None and "result_per_function" in self.model_fields_set:
|
|
93
|
+
_dict['result_per_function'] = None
|
|
94
|
+
|
|
95
|
+
# set to None if distance (nullable) is None
|
|
96
|
+
# and model_fields_set contains the field
|
|
97
|
+
if self.distance is None and "distance" in self.model_fields_set:
|
|
98
|
+
_dict['distance'] = None
|
|
99
|
+
|
|
100
|
+
# set to None if speculative_function_ids (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.speculative_function_ids is None and "speculative_function_ids" in self.model_fields_set:
|
|
103
|
+
_dict['speculative_function_ids'] = None
|
|
104
|
+
|
|
105
|
+
# set to None if debug_mode (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.debug_mode is None and "debug_mode" in self.model_fields_set:
|
|
108
|
+
_dict['debug_mode'] = None
|
|
109
|
+
|
|
110
|
+
return _dict
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
114
|
+
"""Create an instance of AppApiRestV1AnnSchemaANNFunction from a dict"""
|
|
115
|
+
if obj is None:
|
|
116
|
+
return None
|
|
117
|
+
|
|
118
|
+
if not isinstance(obj, dict):
|
|
119
|
+
return cls.model_validate(obj)
|
|
120
|
+
|
|
121
|
+
_obj = cls.model_validate({
|
|
122
|
+
"result_per_function": obj.get("result_per_function"),
|
|
123
|
+
"distance": obj.get("distance"),
|
|
124
|
+
"function_id_list": obj.get("function_id_list"),
|
|
125
|
+
"speculative_function_ids": obj.get("speculative_function_ids"),
|
|
126
|
+
"collection": obj.get("collection"),
|
|
127
|
+
"collection_search_list": obj.get("collection_search_list"),
|
|
128
|
+
"debug_mode": obj.get("debug_mode"),
|
|
129
|
+
"debug_types": obj.get("debug_types"),
|
|
130
|
+
"binaries_search_list": obj.get("binaries_search_list")
|
|
131
|
+
})
|
|
132
|
+
return _obj
|
|
133
|
+
|
|
134
|
+
|
|
@@ -24,9 +24,9 @@ from revengai.models.search_function_ids import SearchFunctionIds
|
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
27
|
-
class
|
|
27
|
+
class AppApiRestV2SimilaritySchemaANNFunction(BaseModel):
|
|
28
28
|
"""
|
|
29
|
-
|
|
29
|
+
AppApiRestV2SimilaritySchemaANNFunction
|
|
30
30
|
""" # noqa: E501
|
|
31
31
|
limit: Optional[StrictInt] = Field(default=5, description="The amount of neighbours per function ID")
|
|
32
32
|
distance: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.1, description="The distance between two neighbours")
|
|
@@ -56,7 +56,7 @@ class ANNFunction(BaseModel):
|
|
|
56
56
|
|
|
57
57
|
@classmethod
|
|
58
58
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
-
"""Create an instance of
|
|
59
|
+
"""Create an instance of AppApiRestV2SimilaritySchemaANNFunction from a JSON string"""
|
|
60
60
|
return cls.from_dict(json.loads(json_str))
|
|
61
61
|
|
|
62
62
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -94,7 +94,7 @@ class ANNFunction(BaseModel):
|
|
|
94
94
|
|
|
95
95
|
@classmethod
|
|
96
96
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
-
"""Create an instance of
|
|
97
|
+
"""Create an instance of AppApiRestV2SimilaritySchemaANNFunction from a dict"""
|
|
98
98
|
if obj is None:
|
|
99
99
|
return None
|
|
100
100
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
RevEng.AI API
|
|
5
|
+
|
|
6
|
+
RevEng.AI is Similarity Search Engine for executable binaries
|
|
7
|
+
|
|
8
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
9
|
+
|
|
10
|
+
Do not edit the class manually.
|
|
11
|
+
""" # noqa: E501
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
import pprint
|
|
16
|
+
import re # noqa: F401
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from typing import Optional, Set
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
class FunctionBatchAnn(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
FunctionBatchAnn
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
success: Optional[Any] = None
|
|
29
|
+
settings: Optional[Any]
|
|
30
|
+
function_matches: Optional[Any]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["success", "settings", "function_matches"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of FunctionBatchAnn from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# set to None if success (nullable) is None
|
|
73
|
+
# and model_fields_set contains the field
|
|
74
|
+
if self.success is None and "success" in self.model_fields_set:
|
|
75
|
+
_dict['success'] = None
|
|
76
|
+
|
|
77
|
+
# set to None if settings (nullable) is None
|
|
78
|
+
# and model_fields_set contains the field
|
|
79
|
+
if self.settings is None and "settings" in self.model_fields_set:
|
|
80
|
+
_dict['settings'] = None
|
|
81
|
+
|
|
82
|
+
# set to None if function_matches (nullable) is None
|
|
83
|
+
# and model_fields_set contains the field
|
|
84
|
+
if self.function_matches is None and "function_matches" in self.model_fields_set:
|
|
85
|
+
_dict['function_matches'] = None
|
|
86
|
+
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of FunctionBatchAnn from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"success": obj.get("success"),
|
|
100
|
+
"settings": obj.get("settings"),
|
|
101
|
+
"function_matches": obj.get("function_matches")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: revengai
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.85.0
|
|
4
4
|
Summary: RevEng.AI API
|
|
5
5
|
Project-URL: Repository, https://github.com/RevEngAI/revengai-python
|
|
6
6
|
Keywords: RevEng.AI API
|
|
@@ -169,11 +169,11 @@ Class | Method | HTTP request | Description
|
|
|
169
169
|
*SearchApi* | [**search_collections**](docs/SearchApi.md#search_collections) | **GET** /v2/search/collections | Collections search
|
|
170
170
|
*SearchApi* | [**search_functions**](docs/SearchApi.md#search_functions) | **GET** /v2/search/functions | Functions search
|
|
171
171
|
*SearchApi* | [**search_tags**](docs/SearchApi.md#search_tags) | **GET** /v2/search/tags | Tags search
|
|
172
|
+
*V1Api* | [**batch_symbol_ann**](docs/V1Api.md#batch_symbol_ann) | **POST** /v1/ann/symbol/batch | Batch Symbol ANN using function IDs
|
|
172
173
|
|
|
173
174
|
|
|
174
175
|
## Documentation For Models
|
|
175
176
|
|
|
176
|
-
- [ANNFunction](docs/ANNFunction.md)
|
|
177
177
|
- [Addr](docs/Addr.md)
|
|
178
178
|
- [AiDecompilationRating](docs/AiDecompilationRating.md)
|
|
179
179
|
- [AiUnstripRequest](docs/AiUnstripRequest.md)
|
|
@@ -192,12 +192,14 @@ Class | Method | HTTP request | Description
|
|
|
192
192
|
- [AnalysisUpdateRequest](docs/AnalysisUpdateRequest.md)
|
|
193
193
|
- [AnalysisUpdateTagsRequest](docs/AnalysisUpdateTagsRequest.md)
|
|
194
194
|
- [AnalysisUpdateTagsResponse](docs/AnalysisUpdateTagsResponse.md)
|
|
195
|
+
- [AppApiRestV1AnnSchemaANNFunction](docs/AppApiRestV1AnnSchemaANNFunction.md)
|
|
195
196
|
- [AppApiRestV2AnalysesEnumsDynamicExecutionStatus](docs/AppApiRestV2AnalysesEnumsDynamicExecutionStatus.md)
|
|
196
197
|
- [AppApiRestV2AnalysesEnumsOrderBy](docs/AppApiRestV2AnalysesEnumsOrderBy.md)
|
|
197
198
|
- [AppApiRestV2AnalysesResponsesTagItem](docs/AppApiRestV2AnalysesResponsesTagItem.md)
|
|
198
199
|
- [AppApiRestV2CollectionsEnumsOrderBy](docs/AppApiRestV2CollectionsEnumsOrderBy.md)
|
|
199
200
|
- [AppApiRestV2FunctionsResponsesFunction](docs/AppApiRestV2FunctionsResponsesFunction.md)
|
|
200
201
|
- [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md)
|
|
202
|
+
- [AppApiRestV2SimilaritySchemaANNFunction](docs/AppApiRestV2SimilaritySchemaANNFunction.md)
|
|
201
203
|
- [AppServicesBinaryAnnSchemaTagItem](docs/AppServicesBinaryAnnSchemaTagItem.md)
|
|
202
204
|
- [AppServicesDynamicExecutionSchemasDynamicExecutionStatus](docs/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md)
|
|
203
205
|
- [Argument](docs/Argument.md)
|
|
@@ -347,6 +349,7 @@ Class | Method | HTTP request | Description
|
|
|
347
349
|
- [FileMetadata](docs/FileMetadata.md)
|
|
348
350
|
- [Filters](docs/Filters.md)
|
|
349
351
|
- [FunctionAnalysisThreatScoreData](docs/FunctionAnalysisThreatScoreData.md)
|
|
352
|
+
- [FunctionBatchAnn](docs/FunctionBatchAnn.md)
|
|
350
353
|
- [FunctionBlockDestinationResponse](docs/FunctionBlockDestinationResponse.md)
|
|
351
354
|
- [FunctionBlockResponse](docs/FunctionBlockResponse.md)
|
|
352
355
|
- [FunctionBlocksResponse](docs/FunctionBlocksResponse.md)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
revengai/__init__.py,sha256=
|
|
2
|
-
revengai/api_client.py,sha256=
|
|
1
|
+
revengai/__init__.py,sha256=PC0qsp-xovTuno-1xEpQ6fLMIL60yi1UwtkTWWif48w,43237
|
|
2
|
+
revengai/api_client.py,sha256=J1pGmZsFtjoBi2WM8W_6w6xIFGN_Z1qu9xpi-gphLKY,27670
|
|
3
3
|
revengai/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
4
|
-
revengai/configuration.py,sha256=
|
|
4
|
+
revengai/configuration.py,sha256=4PS822_qFlTBXp4bt-Ck3O0cZaXPdSSOOc2kLCLlkcA,18749
|
|
5
5
|
revengai/exceptions.py,sha256=IvdI9ZIZ9b2lSSKtIKMQDlG-5UPAedrjm3U4xfmGkso,6385
|
|
6
6
|
revengai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
revengai/rest.py,sha256=T6Q2dcazhntqm288H33BKC1hf8NVdvmQWgaymlJo158,9376
|
|
8
|
-
revengai/api/__init__.py,sha256=
|
|
8
|
+
revengai/api/__init__.py,sha256=ouKXi3c7Z-a9BtW-WbThk2Tspt6o5rnyLY65DWGiTf0,1434
|
|
9
9
|
revengai/api/analyses_comments_api.py,sha256=L6NuM8bS3NJRt1b3WKdnZlYVE0YgdcZivNwGuQe5Gb4,49575
|
|
10
|
-
revengai/api/analyses_core_api.py,sha256=
|
|
10
|
+
revengai/api/analyses_core_api.py,sha256=RZsIrHfm0skMUEYHKiUea7vLYVBbd1G7ghuzMTnppKE,185121
|
|
11
11
|
revengai/api/analyses_dynamic_execution_api.py,sha256=4vNnupRsuwNVNk7cPa-VFx2nnLtrokJpHu4YUOPwX_o,77682
|
|
12
12
|
revengai/api/analyses_results_metadata_api.py,sha256=NlwPugWgnvFLcth_p4DRk8kwBk76offi7y9zxHL5mxk,90181
|
|
13
13
|
revengai/api/analyses_security_checks_api.py,sha256=b1phfsLDO2kvmLaYtGjMVUkHUhRp63EEN3aJvTyX16o,35691
|
|
@@ -26,7 +26,8 @@ revengai/api/functions_renaming_history_api.py,sha256=L2CDadLnZrA0oNxhJfTSLLiMDz
|
|
|
26
26
|
revengai/api/functions_threat_score_api.py,sha256=RYbCaX71r2ssv7VxUrcezT8dSdU5K5ipHD6yR592k6I,23867
|
|
27
27
|
revengai/api/models_api.py,sha256=bqukeUMctErkaX5mH8Rm3iPKEHQOCx-JT-P8_KV_iP8,11319
|
|
28
28
|
revengai/api/search_api.py,sha256=Kzo7KfP4nY1-YsoCHxVOQm3Vn89kFjcnUV7oNdaw5z0,65835
|
|
29
|
-
revengai/
|
|
29
|
+
revengai/api/v1_api.py,sha256=YblSm_5lTCdcW_Gtsx9HOVBNRRYv0XBDf25YbHo3-GE,13671
|
|
30
|
+
revengai/models/__init__.py,sha256=A40qaEs21K8MhzEhH-IEdR3ZnKRzpJkN9_yj-pYnH7I,23238
|
|
30
31
|
revengai/models/addr.py,sha256=-2N-UQsOiZ0eyEAQ7ssk0of8W2fBrXeYdTZXuVt3SZs,4787
|
|
31
32
|
revengai/models/ai_decompilation_rating.py,sha256=gyay27QJwToUNtK9NARyw731Sg8GFRTufGGUABVYyfo,722
|
|
32
33
|
revengai/models/ai_unstrip_request.py,sha256=loSXNdHATJmY5yttiUCE-lLEOkuE63qVDTz8U0eCAIc,2596
|
|
@@ -45,13 +46,14 @@ revengai/models/analysis_threat_score_data.py,sha256=1bCfJF-PyKsy6tW7JH-RyouW7bH
|
|
|
45
46
|
revengai/models/analysis_update_request.py,sha256=J4IulQ18iPHjrDMpLn9_NzMg99_W7jS8eCK17feVAtE,3403
|
|
46
47
|
revengai/models/analysis_update_tags_request.py,sha256=nrJwzS_Yg3SOkvrRcGW6eWfoG_FZn4l9dAZpRQNbV7A,2436
|
|
47
48
|
revengai/models/analysis_update_tags_response.py,sha256=KRNesNAW57hCPatnsy7ACBZORuKvWfd2XITFLwqtdbA,2936
|
|
48
|
-
revengai/models/
|
|
49
|
+
revengai/models/app_api_rest_v1_ann_schema_ann_function.py,sha256=5nu-WjnyTP76Rz3IgMjw-YkuGWAlrtWknoiPWje_gec,5556
|
|
49
50
|
revengai/models/app_api_rest_v2_analyses_enums_dynamic_execution_status.py,sha256=x8VdW5OBlfoIoz3IV1HLN-SxeFh7798x6bHIggz7jF8,805
|
|
50
51
|
revengai/models/app_api_rest_v2_analyses_enums_order_by.py,sha256=Wpv3tfyAeBzN5_jkk4tBtYlJvUn8h0qudg4bvzBtKh8,739
|
|
51
52
|
revengai/models/app_api_rest_v2_analyses_responses_tag_item.py,sha256=Clh9pPBQKqeqeRiOZG4Fbh77pLPyKMCH3r3nU8Ej0Pc,2921
|
|
52
53
|
revengai/models/app_api_rest_v2_collections_enums_order_by.py,sha256=IVV9Auj0-HwTYYI0ZvJv-P3ciLOkq0l7MOyy0A5s92I,846
|
|
53
54
|
revengai/models/app_api_rest_v2_functions_responses_function.py,sha256=tZrWMSf_1tfRg-3P0x5VI-H2njrIMyYazLSIwjzlsoQ,2627
|
|
54
55
|
revengai/models/app_api_rest_v2_functions_types_function.py,sha256=_5c3oqbCqBO7ubRdycgt6yyxrHCKneibiWlNyoG1Uvc,3869
|
|
56
|
+
revengai/models/app_api_rest_v2_similarity_schema_ann_function.py,sha256=atfQz2txuf_4MdDNFsnZabN_vMOGMnoyDjElT4VeAwY,5258
|
|
55
57
|
revengai/models/app_services_binary_ann_schema_tag_item.py,sha256=m25sIz8KEsPES0XGjmOZFhmLNLmB-jsakfRUpRfiMks,2977
|
|
56
58
|
revengai/models/app_services_dynamic_execution_schemas_dynamic_execution_status.py,sha256=9e3LDnw0iNCbowQPFTkNyIqkzsCQyJLZrx6tqRska6o,2562
|
|
57
59
|
revengai/models/argument.py,sha256=QmWpJiohyzTVC1GLHg1IlgM5QyONnBF6FGK_mOYQL_Y,3148
|
|
@@ -201,6 +203,7 @@ revengai/models/file_hashes.py,sha256=vAjMRVvB9GBGar-FZiV8VkG_h0304S7UNEg0aclT9P
|
|
|
201
203
|
revengai/models/file_metadata.py,sha256=BK3oI8Iat5leNewoD8ApE5iH-wrffCAi1lNXbM5RVRE,2954
|
|
202
204
|
revengai/models/filters.py,sha256=BO4gsERH6_P4gsRcbleZNHFNeyg7N5ir6mTIsQbXwdM,758
|
|
203
205
|
revengai/models/function_analysis_threat_score_data.py,sha256=QixPeMcTvWOm4-ekkNsiPJkWW0iUePZ6qvAZ-h3Ds5k,3532
|
|
206
|
+
revengai/models/function_batch_ann.py,sha256=85ems0hvPJVsMH89BuT7TPmqxIAVBci5ZPNBEFdN1tw,3291
|
|
204
207
|
revengai/models/function_block_destination_response.py,sha256=ffcxW67TIbLkO8P8D9_quP7J9T_PIgCZZXNSRIEii0I,3130
|
|
205
208
|
revengai/models/function_block_response.py,sha256=KxnssvtH_MUvgQH358TfVZofVKyRHQYftMX36N2zdBY,3960
|
|
206
209
|
revengai/models/function_blocks_response.py,sha256=8Eu3jA9GKCXVNX7viu3OQxJNsqUZMxBlg498eJ9HFA4,4847
|
|
@@ -331,6 +334,6 @@ revengai/models/vulnerabilities.py,sha256=9t6uoZd3svWyfcZJjmj6zP731Dp47Apb25y8Qt
|
|
|
331
334
|
revengai/models/vulnerability.py,sha256=P7rAOAYU5JLLpcRr824-YJgZba5kPb_J9ALV3tSNfLQ,3688
|
|
332
335
|
revengai/models/vulnerability_type.py,sha256=SyOgfMmELYYc_H84oPkikBpjwngtG5Qw9Q_86a2TPr8,866
|
|
333
336
|
revengai/models/workspace.py,sha256=chjU62GFvByEmaNd6luMNQVQLP3wlPx1zJgGJ_yyMLA,676
|
|
334
|
-
revengai-1.
|
|
335
|
-
revengai-1.
|
|
336
|
-
revengai-1.
|
|
337
|
+
revengai-1.85.0.dist-info/METADATA,sha256=aujkpswxjk1tP3LIN_hl8nfV9jahsm1GVbjDA-fUL9E,41550
|
|
338
|
+
revengai-1.85.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
339
|
+
revengai-1.85.0.dist-info/RECORD,,
|
|
File without changes
|