revengai 1.81.0__py3-none-any.whl → 1.84.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 +1 -7
- revengai/api/analyses_core_api.py +17 -0
- revengai/api/functions_ai_decompilation_api.py +3 -3
- revengai/api/functions_core_api.py +0 -309
- revengai/api_client.py +1 -1
- revengai/configuration.py +2 -2
- revengai/models/__init__.py +0 -3
- revengai/models/ai_decompilation_rating.py +1 -0
- revengai/models/analysis_record.py +8 -2
- revengai/models/auto_unstrip_request.py +6 -2
- revengai/models/auto_unstrip_response.py +9 -2
- revengai/models/get_ai_decompilation_rating_response.py +11 -4
- revengai/models/matched_function_suggestion.py +2 -7
- revengai/models/upsert_ai_decomplation_rating_request.py +11 -4
- {revengai-1.81.0.dist-info → revengai-1.84.0.dist-info}/METADATA +1 -5
- {revengai-1.81.0.dist-info → revengai-1.84.0.dist-info}/RECORD +17 -20
- revengai/models/auto_unstrip_by_group_response.py +0 -131
- revengai/models/matched_function_group.py +0 -88
- revengai/models/unstrip_request.py +0 -91
- {revengai-1.81.0.dist-info → revengai-1.84.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.84.0"
|
|
17
17
|
|
|
18
18
|
# Define package exports
|
|
19
19
|
__all__ = [
|
|
@@ -74,7 +74,6 @@ __all__ = [
|
|
|
74
74
|
"AppServicesBinaryAnnSchemaTagItem",
|
|
75
75
|
"AppServicesDynamicExecutionSchemasDynamicExecutionStatus",
|
|
76
76
|
"Argument",
|
|
77
|
-
"AutoUnstripByGroupResponse",
|
|
78
77
|
"AutoUnstripRequest",
|
|
79
78
|
"AutoUnstripResponse",
|
|
80
79
|
"BaseResponse",
|
|
@@ -274,7 +273,6 @@ __all__ = [
|
|
|
274
273
|
"LoginRequest",
|
|
275
274
|
"LoginResponse",
|
|
276
275
|
"Logs",
|
|
277
|
-
"MatchedFunctionGroup",
|
|
278
276
|
"MatchedFunctionSuggestion",
|
|
279
277
|
"MetaModel",
|
|
280
278
|
"ModelName",
|
|
@@ -343,7 +341,6 @@ __all__ = [
|
|
|
343
341
|
"ThreatScoreFunctionBody",
|
|
344
342
|
"TimestampModel",
|
|
345
343
|
"TypeDefinition",
|
|
346
|
-
"UnstripRequest",
|
|
347
344
|
"UpdateFunctionDataTypes",
|
|
348
345
|
"UploadFileType",
|
|
349
346
|
"UploadResponse",
|
|
@@ -417,7 +414,6 @@ from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV
|
|
|
417
414
|
from revengai.models.app_services_binary_ann_schema_tag_item import AppServicesBinaryAnnSchemaTagItem as AppServicesBinaryAnnSchemaTagItem
|
|
418
415
|
from revengai.models.app_services_dynamic_execution_schemas_dynamic_execution_status import AppServicesDynamicExecutionSchemasDynamicExecutionStatus as AppServicesDynamicExecutionSchemasDynamicExecutionStatus
|
|
419
416
|
from revengai.models.argument import Argument as Argument
|
|
420
|
-
from revengai.models.auto_unstrip_by_group_response import AutoUnstripByGroupResponse as AutoUnstripByGroupResponse
|
|
421
417
|
from revengai.models.auto_unstrip_request import AutoUnstripRequest as AutoUnstripRequest
|
|
422
418
|
from revengai.models.auto_unstrip_response import AutoUnstripResponse as AutoUnstripResponse
|
|
423
419
|
from revengai.models.base_response import BaseResponse as BaseResponse
|
|
@@ -617,7 +613,6 @@ from revengai.models.list_collection_results import ListCollectionResults as Lis
|
|
|
617
613
|
from revengai.models.login_request import LoginRequest as LoginRequest
|
|
618
614
|
from revengai.models.login_response import LoginResponse as LoginResponse
|
|
619
615
|
from revengai.models.logs import Logs as Logs
|
|
620
|
-
from revengai.models.matched_function_group import MatchedFunctionGroup as MatchedFunctionGroup
|
|
621
616
|
from revengai.models.matched_function_suggestion import MatchedFunctionSuggestion as MatchedFunctionSuggestion
|
|
622
617
|
from revengai.models.meta_model import MetaModel as MetaModel
|
|
623
618
|
from revengai.models.model_name import ModelName as ModelName
|
|
@@ -686,7 +681,6 @@ from revengai.models.task_status import TaskStatus as TaskStatus
|
|
|
686
681
|
from revengai.models.threat_score_function_body import ThreatScoreFunctionBody as ThreatScoreFunctionBody
|
|
687
682
|
from revengai.models.timestamp_model import TimestampModel as TimestampModel
|
|
688
683
|
from revengai.models.type_definition import TypeDefinition as TypeDefinition
|
|
689
|
-
from revengai.models.unstrip_request import UnstripRequest as UnstripRequest
|
|
690
684
|
from revengai.models.update_function_data_types import UpdateFunctionDataTypes as UpdateFunctionDataTypes
|
|
691
685
|
from revengai.models.upload_file_type import UploadFileType as UploadFileType
|
|
692
686
|
from revengai.models.upload_response import UploadResponse as UploadResponse
|
|
@@ -2665,6 +2665,7 @@ class AnalysesCoreApi:
|
|
|
2665
2665
|
model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None,
|
|
2666
2666
|
dynamic_execution_status: Annotated[Optional[DynamicExecutionStatusInput], Field(description="Show analysis that have a dynamic execution with the given status")] = None,
|
|
2667
2667
|
usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None,
|
|
2668
|
+
sha256_hash: Optional[StrictStr] = None,
|
|
2668
2669
|
limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None,
|
|
2669
2670
|
offset: Optional[StrictInt] = None,
|
|
2670
2671
|
order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None,
|
|
@@ -2699,6 +2700,8 @@ class AnalysesCoreApi:
|
|
|
2699
2700
|
:type dynamic_execution_status: DynamicExecutionStatusInput
|
|
2700
2701
|
:param usernames: Show analysis belonging to the user
|
|
2701
2702
|
:type usernames: List[Optional[str]]
|
|
2703
|
+
:param sha256_hash:
|
|
2704
|
+
:type sha256_hash: str
|
|
2702
2705
|
:param limit:
|
|
2703
2706
|
:type limit: int
|
|
2704
2707
|
:param offset:
|
|
@@ -2738,6 +2741,7 @@ class AnalysesCoreApi:
|
|
|
2738
2741
|
model_name=model_name,
|
|
2739
2742
|
dynamic_execution_status=dynamic_execution_status,
|
|
2740
2743
|
usernames=usernames,
|
|
2744
|
+
sha256_hash=sha256_hash,
|
|
2741
2745
|
limit=limit,
|
|
2742
2746
|
offset=offset,
|
|
2743
2747
|
order_by=order_by,
|
|
@@ -2773,6 +2777,7 @@ class AnalysesCoreApi:
|
|
|
2773
2777
|
model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None,
|
|
2774
2778
|
dynamic_execution_status: Annotated[Optional[DynamicExecutionStatusInput], Field(description="Show analysis that have a dynamic execution with the given status")] = None,
|
|
2775
2779
|
usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None,
|
|
2780
|
+
sha256_hash: Optional[StrictStr] = None,
|
|
2776
2781
|
limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None,
|
|
2777
2782
|
offset: Optional[StrictInt] = None,
|
|
2778
2783
|
order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None,
|
|
@@ -2807,6 +2812,8 @@ class AnalysesCoreApi:
|
|
|
2807
2812
|
:type dynamic_execution_status: DynamicExecutionStatusInput
|
|
2808
2813
|
:param usernames: Show analysis belonging to the user
|
|
2809
2814
|
:type usernames: List[Optional[str]]
|
|
2815
|
+
:param sha256_hash:
|
|
2816
|
+
:type sha256_hash: str
|
|
2810
2817
|
:param limit:
|
|
2811
2818
|
:type limit: int
|
|
2812
2819
|
:param offset:
|
|
@@ -2846,6 +2853,7 @@ class AnalysesCoreApi:
|
|
|
2846
2853
|
model_name=model_name,
|
|
2847
2854
|
dynamic_execution_status=dynamic_execution_status,
|
|
2848
2855
|
usernames=usernames,
|
|
2856
|
+
sha256_hash=sha256_hash,
|
|
2849
2857
|
limit=limit,
|
|
2850
2858
|
offset=offset,
|
|
2851
2859
|
order_by=order_by,
|
|
@@ -2881,6 +2889,7 @@ class AnalysesCoreApi:
|
|
|
2881
2889
|
model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None,
|
|
2882
2890
|
dynamic_execution_status: Annotated[Optional[DynamicExecutionStatusInput], Field(description="Show analysis that have a dynamic execution with the given status")] = None,
|
|
2883
2891
|
usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None,
|
|
2892
|
+
sha256_hash: Optional[StrictStr] = None,
|
|
2884
2893
|
limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None,
|
|
2885
2894
|
offset: Optional[StrictInt] = None,
|
|
2886
2895
|
order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None,
|
|
@@ -2915,6 +2924,8 @@ class AnalysesCoreApi:
|
|
|
2915
2924
|
:type dynamic_execution_status: DynamicExecutionStatusInput
|
|
2916
2925
|
:param usernames: Show analysis belonging to the user
|
|
2917
2926
|
:type usernames: List[Optional[str]]
|
|
2927
|
+
:param sha256_hash:
|
|
2928
|
+
:type sha256_hash: str
|
|
2918
2929
|
:param limit:
|
|
2919
2930
|
:type limit: int
|
|
2920
2931
|
:param offset:
|
|
@@ -2954,6 +2965,7 @@ class AnalysesCoreApi:
|
|
|
2954
2965
|
model_name=model_name,
|
|
2955
2966
|
dynamic_execution_status=dynamic_execution_status,
|
|
2956
2967
|
usernames=usernames,
|
|
2968
|
+
sha256_hash=sha256_hash,
|
|
2957
2969
|
limit=limit,
|
|
2958
2970
|
offset=offset,
|
|
2959
2971
|
order_by=order_by,
|
|
@@ -2984,6 +2996,7 @@ class AnalysesCoreApi:
|
|
|
2984
2996
|
model_name,
|
|
2985
2997
|
dynamic_execution_status,
|
|
2986
2998
|
usernames,
|
|
2999
|
+
sha256_hash,
|
|
2987
3000
|
limit,
|
|
2988
3001
|
offset,
|
|
2989
3002
|
order_by,
|
|
@@ -3039,6 +3052,10 @@ class AnalysesCoreApi:
|
|
|
3039
3052
|
|
|
3040
3053
|
_query_params.append(('usernames', usernames))
|
|
3041
3054
|
|
|
3055
|
+
if sha256_hash is not None:
|
|
3056
|
+
|
|
3057
|
+
_query_params.append(('sha256_hash', sha256_hash))
|
|
3058
|
+
|
|
3042
3059
|
if limit is not None:
|
|
3043
3060
|
|
|
3044
3061
|
_query_params.append(('limit', limit))
|
|
@@ -2484,7 +2484,7 @@ class FunctionsAIDecompilationApi:
|
|
|
2484
2484
|
)
|
|
2485
2485
|
|
|
2486
2486
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
2487
|
-
'
|
|
2487
|
+
'201': "BaseResponse",
|
|
2488
2488
|
'422': "BaseResponse",
|
|
2489
2489
|
}
|
|
2490
2490
|
response_data = self.api_client.call_api(
|
|
@@ -2559,7 +2559,7 @@ class FunctionsAIDecompilationApi:
|
|
|
2559
2559
|
)
|
|
2560
2560
|
|
|
2561
2561
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
2562
|
-
'
|
|
2562
|
+
'201': "BaseResponse",
|
|
2563
2563
|
'422': "BaseResponse",
|
|
2564
2564
|
}
|
|
2565
2565
|
response_data = self.api_client.call_api(
|
|
@@ -2634,7 +2634,7 @@ class FunctionsAIDecompilationApi:
|
|
|
2634
2634
|
)
|
|
2635
2635
|
|
|
2636
2636
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
2637
|
-
'
|
|
2637
|
+
'201': "BaseResponse",
|
|
2638
2638
|
'422': "BaseResponse",
|
|
2639
2639
|
}
|
|
2640
2640
|
response_data = self.api_client.call_api(
|
|
@@ -19,7 +19,6 @@ from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
|
19
19
|
from typing import List, Optional, Union
|
|
20
20
|
from typing_extensions import Annotated
|
|
21
21
|
from revengai.models.ai_unstrip_request import AiUnstripRequest
|
|
22
|
-
from revengai.models.auto_unstrip_by_group_response import AutoUnstripByGroupResponse
|
|
23
22
|
from revengai.models.auto_unstrip_request import AutoUnstripRequest
|
|
24
23
|
from revengai.models.auto_unstrip_response import AutoUnstripResponse
|
|
25
24
|
from revengai.models.base_response_analysis_strings_response import BaseResponseAnalysisStringsResponse
|
|
@@ -29,7 +28,6 @@ from revengai.models.base_response_function_capability_response import BaseRespo
|
|
|
29
28
|
from revengai.models.base_response_function_strings_response import BaseResponseFunctionStringsResponse
|
|
30
29
|
from revengai.models.base_response_functions_detail_response import BaseResponseFunctionsDetailResponse
|
|
31
30
|
from revengai.models.base_response_list_similar_functions_response import BaseResponseListSimilarFunctionsResponse
|
|
32
|
-
from revengai.models.unstrip_request import UnstripRequest
|
|
33
31
|
|
|
34
32
|
from revengai.api_client import ApiClient, RequestSerialized
|
|
35
33
|
from revengai.api_response import ApiResponse
|
|
@@ -3390,310 +3388,3 @@ class FunctionsCoreApi:
|
|
|
3390
3388
|
)
|
|
3391
3389
|
|
|
3392
3390
|
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
@validate_call
|
|
3396
|
-
def unstrip(
|
|
3397
|
-
self,
|
|
3398
|
-
analysis_id: StrictInt,
|
|
3399
|
-
unstrip_request: UnstripRequest,
|
|
3400
|
-
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
3401
|
-
_request_timeout: Union[
|
|
3402
|
-
None,
|
|
3403
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
3404
|
-
Tuple[
|
|
3405
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
3406
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
3407
|
-
]
|
|
3408
|
-
] = None,
|
|
3409
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3410
|
-
_content_type: Optional[StrictStr] = None,
|
|
3411
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3412
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3413
|
-
) -> AutoUnstripByGroupResponse:
|
|
3414
|
-
"""Performs matching and auto-unstrip for an analysis and its functions
|
|
3415
|
-
|
|
3416
|
-
Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system
|
|
3417
|
-
|
|
3418
|
-
:param analysis_id: (required)
|
|
3419
|
-
:type analysis_id: int
|
|
3420
|
-
:param unstrip_request: (required)
|
|
3421
|
-
:type unstrip_request: UnstripRequest
|
|
3422
|
-
:param authorization: API Key bearer token
|
|
3423
|
-
:type authorization: str
|
|
3424
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
3425
|
-
number provided, it will be total request
|
|
3426
|
-
timeout. It can also be a pair (tuple) of
|
|
3427
|
-
(connection, read) timeouts.
|
|
3428
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
3429
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
3430
|
-
request; this effectively ignores the
|
|
3431
|
-
authentication in the spec for a single request.
|
|
3432
|
-
:type _request_auth: dict, optional
|
|
3433
|
-
:param _content_type: force content-type for the request.
|
|
3434
|
-
:type _content_type: str, Optional
|
|
3435
|
-
:param _headers: set to override the headers for a single
|
|
3436
|
-
request; this effectively ignores the headers
|
|
3437
|
-
in the spec for a single request.
|
|
3438
|
-
:type _headers: dict, optional
|
|
3439
|
-
:param _host_index: set to override the host_index for a single
|
|
3440
|
-
request; this effectively ignores the host_index
|
|
3441
|
-
in the spec for a single request.
|
|
3442
|
-
:type _host_index: int, optional
|
|
3443
|
-
:return: Returns the result object.
|
|
3444
|
-
""" # noqa: E501
|
|
3445
|
-
|
|
3446
|
-
_param = self._unstrip_serialize(
|
|
3447
|
-
analysis_id=analysis_id,
|
|
3448
|
-
unstrip_request=unstrip_request,
|
|
3449
|
-
authorization=authorization,
|
|
3450
|
-
_request_auth=_request_auth,
|
|
3451
|
-
_content_type=_content_type,
|
|
3452
|
-
_headers=_headers,
|
|
3453
|
-
_host_index=_host_index
|
|
3454
|
-
)
|
|
3455
|
-
|
|
3456
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
3457
|
-
'200': "AutoUnstripByGroupResponse",
|
|
3458
|
-
'422': "BaseResponse",
|
|
3459
|
-
}
|
|
3460
|
-
response_data = self.api_client.call_api(
|
|
3461
|
-
*_param,
|
|
3462
|
-
_request_timeout=_request_timeout
|
|
3463
|
-
)
|
|
3464
|
-
response_data.read()
|
|
3465
|
-
return self.api_client.response_deserialize(
|
|
3466
|
-
response_data=response_data,
|
|
3467
|
-
response_types_map=_response_types_map,
|
|
3468
|
-
).data
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
@validate_call
|
|
3472
|
-
def unstrip_with_http_info(
|
|
3473
|
-
self,
|
|
3474
|
-
analysis_id: StrictInt,
|
|
3475
|
-
unstrip_request: UnstripRequest,
|
|
3476
|
-
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
3477
|
-
_request_timeout: Union[
|
|
3478
|
-
None,
|
|
3479
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
3480
|
-
Tuple[
|
|
3481
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
3482
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
3483
|
-
]
|
|
3484
|
-
] = None,
|
|
3485
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3486
|
-
_content_type: Optional[StrictStr] = None,
|
|
3487
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3488
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3489
|
-
) -> ApiResponse[AutoUnstripByGroupResponse]:
|
|
3490
|
-
"""Performs matching and auto-unstrip for an analysis and its functions
|
|
3491
|
-
|
|
3492
|
-
Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system
|
|
3493
|
-
|
|
3494
|
-
:param analysis_id: (required)
|
|
3495
|
-
:type analysis_id: int
|
|
3496
|
-
:param unstrip_request: (required)
|
|
3497
|
-
:type unstrip_request: UnstripRequest
|
|
3498
|
-
:param authorization: API Key bearer token
|
|
3499
|
-
:type authorization: str
|
|
3500
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
3501
|
-
number provided, it will be total request
|
|
3502
|
-
timeout. It can also be a pair (tuple) of
|
|
3503
|
-
(connection, read) timeouts.
|
|
3504
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
3505
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
3506
|
-
request; this effectively ignores the
|
|
3507
|
-
authentication in the spec for a single request.
|
|
3508
|
-
:type _request_auth: dict, optional
|
|
3509
|
-
:param _content_type: force content-type for the request.
|
|
3510
|
-
:type _content_type: str, Optional
|
|
3511
|
-
:param _headers: set to override the headers for a single
|
|
3512
|
-
request; this effectively ignores the headers
|
|
3513
|
-
in the spec for a single request.
|
|
3514
|
-
:type _headers: dict, optional
|
|
3515
|
-
:param _host_index: set to override the host_index for a single
|
|
3516
|
-
request; this effectively ignores the host_index
|
|
3517
|
-
in the spec for a single request.
|
|
3518
|
-
:type _host_index: int, optional
|
|
3519
|
-
:return: Returns the result object.
|
|
3520
|
-
""" # noqa: E501
|
|
3521
|
-
|
|
3522
|
-
_param = self._unstrip_serialize(
|
|
3523
|
-
analysis_id=analysis_id,
|
|
3524
|
-
unstrip_request=unstrip_request,
|
|
3525
|
-
authorization=authorization,
|
|
3526
|
-
_request_auth=_request_auth,
|
|
3527
|
-
_content_type=_content_type,
|
|
3528
|
-
_headers=_headers,
|
|
3529
|
-
_host_index=_host_index
|
|
3530
|
-
)
|
|
3531
|
-
|
|
3532
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
3533
|
-
'200': "AutoUnstripByGroupResponse",
|
|
3534
|
-
'422': "BaseResponse",
|
|
3535
|
-
}
|
|
3536
|
-
response_data = self.api_client.call_api(
|
|
3537
|
-
*_param,
|
|
3538
|
-
_request_timeout=_request_timeout
|
|
3539
|
-
)
|
|
3540
|
-
response_data.read()
|
|
3541
|
-
return self.api_client.response_deserialize(
|
|
3542
|
-
response_data=response_data,
|
|
3543
|
-
response_types_map=_response_types_map,
|
|
3544
|
-
)
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
@validate_call
|
|
3548
|
-
def unstrip_without_preload_content(
|
|
3549
|
-
self,
|
|
3550
|
-
analysis_id: StrictInt,
|
|
3551
|
-
unstrip_request: UnstripRequest,
|
|
3552
|
-
authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
|
|
3553
|
-
_request_timeout: Union[
|
|
3554
|
-
None,
|
|
3555
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
3556
|
-
Tuple[
|
|
3557
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
3558
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
3559
|
-
]
|
|
3560
|
-
] = None,
|
|
3561
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3562
|
-
_content_type: Optional[StrictStr] = None,
|
|
3563
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3564
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3565
|
-
) -> RESTResponseType:
|
|
3566
|
-
"""Performs matching and auto-unstrip for an analysis and its functions
|
|
3567
|
-
|
|
3568
|
-
Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system
|
|
3569
|
-
|
|
3570
|
-
:param analysis_id: (required)
|
|
3571
|
-
:type analysis_id: int
|
|
3572
|
-
:param unstrip_request: (required)
|
|
3573
|
-
:type unstrip_request: UnstripRequest
|
|
3574
|
-
:param authorization: API Key bearer token
|
|
3575
|
-
:type authorization: str
|
|
3576
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
3577
|
-
number provided, it will be total request
|
|
3578
|
-
timeout. It can also be a pair (tuple) of
|
|
3579
|
-
(connection, read) timeouts.
|
|
3580
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
3581
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
3582
|
-
request; this effectively ignores the
|
|
3583
|
-
authentication in the spec for a single request.
|
|
3584
|
-
:type _request_auth: dict, optional
|
|
3585
|
-
:param _content_type: force content-type for the request.
|
|
3586
|
-
:type _content_type: str, Optional
|
|
3587
|
-
:param _headers: set to override the headers for a single
|
|
3588
|
-
request; this effectively ignores the headers
|
|
3589
|
-
in the spec for a single request.
|
|
3590
|
-
:type _headers: dict, optional
|
|
3591
|
-
:param _host_index: set to override the host_index for a single
|
|
3592
|
-
request; this effectively ignores the host_index
|
|
3593
|
-
in the spec for a single request.
|
|
3594
|
-
:type _host_index: int, optional
|
|
3595
|
-
:return: Returns the result object.
|
|
3596
|
-
""" # noqa: E501
|
|
3597
|
-
|
|
3598
|
-
_param = self._unstrip_serialize(
|
|
3599
|
-
analysis_id=analysis_id,
|
|
3600
|
-
unstrip_request=unstrip_request,
|
|
3601
|
-
authorization=authorization,
|
|
3602
|
-
_request_auth=_request_auth,
|
|
3603
|
-
_content_type=_content_type,
|
|
3604
|
-
_headers=_headers,
|
|
3605
|
-
_host_index=_host_index
|
|
3606
|
-
)
|
|
3607
|
-
|
|
3608
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
3609
|
-
'200': "AutoUnstripByGroupResponse",
|
|
3610
|
-
'422': "BaseResponse",
|
|
3611
|
-
}
|
|
3612
|
-
response_data = self.api_client.call_api(
|
|
3613
|
-
*_param,
|
|
3614
|
-
_request_timeout=_request_timeout
|
|
3615
|
-
)
|
|
3616
|
-
return response_data.response
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
def _unstrip_serialize(
|
|
3620
|
-
self,
|
|
3621
|
-
analysis_id,
|
|
3622
|
-
unstrip_request,
|
|
3623
|
-
authorization,
|
|
3624
|
-
_request_auth,
|
|
3625
|
-
_content_type,
|
|
3626
|
-
_headers,
|
|
3627
|
-
_host_index,
|
|
3628
|
-
) -> RequestSerialized:
|
|
3629
|
-
|
|
3630
|
-
_host = None
|
|
3631
|
-
|
|
3632
|
-
_collection_formats: Dict[str, str] = {
|
|
3633
|
-
}
|
|
3634
|
-
|
|
3635
|
-
_path_params: Dict[str, str] = {}
|
|
3636
|
-
_query_params: List[Tuple[str, str]] = []
|
|
3637
|
-
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
3638
|
-
_form_params: List[Tuple[str, str]] = []
|
|
3639
|
-
_files: Dict[
|
|
3640
|
-
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
3641
|
-
] = {}
|
|
3642
|
-
_body_params: Optional[bytes] = None
|
|
3643
|
-
|
|
3644
|
-
# process the path parameters
|
|
3645
|
-
if analysis_id is not None:
|
|
3646
|
-
_path_params['analysis_id'] = analysis_id
|
|
3647
|
-
# process the query parameters
|
|
3648
|
-
# process the header parameters
|
|
3649
|
-
if authorization is not None:
|
|
3650
|
-
_header_params['authorization'] = authorization
|
|
3651
|
-
# process the form parameters
|
|
3652
|
-
# process the body parameter
|
|
3653
|
-
if unstrip_request is not None:
|
|
3654
|
-
_body_params = unstrip_request
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
# set the HTTP header `Accept`
|
|
3658
|
-
if 'Accept' not in _header_params:
|
|
3659
|
-
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
3660
|
-
[
|
|
3661
|
-
'application/json'
|
|
3662
|
-
]
|
|
3663
|
-
)
|
|
3664
|
-
|
|
3665
|
-
# set the HTTP header `Content-Type`
|
|
3666
|
-
if _content_type:
|
|
3667
|
-
_header_params['Content-Type'] = _content_type
|
|
3668
|
-
else:
|
|
3669
|
-
_default_content_type = (
|
|
3670
|
-
self.api_client.select_header_content_type(
|
|
3671
|
-
[
|
|
3672
|
-
'application/json'
|
|
3673
|
-
]
|
|
3674
|
-
)
|
|
3675
|
-
)
|
|
3676
|
-
if _default_content_type is not None:
|
|
3677
|
-
_header_params['Content-Type'] = _default_content_type
|
|
3678
|
-
|
|
3679
|
-
# authentication setting
|
|
3680
|
-
_auth_settings: List[str] = [
|
|
3681
|
-
'APIKey'
|
|
3682
|
-
]
|
|
3683
|
-
|
|
3684
|
-
return self.api_client.param_serialize(
|
|
3685
|
-
method='POST',
|
|
3686
|
-
resource_path='/v2/analyses/{analysis_id}/functions/unstrip',
|
|
3687
|
-
path_params=_path_params,
|
|
3688
|
-
query_params=_query_params,
|
|
3689
|
-
header_params=_header_params,
|
|
3690
|
-
body=_body_params,
|
|
3691
|
-
post_params=_form_params,
|
|
3692
|
-
files=_files,
|
|
3693
|
-
auth_settings=_auth_settings,
|
|
3694
|
-
collection_formats=_collection_formats,
|
|
3695
|
-
_host=_host,
|
|
3696
|
-
_request_auth=_request_auth
|
|
3697
|
-
)
|
|
3698
|
-
|
|
3699
|
-
|
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.84.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.84.0\n"\
|
|
533
|
+
"SDK Package Version: v1.84.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
|
@@ -40,7 +40,6 @@ from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV
|
|
|
40
40
|
from revengai.models.app_services_binary_ann_schema_tag_item import AppServicesBinaryAnnSchemaTagItem
|
|
41
41
|
from revengai.models.app_services_dynamic_execution_schemas_dynamic_execution_status import AppServicesDynamicExecutionSchemasDynamicExecutionStatus
|
|
42
42
|
from revengai.models.argument import Argument
|
|
43
|
-
from revengai.models.auto_unstrip_by_group_response import AutoUnstripByGroupResponse
|
|
44
43
|
from revengai.models.auto_unstrip_request import AutoUnstripRequest
|
|
45
44
|
from revengai.models.auto_unstrip_response import AutoUnstripResponse
|
|
46
45
|
from revengai.models.base_response import BaseResponse
|
|
@@ -240,7 +239,6 @@ from revengai.models.list_collection_results import ListCollectionResults
|
|
|
240
239
|
from revengai.models.login_request import LoginRequest
|
|
241
240
|
from revengai.models.login_response import LoginResponse
|
|
242
241
|
from revengai.models.logs import Logs
|
|
243
|
-
from revengai.models.matched_function_group import MatchedFunctionGroup
|
|
244
242
|
from revengai.models.matched_function_suggestion import MatchedFunctionSuggestion
|
|
245
243
|
from revengai.models.meta_model import MetaModel
|
|
246
244
|
from revengai.models.model_name import ModelName
|
|
@@ -309,7 +307,6 @@ from revengai.models.task_status import TaskStatus
|
|
|
309
307
|
from revengai.models.threat_score_function_body import ThreatScoreFunctionBody
|
|
310
308
|
from revengai.models.timestamp_model import TimestampModel
|
|
311
309
|
from revengai.models.type_definition import TypeDefinition
|
|
312
|
-
from revengai.models.unstrip_request import UnstripRequest
|
|
313
310
|
from revengai.models.update_function_data_types import UpdateFunctionDataTypes
|
|
314
311
|
from revengai.models.upload_file_type import UploadFileType
|
|
315
312
|
from revengai.models.upload_response import UploadResponse
|
|
@@ -31,16 +31,19 @@ class AnalysisRecord(BaseModel):
|
|
|
31
31
|
analysis_scope: StrictStr = Field(description="Scope of the analysis")
|
|
32
32
|
binary_id: StrictInt = Field(description="ID to identify the binary analyse")
|
|
33
33
|
model_id: StrictInt = Field(description="ID to identify the model used for analysis")
|
|
34
|
+
model_name: StrictStr = Field(description="Name of the model used for analysis")
|
|
34
35
|
status: StrictStr = Field(description="The current status of analysis")
|
|
35
36
|
creation: datetime = Field(description="The current status of analysis")
|
|
36
37
|
is_owner: StrictBool = Field(description="Whether the current user is the owner of a binary")
|
|
37
38
|
binary_name: StrictStr = Field(description="The name of the file uploaded")
|
|
38
39
|
sha_256_hash: StrictStr = Field(description="The hash of the binary")
|
|
40
|
+
function_boundaries_hash: StrictStr = Field(description="The hash of the function boundaries")
|
|
39
41
|
binary_size: StrictInt = Field(description="The size of the binary")
|
|
40
42
|
username: StrictStr = Field(description="The username of the analysis owner")
|
|
41
43
|
dynamic_execution_status: Optional[AppApiRestV2AnalysesEnumsDynamicExecutionStatus] = None
|
|
42
44
|
dynamic_execution_task_id: Optional[StrictInt] = None
|
|
43
|
-
|
|
45
|
+
base_address: StrictInt = Field(description="The base address of the binary")
|
|
46
|
+
__properties: ClassVar[List[str]] = ["analysis_id", "analysis_scope", "binary_id", "model_id", "model_name", "status", "creation", "is_owner", "binary_name", "sha_256_hash", "function_boundaries_hash", "binary_size", "username", "dynamic_execution_status", "dynamic_execution_task_id", "base_address"]
|
|
44
47
|
|
|
45
48
|
model_config = ConfigDict(
|
|
46
49
|
populate_by_name=True,
|
|
@@ -107,15 +110,18 @@ class AnalysisRecord(BaseModel):
|
|
|
107
110
|
"analysis_scope": obj.get("analysis_scope"),
|
|
108
111
|
"binary_id": obj.get("binary_id"),
|
|
109
112
|
"model_id": obj.get("model_id"),
|
|
113
|
+
"model_name": obj.get("model_name"),
|
|
110
114
|
"status": obj.get("status"),
|
|
111
115
|
"creation": obj.get("creation"),
|
|
112
116
|
"is_owner": obj.get("is_owner"),
|
|
113
117
|
"binary_name": obj.get("binary_name"),
|
|
114
118
|
"sha_256_hash": obj.get("sha_256_hash"),
|
|
119
|
+
"function_boundaries_hash": obj.get("function_boundaries_hash"),
|
|
115
120
|
"binary_size": obj.get("binary_size"),
|
|
116
121
|
"username": obj.get("username"),
|
|
117
122
|
"dynamic_execution_status": obj.get("dynamic_execution_status"),
|
|
118
|
-
"dynamic_execution_task_id": obj.get("dynamic_execution_task_id")
|
|
123
|
+
"dynamic_execution_task_id": obj.get("dynamic_execution_task_id"),
|
|
124
|
+
"base_address": obj.get("base_address")
|
|
119
125
|
})
|
|
120
126
|
return _obj
|
|
121
127
|
|
|
@@ -28,7 +28,9 @@ class AutoUnstripRequest(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
min_similarity: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=0.9, description="Minimum similarity expected for a match, default is 0.9")
|
|
30
30
|
apply: Optional[StrictBool] = Field(default=False, description="Whether to apply the matched function names to the target binary, default is False")
|
|
31
|
-
|
|
31
|
+
confidence_threshold: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=0.9, description="Confidence threshold for applying function names, default is 0.9")
|
|
32
|
+
min_group_size: Optional[Annotated[int, Field(le=20, strict=True, ge=1)]] = Field(default=10, description="Minimum number of matching functions required to consider for a match, default is 10")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["min_similarity", "apply", "confidence_threshold", "min_group_size"]
|
|
32
34
|
|
|
33
35
|
model_config = ConfigDict(
|
|
34
36
|
populate_by_name=True,
|
|
@@ -82,7 +84,9 @@ class AutoUnstripRequest(BaseModel):
|
|
|
82
84
|
|
|
83
85
|
_obj = cls.model_validate({
|
|
84
86
|
"min_similarity": obj.get("min_similarity") if obj.get("min_similarity") is not None else 0.9,
|
|
85
|
-
"apply": obj.get("apply") if obj.get("apply") is not None else False
|
|
87
|
+
"apply": obj.get("apply") if obj.get("apply") is not None else False,
|
|
88
|
+
"confidence_threshold": obj.get("confidence_threshold") if obj.get("confidence_threshold") is not None else 0.9,
|
|
89
|
+
"min_group_size": obj.get("min_group_size") if obj.get("min_group_size") is not None else 10
|
|
86
90
|
})
|
|
87
91
|
return _obj
|
|
88
92
|
|
|
@@ -31,7 +31,8 @@ class AutoUnstripResponse(BaseModel):
|
|
|
31
31
|
total_time: Optional[StrictInt] = None
|
|
32
32
|
matches: Optional[List[MatchedFunctionSuggestion]] = None
|
|
33
33
|
applied: Optional[StrictBool] = None
|
|
34
|
-
|
|
34
|
+
error_message: Optional[StrictStr] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["progress", "status", "total_time", "matches", "applied", "error_message"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
populate_by_name=True,
|
|
@@ -99,6 +100,11 @@ class AutoUnstripResponse(BaseModel):
|
|
|
99
100
|
if self.applied is None and "applied" in self.model_fields_set:
|
|
100
101
|
_dict['applied'] = None
|
|
101
102
|
|
|
103
|
+
# set to None if error_message (nullable) is None
|
|
104
|
+
# and model_fields_set contains the field
|
|
105
|
+
if self.error_message is None and "error_message" in self.model_fields_set:
|
|
106
|
+
_dict['error_message'] = None
|
|
107
|
+
|
|
102
108
|
return _dict
|
|
103
109
|
|
|
104
110
|
@classmethod
|
|
@@ -115,7 +121,8 @@ class AutoUnstripResponse(BaseModel):
|
|
|
115
121
|
"status": obj.get("status"),
|
|
116
122
|
"total_time": obj.get("total_time"),
|
|
117
123
|
"matches": [MatchedFunctionSuggestion.from_dict(_item) for _item in obj["matches"]] if obj.get("matches") is not None else None,
|
|
118
|
-
"applied": obj.get("applied")
|
|
124
|
+
"applied": obj.get("applied"),
|
|
125
|
+
"error_message": obj.get("error_message")
|
|
119
126
|
})
|
|
120
127
|
return _obj
|
|
121
128
|
|
|
@@ -16,8 +16,8 @@ import pprint
|
|
|
16
16
|
import re # noqa: F401
|
|
17
17
|
import json
|
|
18
18
|
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
20
|
-
from typing import Any, ClassVar, Dict, List
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
21
|
from revengai.models.ai_decompilation_rating import AiDecompilationRating
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
@@ -27,7 +27,8 @@ class GetAiDecompilationRatingResponse(BaseModel):
|
|
|
27
27
|
GetAiDecompilationRatingResponse
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
rating: AiDecompilationRating = Field(description="The rating the user has given to the AI decompilation response")
|
|
30
|
-
|
|
30
|
+
reason: Optional[StrictStr]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["rating", "reason"]
|
|
31
32
|
|
|
32
33
|
model_config = ConfigDict(
|
|
33
34
|
populate_by_name=True,
|
|
@@ -68,6 +69,11 @@ class GetAiDecompilationRatingResponse(BaseModel):
|
|
|
68
69
|
exclude=excluded_fields,
|
|
69
70
|
exclude_none=True,
|
|
70
71
|
)
|
|
72
|
+
# set to None if reason (nullable) is None
|
|
73
|
+
# and model_fields_set contains the field
|
|
74
|
+
if self.reason is None and "reason" in self.model_fields_set:
|
|
75
|
+
_dict['reason'] = None
|
|
76
|
+
|
|
71
77
|
return _dict
|
|
72
78
|
|
|
73
79
|
@classmethod
|
|
@@ -80,7 +86,8 @@ class GetAiDecompilationRatingResponse(BaseModel):
|
|
|
80
86
|
return cls.model_validate(obj)
|
|
81
87
|
|
|
82
88
|
_obj = cls.model_validate({
|
|
83
|
-
"rating": obj.get("rating")
|
|
89
|
+
"rating": obj.get("rating"),
|
|
90
|
+
"reason": obj.get("reason")
|
|
84
91
|
})
|
|
85
92
|
return _obj
|
|
86
93
|
|
|
@@ -17,7 +17,7 @@ import re # noqa: F401
|
|
|
17
17
|
import json
|
|
18
18
|
|
|
19
19
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
20
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from typing import Any, ClassVar, Dict, List
|
|
21
21
|
from typing import Optional, Set
|
|
22
22
|
from typing_extensions import Self
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ class MatchedFunctionSuggestion(BaseModel):
|
|
|
26
26
|
MatchedFunctionSuggestion
|
|
27
27
|
""" # noqa: E501
|
|
28
28
|
function_id: StrictInt = Field(description="Unique identifier of the matched function")
|
|
29
|
-
function_vaddr:
|
|
29
|
+
function_vaddr: StrictInt = Field(description="Virtual address of the matched function")
|
|
30
30
|
suggested_name: StrictStr = Field(description="Name of the function group that contains the matched functions")
|
|
31
31
|
__properties: ClassVar[List[str]] = ["function_id", "function_vaddr", "suggested_name"]
|
|
32
32
|
|
|
@@ -69,11 +69,6 @@ class MatchedFunctionSuggestion(BaseModel):
|
|
|
69
69
|
exclude=excluded_fields,
|
|
70
70
|
exclude_none=True,
|
|
71
71
|
)
|
|
72
|
-
# set to None if function_vaddr (nullable) is None
|
|
73
|
-
# and model_fields_set contains the field
|
|
74
|
-
if self.function_vaddr is None and "function_vaddr" in self.model_fields_set:
|
|
75
|
-
_dict['function_vaddr'] = None
|
|
76
|
-
|
|
77
72
|
return _dict
|
|
78
73
|
|
|
79
74
|
@classmethod
|
|
@@ -16,8 +16,8 @@ import pprint
|
|
|
16
16
|
import re # noqa: F401
|
|
17
17
|
import json
|
|
18
18
|
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
20
|
-
from typing import Any, ClassVar, Dict, List
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
21
|
from revengai.models.ai_decompilation_rating import AiDecompilationRating
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
@@ -27,7 +27,8 @@ class UpsertAiDecomplationRatingRequest(BaseModel):
|
|
|
27
27
|
UpsertAiDecomplationRatingRequest
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
rating: AiDecompilationRating = Field(description="The rating for the AI decompilation response")
|
|
30
|
-
|
|
30
|
+
reason: Optional[StrictStr]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["rating", "reason"]
|
|
31
32
|
|
|
32
33
|
model_config = ConfigDict(
|
|
33
34
|
populate_by_name=True,
|
|
@@ -68,6 +69,11 @@ class UpsertAiDecomplationRatingRequest(BaseModel):
|
|
|
68
69
|
exclude=excluded_fields,
|
|
69
70
|
exclude_none=True,
|
|
70
71
|
)
|
|
72
|
+
# set to None if reason (nullable) is None
|
|
73
|
+
# and model_fields_set contains the field
|
|
74
|
+
if self.reason is None and "reason" in self.model_fields_set:
|
|
75
|
+
_dict['reason'] = None
|
|
76
|
+
|
|
71
77
|
return _dict
|
|
72
78
|
|
|
73
79
|
@classmethod
|
|
@@ -80,7 +86,8 @@ class UpsertAiDecomplationRatingRequest(BaseModel):
|
|
|
80
86
|
return cls.model_validate(obj)
|
|
81
87
|
|
|
82
88
|
_obj = cls.model_validate({
|
|
83
|
-
"rating": obj.get("rating")
|
|
89
|
+
"rating": obj.get("rating"),
|
|
90
|
+
"reason": obj.get("reason")
|
|
84
91
|
})
|
|
85
92
|
return _obj
|
|
86
93
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: revengai
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.84.0
|
|
4
4
|
Summary: RevEng.AI API
|
|
5
5
|
Project-URL: Repository, https://github.com/RevEngAI/revengai-python
|
|
6
6
|
Keywords: RevEng.AI API
|
|
@@ -145,7 +145,6 @@ Class | Method | HTTP request | Description
|
|
|
145
145
|
*FunctionsCoreApi* | [**get_function_details**](docs/FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details
|
|
146
146
|
*FunctionsCoreApi* | [**get_function_strings**](docs/FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function
|
|
147
147
|
*FunctionsCoreApi* | [**get_similar_functions**](docs/FunctionsCoreApi.md#get_similar_functions) | **GET** /v2/functions/{function_id}/similar-functions | Get list of similar functions
|
|
148
|
-
*FunctionsCoreApi* | [**unstrip**](docs/FunctionsCoreApi.md#unstrip) | **POST** /v2/analyses/{analysis_id}/functions/unstrip | Performs matching and auto-unstrip for an analysis and its functions
|
|
149
148
|
*FunctionsDataTypesApi* | [**generate_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_analysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types
|
|
150
149
|
*FunctionsDataTypesApi* | [**generate_function_data_types_for_functions**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_functions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions
|
|
151
150
|
*FunctionsDataTypesApi* | [**get_function_data_types**](docs/FunctionsDataTypesApi.md#get_function_data_types) | **GET** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types
|
|
@@ -202,7 +201,6 @@ Class | Method | HTTP request | Description
|
|
|
202
201
|
- [AppServicesBinaryAnnSchemaTagItem](docs/AppServicesBinaryAnnSchemaTagItem.md)
|
|
203
202
|
- [AppServicesDynamicExecutionSchemasDynamicExecutionStatus](docs/AppServicesDynamicExecutionSchemasDynamicExecutionStatus.md)
|
|
204
203
|
- [Argument](docs/Argument.md)
|
|
205
|
-
- [AutoUnstripByGroupResponse](docs/AutoUnstripByGroupResponse.md)
|
|
206
204
|
- [AutoUnstripRequest](docs/AutoUnstripRequest.md)
|
|
207
205
|
- [AutoUnstripResponse](docs/AutoUnstripResponse.md)
|
|
208
206
|
- [BaseResponse](docs/BaseResponse.md)
|
|
@@ -402,7 +400,6 @@ Class | Method | HTTP request | Description
|
|
|
402
400
|
- [LoginRequest](docs/LoginRequest.md)
|
|
403
401
|
- [LoginResponse](docs/LoginResponse.md)
|
|
404
402
|
- [Logs](docs/Logs.md)
|
|
405
|
-
- [MatchedFunctionGroup](docs/MatchedFunctionGroup.md)
|
|
406
403
|
- [MatchedFunctionSuggestion](docs/MatchedFunctionSuggestion.md)
|
|
407
404
|
- [MetaModel](docs/MetaModel.md)
|
|
408
405
|
- [ModelName](docs/ModelName.md)
|
|
@@ -471,7 +468,6 @@ Class | Method | HTTP request | Description
|
|
|
471
468
|
- [ThreatScoreFunctionBody](docs/ThreatScoreFunctionBody.md)
|
|
472
469
|
- [TimestampModel](docs/TimestampModel.md)
|
|
473
470
|
- [TypeDefinition](docs/TypeDefinition.md)
|
|
474
|
-
- [UnstripRequest](docs/UnstripRequest.md)
|
|
475
471
|
- [UpdateFunctionDataTypes](docs/UpdateFunctionDataTypes.md)
|
|
476
472
|
- [UploadFileType](docs/UploadFileType.md)
|
|
477
473
|
- [UploadResponse](docs/UploadResponse.md)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
revengai/__init__.py,sha256=
|
|
2
|
-
revengai/api_client.py,sha256=
|
|
1
|
+
revengai/__init__.py,sha256=FGOiX9-K2yeD5cEXYbC_ebSkcBhtT8P-x1XTbN-FN2o,42774
|
|
2
|
+
revengai/api_client.py,sha256=MKvRYVU91TxOdvQvertOesNJ82siYlDRA76wTp4dsTI,27670
|
|
3
3
|
revengai/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
4
|
-
revengai/configuration.py,sha256=
|
|
4
|
+
revengai/configuration.py,sha256=h1wTR-qjS7WMtC8qXCrmxTTEgN-TVtA8XZU7OlbXgQU,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
8
|
revengai/api/__init__.py,sha256=KS_1v_pNTcR2cIzEuwGEFq0f_-HmC6aGSgb1qaq2k90,1396
|
|
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=jm-L1Qqt0aSkaO97K6gV2cOV0Ja7pFML-NjvQyofgK8,184279
|
|
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
|
|
@@ -17,18 +17,18 @@ revengai/api/collections_api.py,sha256=B6QLZ8pzDssu60R9cRF66b6vEn2HFv9z_zHIVSFle
|
|
|
17
17
|
revengai/api/confidence_api.py,sha256=1tLfE_uMhK7kHQP3ErkHScJZo1x0pG2-FK_nK_DiFHk,50722
|
|
18
18
|
revengai/api/external_sources_api.py,sha256=JMyVAoivo6AsgeNekXnSk5BZh02APn9bzojoFzdsCdU,65993
|
|
19
19
|
revengai/api/firmware_api.py,sha256=IPkGAJ-gxmuNcz2sUM6ip-9N2DZujqLJWwhiLvUQBOA,24150
|
|
20
|
-
revengai/api/functions_ai_decompilation_api.py,sha256=
|
|
20
|
+
revengai/api/functions_ai_decompilation_api.py,sha256=ecFO-ENq9W7EoikKueY3McecKAw2fz44ZchYw6QJ29c,109824
|
|
21
21
|
revengai/api/functions_block_comments_api.py,sha256=SilDkZYrrJ2_6j-Hh-ZNTUZKp1G9XE9aUwVbDzev5Co,35480
|
|
22
|
-
revengai/api/functions_core_api.py,sha256
|
|
22
|
+
revengai/api/functions_core_api.py,sha256=c-_C24moDb5Eh2TCUEuVd5AkWGwweyt4Ufcliy23yRw,137529
|
|
23
23
|
revengai/api/functions_data_types_api.py,sha256=Fzu4oI6kTwSE820_cGjr09N_G3uGOa4DUiyPFwOqvx4,73869
|
|
24
24
|
revengai/api/functions_decompilation_api.py,sha256=nEvYHPFoonmKSAf_t4_voC3SfoDd-O9sisSfA-5hiJo,83262
|
|
25
25
|
revengai/api/functions_renaming_history_api.py,sha256=L2CDadLnZrA0oNxhJfTSLLiMDz0Z4583Q8zLEj-Ze2I,47441
|
|
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/models/__init__.py,sha256=
|
|
29
|
+
revengai/models/__init__.py,sha256=1li791YYAu9u8F6_MuZMIbhtg-WVh-rPQqsU0bPnZGw,23011
|
|
30
30
|
revengai/models/addr.py,sha256=-2N-UQsOiZ0eyEAQ7ssk0of8W2fBrXeYdTZXuVt3SZs,4787
|
|
31
|
-
revengai/models/ai_decompilation_rating.py,sha256=
|
|
31
|
+
revengai/models/ai_decompilation_rating.py,sha256=gyay27QJwToUNtK9NARyw731Sg8GFRTufGGUABVYyfo,722
|
|
32
32
|
revengai/models/ai_unstrip_request.py,sha256=loSXNdHATJmY5yttiUCE-lLEOkuE63qVDTz8U0eCAIc,2596
|
|
33
33
|
revengai/models/analysis_access_info.py,sha256=CWMzdVGXKeU52gmaV7xQV13jGTqkPGZGyHw_zGtnVoc,2500
|
|
34
34
|
revengai/models/analysis_config.py,sha256=AHM6VTaWJ69WfbANGqLOYjOmqCrcN-XO5rtv6qU44hY,4861
|
|
@@ -37,7 +37,7 @@ revengai/models/analysis_create_response.py,sha256=aaO3-lJ65iBGe5lnyW8exHb9qByDa
|
|
|
37
37
|
revengai/models/analysis_detail_response.py,sha256=KPyzlSbu9TU7itVlhGusJVSszrZAkuC8dMg1welYZeM,4170
|
|
38
38
|
revengai/models/analysis_function_mapping.py,sha256=_8LOSaBOgsFKLeqvoizbU2FSHtekA7aNrM7deIJyM4k,2886
|
|
39
39
|
revengai/models/analysis_functions.py,sha256=N1TKQuw33I9dw-i07kLus36k2bcAXQVm2oc1Ycfrgdw,3067
|
|
40
|
-
revengai/models/analysis_record.py,sha256=
|
|
40
|
+
revengai/models/analysis_record.py,sha256=DxnERhF-s5AilH804yKtMAOyXhhjWQsq0ned1ji5t5Q,5516
|
|
41
41
|
revengai/models/analysis_scope.py,sha256=azpsUux2axe4QKwQ4FbW30HbazYYVFP-e68F9zp33-4,668
|
|
42
42
|
revengai/models/analysis_strings_response.py,sha256=KcqljUjKapdNa_6-uCJ6E2DBiAHWYGDw0VD4l-mtmzY,3177
|
|
43
43
|
revengai/models/analysis_tags.py,sha256=bVeyZzwnPxmpuXdLk4Jpz0fLsjeRjw0kcBLgeiDvsW4,3663
|
|
@@ -55,9 +55,8 @@ revengai/models/app_api_rest_v2_functions_types_function.py,sha256=_5c3oqbCqBO7u
|
|
|
55
55
|
revengai/models/app_services_binary_ann_schema_tag_item.py,sha256=m25sIz8KEsPES0XGjmOZFhmLNLmB-jsakfRUpRfiMks,2977
|
|
56
56
|
revengai/models/app_services_dynamic_execution_schemas_dynamic_execution_status.py,sha256=9e3LDnw0iNCbowQPFTkNyIqkzsCQyJLZrx6tqRska6o,2562
|
|
57
57
|
revengai/models/argument.py,sha256=QmWpJiohyzTVC1GLHg1IlgM5QyONnBF6FGK_mOYQL_Y,3148
|
|
58
|
-
revengai/models/
|
|
59
|
-
revengai/models/
|
|
60
|
-
revengai/models/auto_unstrip_response.py,sha256=Mu2GzeIc8vL2PRIdAT7BWzQa38PyhEzqq8TyuI3luOo,4384
|
|
58
|
+
revengai/models/auto_unstrip_request.py,sha256=GCFMWRyyNhs3brpXwynAY6xVVQj2Quw2ChjAJLD1w34,3717
|
|
59
|
+
revengai/models/auto_unstrip_response.py,sha256=g37ANqNsVIM_BCb-kHNDak6E-8fNVUyPOh03YFjm2O8,4737
|
|
61
60
|
revengai/models/base_response.py,sha256=U1Hwv1TXztjpxHxXGwGk46egAYs49jfzEfr1nTajMjg,4526
|
|
62
61
|
revengai/models/base_response_analysis_create_response.py,sha256=bwA1vMqKgLUDcElBvuvTH2jo8tvx0mjfbMOnoniswbE,4682
|
|
63
62
|
revengai/models/base_response_analysis_detail_response.py,sha256=233L-ucrjTQhgwKeqiwlxW_C_Vrp4u4_pikrCti1F7Y,4682
|
|
@@ -240,7 +239,7 @@ revengai/models/functions_detail_response.py,sha256=FqXTOo1-VqLEadwpYsVvOVDOE1Y8
|
|
|
240
239
|
revengai/models/functions_list_rename.py,sha256=OOi3EPhwAcOItGwoRmuybXTxwMrMVxUK3eQg70x-l1E,2990
|
|
241
240
|
revengai/models/generate_function_data_types.py,sha256=lAr0jb2p0n8wchhOLX9w7ryn7vbY402hGoR4YcG8hhw,3335
|
|
242
241
|
revengai/models/generation_status_list.py,sha256=q_SaRG3Ut3bgGMJzPehAYt9OH-oramgRQM2ZpAI6mLQ,3501
|
|
243
|
-
revengai/models/get_ai_decompilation_rating_response.py,sha256=
|
|
242
|
+
revengai/models/get_ai_decompilation_rating_response.py,sha256=_PjBxmVJzKJhxGyBG8DhC48BOKzu3RYWK5MyNJEGElE,2945
|
|
244
243
|
revengai/models/get_ai_decompilation_task.py,sha256=wRpj3_8dxE0VRz8wzLNSHPl6rvKfONorKIRG_ObGwYk,6080
|
|
245
244
|
revengai/models/get_public_user_response.py,sha256=OyNV6Gxf7U-b9vWqaolz9Iie-eu2VtpZTTEtrFnHFAY,2518
|
|
246
245
|
revengai/models/get_user_response.py,sha256=ZQ9005Ji4CbfRHXyuLA9eNa3L-pu-yep6QDLJ9Zu6lE,2961
|
|
@@ -255,8 +254,7 @@ revengai/models/list_collection_results.py,sha256=ZYGFTvOQfI234u67tURX8J0jwb6q-A
|
|
|
255
254
|
revengai/models/login_request.py,sha256=48uYtkWFL_Q-hN64P1f15ExGJvbab9XLymBtDduQvg0,2684
|
|
256
255
|
revengai/models/login_response.py,sha256=O35cqntoQ68IdYCBtHTYhPXlDqw8CIlnK-bNjf6QMO0,2461
|
|
257
256
|
revengai/models/logs.py,sha256=cV_V-xN6q-yTd7eL-X89ugqz5ifWPsFPo6qYFgpS_Pw,2419
|
|
258
|
-
revengai/models/
|
|
259
|
-
revengai/models/matched_function_suggestion.py,sha256=whvMmEkwgmOiN9fYBAoZj4S21ARwIjevNP42NhdT9Bw,3096
|
|
257
|
+
revengai/models/matched_function_suggestion.py,sha256=eNMKuAyJ94joT5It020lSujrporie50-ii_OCOk3KhY,2900
|
|
260
258
|
revengai/models/meta_model.py,sha256=GbyFJZ9kwvK1Gqg8QnJ1GHpaMs8cMht6j-MY1k0YSt0,2943
|
|
261
259
|
revengai/models/model_name.py,sha256=lVKok5pWyLcN1rhq1IYccC7uQQrPdyz1oohYRUMRrmw,1271
|
|
262
260
|
revengai/models/models_response.py,sha256=Ooo2HYuSI4llHg1wUMmyOsisPAXkPhR1y5BSiKh9ckg,2472
|
|
@@ -324,16 +322,15 @@ revengai/models/ttps_data.py,sha256=b6P8ux7Q7poScHZCiRQ1xRyDNb-c28FfxDIkXG9gl8E,
|
|
|
324
322
|
revengai/models/ttps_element.py,sha256=6s_k91ASszks5JyUg7qhz0fnCRQhHzsNO_OAwxHRx0Q,3596
|
|
325
323
|
revengai/models/ttps_occurance.py,sha256=-HjHQO6MAVdkcyEhiOqtx4NPEAjAsll85zHvb_tIbUU,2443
|
|
326
324
|
revengai/models/type_definition.py,sha256=Cm7-pJokyxCQzwskOzjaL6zaSBIBrRU9n4foy6LmSYI,3122
|
|
327
|
-
revengai/models/unstrip_request.py,sha256=WbQfv9VRX1CuV8iI2RYJw8OPBL7PdbIqjK-gq_kKGnM,3240
|
|
328
325
|
revengai/models/update_function_data_types.py,sha256=LbwjKeNf-2OGieltMJ4kC5JrTCoUyTdbqhZkdMILUgI,3078
|
|
329
326
|
revengai/models/upload_file_type.py,sha256=dCCoTbdJ_BEjXzUO8THDtMvrVHUipyRSScoy_0tqDUw,715
|
|
330
327
|
revengai/models/upload_response.py,sha256=ekQ_VFy2u5WJnLWmmxS_sJVjF8qsMBebT10ngH3-xHs,2649
|
|
331
|
-
revengai/models/upsert_ai_decomplation_rating_request.py,sha256=
|
|
328
|
+
revengai/models/upsert_ai_decomplation_rating_request.py,sha256=k1Xc3NSKj3pQCQ45IGMLxZlvroSOK6sEybLCbTVqbZk,2931
|
|
332
329
|
revengai/models/user_activity_response.py,sha256=-EC33JI-AuYyzAR2ZgywONYUMNMaRJTDLmAAm_zgDwQ,2872
|
|
333
330
|
revengai/models/vulnerabilities.py,sha256=9t6uoZd3svWyfcZJjmj6zP731Dp47Apb25y8Qtp9p5Y,2968
|
|
334
331
|
revengai/models/vulnerability.py,sha256=P7rAOAYU5JLLpcRr824-YJgZba5kPb_J9ALV3tSNfLQ,3688
|
|
335
332
|
revengai/models/vulnerability_type.py,sha256=SyOgfMmELYYc_H84oPkikBpjwngtG5Qw9Q_86a2TPr8,866
|
|
336
333
|
revengai/models/workspace.py,sha256=chjU62GFvByEmaNd6luMNQVQLP3wlPx1zJgGJ_yyMLA,676
|
|
337
|
-
revengai-1.
|
|
338
|
-
revengai-1.
|
|
339
|
-
revengai-1.
|
|
334
|
+
revengai-1.84.0.dist-info/METADATA,sha256=6WIWBWIyO-yxbEk8eS4KasCzWYuPajMTQHkDfg8ZvdQ,41231
|
|
335
|
+
revengai-1.84.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
336
|
+
revengai-1.84.0.dist-info/RECORD,,
|
|
@@ -1,131 +0,0 @@
|
|
|
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, StrictInt, StrictStr
|
|
20
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
-
from revengai.models.matched_function_group import MatchedFunctionGroup
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class AutoUnstripByGroupResponse(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
AutoUnstripByGroupResponse
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
progress: Optional[StrictInt] = Field(default=0, description="Progress of the auto-unstrip operation, represented as a percentage")
|
|
30
|
-
status: Optional[StrictStr] = None
|
|
31
|
-
total_time: Optional[StrictInt] = None
|
|
32
|
-
matches_map: Optional[Dict[str, List[MatchedFunctionGroup]]] = None
|
|
33
|
-
applied: Optional[StrictBool] = None
|
|
34
|
-
__properties: ClassVar[List[str]] = ["progress", "status", "total_time", "matches_map", "applied"]
|
|
35
|
-
|
|
36
|
-
model_config = ConfigDict(
|
|
37
|
-
populate_by_name=True,
|
|
38
|
-
validate_assignment=True,
|
|
39
|
-
protected_namespaces=(),
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def to_str(self) -> str:
|
|
44
|
-
"""Returns the string representation of the model using alias"""
|
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
-
|
|
47
|
-
def to_json(self) -> str:
|
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of AutoUnstripByGroupResponse from a JSON string"""
|
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
|
56
|
-
|
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
|
59
|
-
|
|
60
|
-
This has the following differences from calling pydantic's
|
|
61
|
-
`self.model_dump(by_alias=True)`:
|
|
62
|
-
|
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
|
64
|
-
were set at model initialization. Other fields with value `None`
|
|
65
|
-
are ignored.
|
|
66
|
-
"""
|
|
67
|
-
excluded_fields: Set[str] = set([
|
|
68
|
-
])
|
|
69
|
-
|
|
70
|
-
_dict = self.model_dump(
|
|
71
|
-
by_alias=True,
|
|
72
|
-
exclude=excluded_fields,
|
|
73
|
-
exclude_none=True,
|
|
74
|
-
)
|
|
75
|
-
# override the default output from pydantic by calling `to_dict()` of each value in matches_map (dict of array)
|
|
76
|
-
_field_dict_of_array = {}
|
|
77
|
-
if self.matches_map:
|
|
78
|
-
for _key_matches_map in self.matches_map:
|
|
79
|
-
if self.matches_map[_key_matches_map] is not None:
|
|
80
|
-
_field_dict_of_array[_key_matches_map] = [
|
|
81
|
-
_item.to_dict() for _item in self.matches_map[_key_matches_map]
|
|
82
|
-
]
|
|
83
|
-
_dict['matches_map'] = _field_dict_of_array
|
|
84
|
-
# set to None if status (nullable) is None
|
|
85
|
-
# and model_fields_set contains the field
|
|
86
|
-
if self.status is None and "status" in self.model_fields_set:
|
|
87
|
-
_dict['status'] = None
|
|
88
|
-
|
|
89
|
-
# set to None if total_time (nullable) is None
|
|
90
|
-
# and model_fields_set contains the field
|
|
91
|
-
if self.total_time is None and "total_time" in self.model_fields_set:
|
|
92
|
-
_dict['total_time'] = None
|
|
93
|
-
|
|
94
|
-
# set to None if matches_map (nullable) is None
|
|
95
|
-
# and model_fields_set contains the field
|
|
96
|
-
if self.matches_map is None and "matches_map" in self.model_fields_set:
|
|
97
|
-
_dict['matches_map'] = None
|
|
98
|
-
|
|
99
|
-
# set to None if applied (nullable) is None
|
|
100
|
-
# and model_fields_set contains the field
|
|
101
|
-
if self.applied is None and "applied" in self.model_fields_set:
|
|
102
|
-
_dict['applied'] = None
|
|
103
|
-
|
|
104
|
-
return _dict
|
|
105
|
-
|
|
106
|
-
@classmethod
|
|
107
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
108
|
-
"""Create an instance of AutoUnstripByGroupResponse from a dict"""
|
|
109
|
-
if obj is None:
|
|
110
|
-
return None
|
|
111
|
-
|
|
112
|
-
if not isinstance(obj, dict):
|
|
113
|
-
return cls.model_validate(obj)
|
|
114
|
-
|
|
115
|
-
_obj = cls.model_validate({
|
|
116
|
-
"progress": obj.get("progress") if obj.get("progress") is not None else 0,
|
|
117
|
-
"status": obj.get("status"),
|
|
118
|
-
"total_time": obj.get("total_time"),
|
|
119
|
-
"matches_map": dict(
|
|
120
|
-
(_k,
|
|
121
|
-
[MatchedFunctionGroup.from_dict(_item) for _item in _v]
|
|
122
|
-
if _v is not None
|
|
123
|
-
else None
|
|
124
|
-
)
|
|
125
|
-
for _k, _v in obj.get("matches_map", {}).items()
|
|
126
|
-
),
|
|
127
|
-
"applied": obj.get("applied")
|
|
128
|
-
})
|
|
129
|
-
return _obj
|
|
130
|
-
|
|
131
|
-
|
|
@@ -1,88 +0,0 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr
|
|
20
|
-
from typing import Any, ClassVar, Dict, List, Union
|
|
21
|
-
from typing import Optional, Set
|
|
22
|
-
from typing_extensions import Self
|
|
23
|
-
|
|
24
|
-
class MatchedFunctionGroup(BaseModel):
|
|
25
|
-
"""
|
|
26
|
-
MatchedFunctionGroup
|
|
27
|
-
""" # noqa: E501
|
|
28
|
-
function_group_name: StrictStr = Field(description="Name of the function group that contains the matched functions")
|
|
29
|
-
similarity: Union[StrictFloat, StrictInt] = Field(description="Similarity score of the match")
|
|
30
|
-
__properties: ClassVar[List[str]] = ["function_group_name", "similarity"]
|
|
31
|
-
|
|
32
|
-
model_config = ConfigDict(
|
|
33
|
-
populate_by_name=True,
|
|
34
|
-
validate_assignment=True,
|
|
35
|
-
protected_namespaces=(),
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def to_str(self) -> str:
|
|
40
|
-
"""Returns the string representation of the model using alias"""
|
|
41
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
-
|
|
43
|
-
def to_json(self) -> str:
|
|
44
|
-
"""Returns the JSON representation of the model using alias"""
|
|
45
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
-
return json.dumps(self.to_dict())
|
|
47
|
-
|
|
48
|
-
@classmethod
|
|
49
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
-
"""Create an instance of MatchedFunctionGroup from a JSON string"""
|
|
51
|
-
return cls.from_dict(json.loads(json_str))
|
|
52
|
-
|
|
53
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
-
"""Return the dictionary representation of the model using alias.
|
|
55
|
-
|
|
56
|
-
This has the following differences from calling pydantic's
|
|
57
|
-
`self.model_dump(by_alias=True)`:
|
|
58
|
-
|
|
59
|
-
* `None` is only added to the output dict for nullable fields that
|
|
60
|
-
were set at model initialization. Other fields with value `None`
|
|
61
|
-
are ignored.
|
|
62
|
-
"""
|
|
63
|
-
excluded_fields: Set[str] = set([
|
|
64
|
-
])
|
|
65
|
-
|
|
66
|
-
_dict = self.model_dump(
|
|
67
|
-
by_alias=True,
|
|
68
|
-
exclude=excluded_fields,
|
|
69
|
-
exclude_none=True,
|
|
70
|
-
)
|
|
71
|
-
return _dict
|
|
72
|
-
|
|
73
|
-
@classmethod
|
|
74
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
-
"""Create an instance of MatchedFunctionGroup from a dict"""
|
|
76
|
-
if obj is None:
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
if not isinstance(obj, dict):
|
|
80
|
-
return cls.model_validate(obj)
|
|
81
|
-
|
|
82
|
-
_obj = cls.model_validate({
|
|
83
|
-
"function_group_name": obj.get("function_group_name"),
|
|
84
|
-
"similarity": obj.get("similarity")
|
|
85
|
-
})
|
|
86
|
-
return _obj
|
|
87
|
-
|
|
88
|
-
|
|
@@ -1,91 +0,0 @@
|
|
|
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
|
|
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 UnstripRequest(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
UnstripRequest
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
min_similarity: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0.0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=0.9, description="Minimum similarity expected for a match, default is 0.9")
|
|
30
|
-
limit: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=1, description="Maximum number of matches to return, default is 1, maximum is 10")
|
|
31
|
-
apply: Optional[StrictBool] = Field(default=False, description="Whether to apply the matched function names to the target binary, default is False")
|
|
32
|
-
__properties: ClassVar[List[str]] = ["min_similarity", "limit", "apply"]
|
|
33
|
-
|
|
34
|
-
model_config = ConfigDict(
|
|
35
|
-
populate_by_name=True,
|
|
36
|
-
validate_assignment=True,
|
|
37
|
-
protected_namespaces=(),
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def to_str(self) -> str:
|
|
42
|
-
"""Returns the string representation of the model using alias"""
|
|
43
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
-
|
|
45
|
-
def to_json(self) -> str:
|
|
46
|
-
"""Returns the JSON representation of the model using alias"""
|
|
47
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
-
return json.dumps(self.to_dict())
|
|
49
|
-
|
|
50
|
-
@classmethod
|
|
51
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
-
"""Create an instance of UnstripRequest from a JSON string"""
|
|
53
|
-
return cls.from_dict(json.loads(json_str))
|
|
54
|
-
|
|
55
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
-
"""Return the dictionary representation of the model using alias.
|
|
57
|
-
|
|
58
|
-
This has the following differences from calling pydantic's
|
|
59
|
-
`self.model_dump(by_alias=True)`:
|
|
60
|
-
|
|
61
|
-
* `None` is only added to the output dict for nullable fields that
|
|
62
|
-
were set at model initialization. Other fields with value `None`
|
|
63
|
-
are ignored.
|
|
64
|
-
"""
|
|
65
|
-
excluded_fields: Set[str] = set([
|
|
66
|
-
])
|
|
67
|
-
|
|
68
|
-
_dict = self.model_dump(
|
|
69
|
-
by_alias=True,
|
|
70
|
-
exclude=excluded_fields,
|
|
71
|
-
exclude_none=True,
|
|
72
|
-
)
|
|
73
|
-
return _dict
|
|
74
|
-
|
|
75
|
-
@classmethod
|
|
76
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
-
"""Create an instance of UnstripRequest from a dict"""
|
|
78
|
-
if obj is None:
|
|
79
|
-
return None
|
|
80
|
-
|
|
81
|
-
if not isinstance(obj, dict):
|
|
82
|
-
return cls.model_validate(obj)
|
|
83
|
-
|
|
84
|
-
_obj = cls.model_validate({
|
|
85
|
-
"min_similarity": obj.get("min_similarity") if obj.get("min_similarity") is not None else 0.9,
|
|
86
|
-
"limit": obj.get("limit") if obj.get("limit") is not None else 1,
|
|
87
|
-
"apply": obj.get("apply") if obj.get("apply") is not None else False
|
|
88
|
-
})
|
|
89
|
-
return _obj
|
|
90
|
-
|
|
91
|
-
|
|
File without changes
|