revengai 1.78.1__py3-none-any.whl → 1.80.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.

@@ -1,317 +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
- 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, StrictInt, StrictStr
19
- from typing import Optional
20
- from typing_extensions import Annotated
21
- from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping
22
-
23
- from revengai.api_client import ApiClient, RequestSerialized
24
- from revengai.api_response import ApiResponse
25
- from revengai.rest import RESTResponseType
26
-
27
-
28
- class DefaultApi:
29
- """NOTE: This class is auto generated by OpenAPI Generator
30
- Ref: https://openapi-generator.tech
31
-
32
- Do not edit the class manually.
33
- """
34
-
35
- def __init__(self, api_client=None) -> None:
36
- if api_client is None:
37
- api_client = ApiClient.get_default()
38
- self.api_client = api_client
39
-
40
-
41
- @validate_call
42
- def get_analysis_function_map(
43
- self,
44
- analysis_id: StrictInt,
45
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
46
- _request_timeout: Union[
47
- None,
48
- Annotated[StrictFloat, Field(gt=0)],
49
- Tuple[
50
- Annotated[StrictFloat, Field(gt=0)],
51
- Annotated[StrictFloat, Field(gt=0)]
52
- ]
53
- ] = None,
54
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
55
- _content_type: Optional[StrictStr] = None,
56
- _headers: Optional[Dict[StrictStr, Any]] = None,
57
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
58
- ) -> BaseResponseAnalysisFunctionMapping:
59
- """Get Analysis Function Map
60
-
61
- Returns the a map of function ids to function addresses for the analysis, and it's inverse.
62
-
63
- :param analysis_id: (required)
64
- :type analysis_id: int
65
- :param authorization: API Key bearer token
66
- :type authorization: str
67
- :param _request_timeout: timeout setting for this request. If one
68
- number provided, it will be total request
69
- timeout. It can also be a pair (tuple) of
70
- (connection, read) timeouts.
71
- :type _request_timeout: int, tuple(int, int), optional
72
- :param _request_auth: set to override the auth_settings for an a single
73
- request; this effectively ignores the
74
- authentication in the spec for a single request.
75
- :type _request_auth: dict, optional
76
- :param _content_type: force content-type for the request.
77
- :type _content_type: str, Optional
78
- :param _headers: set to override the headers for a single
79
- request; this effectively ignores the headers
80
- in the spec for a single request.
81
- :type _headers: dict, optional
82
- :param _host_index: set to override the host_index for a single
83
- request; this effectively ignores the host_index
84
- in the spec for a single request.
85
- :type _host_index: int, optional
86
- :return: Returns the result object.
87
- """ # noqa: E501
88
-
89
- _param = self._get_analysis_function_map_serialize(
90
- analysis_id=analysis_id,
91
- authorization=authorization,
92
- _request_auth=_request_auth,
93
- _content_type=_content_type,
94
- _headers=_headers,
95
- _host_index=_host_index
96
- )
97
-
98
- _response_types_map: Dict[str, Optional[str]] = {
99
- '200': "BaseResponseAnalysisFunctionMapping",
100
- '422': "BaseResponse",
101
- }
102
- response_data = self.api_client.call_api(
103
- *_param,
104
- _request_timeout=_request_timeout
105
- )
106
- response_data.read()
107
- return self.api_client.response_deserialize(
108
- response_data=response_data,
109
- response_types_map=_response_types_map,
110
- ).data
111
-
112
-
113
- @validate_call
114
- def get_analysis_function_map_with_http_info(
115
- self,
116
- analysis_id: StrictInt,
117
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
118
- _request_timeout: Union[
119
- None,
120
- Annotated[StrictFloat, Field(gt=0)],
121
- Tuple[
122
- Annotated[StrictFloat, Field(gt=0)],
123
- Annotated[StrictFloat, Field(gt=0)]
124
- ]
125
- ] = None,
126
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
- _content_type: Optional[StrictStr] = None,
128
- _headers: Optional[Dict[StrictStr, Any]] = None,
129
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
- ) -> ApiResponse[BaseResponseAnalysisFunctionMapping]:
131
- """Get Analysis Function Map
132
-
133
- Returns the a map of function ids to function addresses for the analysis, and it's inverse.
134
-
135
- :param analysis_id: (required)
136
- :type analysis_id: int
137
- :param authorization: API Key bearer token
138
- :type authorization: str
139
- :param _request_timeout: timeout setting for this request. If one
140
- number provided, it will be total request
141
- timeout. It can also be a pair (tuple) of
142
- (connection, read) timeouts.
143
- :type _request_timeout: int, tuple(int, int), optional
144
- :param _request_auth: set to override the auth_settings for an a single
145
- request; this effectively ignores the
146
- authentication in the spec for a single request.
147
- :type _request_auth: dict, optional
148
- :param _content_type: force content-type for the request.
149
- :type _content_type: str, Optional
150
- :param _headers: set to override the headers for a single
151
- request; this effectively ignores the headers
152
- in the spec for a single request.
153
- :type _headers: dict, optional
154
- :param _host_index: set to override the host_index for a single
155
- request; this effectively ignores the host_index
156
- in the spec for a single request.
157
- :type _host_index: int, optional
158
- :return: Returns the result object.
159
- """ # noqa: E501
160
-
161
- _param = self._get_analysis_function_map_serialize(
162
- analysis_id=analysis_id,
163
- authorization=authorization,
164
- _request_auth=_request_auth,
165
- _content_type=_content_type,
166
- _headers=_headers,
167
- _host_index=_host_index
168
- )
169
-
170
- _response_types_map: Dict[str, Optional[str]] = {
171
- '200': "BaseResponseAnalysisFunctionMapping",
172
- '422': "BaseResponse",
173
- }
174
- response_data = self.api_client.call_api(
175
- *_param,
176
- _request_timeout=_request_timeout
177
- )
178
- response_data.read()
179
- return self.api_client.response_deserialize(
180
- response_data=response_data,
181
- response_types_map=_response_types_map,
182
- )
183
-
184
-
185
- @validate_call
186
- def get_analysis_function_map_without_preload_content(
187
- self,
188
- analysis_id: StrictInt,
189
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
190
- _request_timeout: Union[
191
- None,
192
- Annotated[StrictFloat, Field(gt=0)],
193
- Tuple[
194
- Annotated[StrictFloat, Field(gt=0)],
195
- Annotated[StrictFloat, Field(gt=0)]
196
- ]
197
- ] = None,
198
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
199
- _content_type: Optional[StrictStr] = None,
200
- _headers: Optional[Dict[StrictStr, Any]] = None,
201
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
202
- ) -> RESTResponseType:
203
- """Get Analysis Function Map
204
-
205
- Returns the a map of function ids to function addresses for the analysis, and it's inverse.
206
-
207
- :param analysis_id: (required)
208
- :type analysis_id: int
209
- :param authorization: API Key bearer token
210
- :type authorization: str
211
- :param _request_timeout: timeout setting for this request. If one
212
- number provided, it will be total request
213
- timeout. It can also be a pair (tuple) of
214
- (connection, read) timeouts.
215
- :type _request_timeout: int, tuple(int, int), optional
216
- :param _request_auth: set to override the auth_settings for an a single
217
- request; this effectively ignores the
218
- authentication in the spec for a single request.
219
- :type _request_auth: dict, optional
220
- :param _content_type: force content-type for the request.
221
- :type _content_type: str, Optional
222
- :param _headers: set to override the headers for a single
223
- request; this effectively ignores the headers
224
- in the spec for a single request.
225
- :type _headers: dict, optional
226
- :param _host_index: set to override the host_index for a single
227
- request; this effectively ignores the host_index
228
- in the spec for a single request.
229
- :type _host_index: int, optional
230
- :return: Returns the result object.
231
- """ # noqa: E501
232
-
233
- _param = self._get_analysis_function_map_serialize(
234
- analysis_id=analysis_id,
235
- authorization=authorization,
236
- _request_auth=_request_auth,
237
- _content_type=_content_type,
238
- _headers=_headers,
239
- _host_index=_host_index
240
- )
241
-
242
- _response_types_map: Dict[str, Optional[str]] = {
243
- '200': "BaseResponseAnalysisFunctionMapping",
244
- '422': "BaseResponse",
245
- }
246
- response_data = self.api_client.call_api(
247
- *_param,
248
- _request_timeout=_request_timeout
249
- )
250
- return response_data.response
251
-
252
-
253
- def _get_analysis_function_map_serialize(
254
- self,
255
- analysis_id,
256
- authorization,
257
- _request_auth,
258
- _content_type,
259
- _headers,
260
- _host_index,
261
- ) -> RequestSerialized:
262
-
263
- _host = None
264
-
265
- _collection_formats: Dict[str, str] = {
266
- }
267
-
268
- _path_params: Dict[str, str] = {}
269
- _query_params: List[Tuple[str, str]] = []
270
- _header_params: Dict[str, Optional[str]] = _headers or {}
271
- _form_params: List[Tuple[str, str]] = []
272
- _files: Dict[
273
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
274
- ] = {}
275
- _body_params: Optional[bytes] = None
276
-
277
- # process the path parameters
278
- if analysis_id is not None:
279
- _path_params['analysis_id'] = analysis_id
280
- # process the query parameters
281
- # process the header parameters
282
- if authorization is not None:
283
- _header_params['authorization'] = authorization
284
- # process the form parameters
285
- # process the body parameter
286
-
287
-
288
- # set the HTTP header `Accept`
289
- if 'Accept' not in _header_params:
290
- _header_params['Accept'] = self.api_client.select_header_accept(
291
- [
292
- 'application/json'
293
- ]
294
- )
295
-
296
-
297
- # authentication setting
298
- _auth_settings: List[str] = [
299
- 'APIKey'
300
- ]
301
-
302
- return self.api_client.param_serialize(
303
- method='GET',
304
- resource_path='/v2/analyses/{analysis_id}/func_maps',
305
- path_params=_path_params,
306
- query_params=_query_params,
307
- header_params=_header_params,
308
- body=_body_params,
309
- post_params=_form_params,
310
- files=_files,
311
- auth_settings=_auth_settings,
312
- collection_formats=_collection_formats,
313
- _host=_host,
314
- _request_auth=_request_auth
315
- )
316
-
317
-
@@ -1,125 +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, StrictStr
20
- from typing import Any, ClassVar, Dict, List, Optional
21
- from revengai.models.error_model import ErrorModel
22
- from revengai.models.meta_model import MetaModel
23
- from revengai.models.symbols_info import SymbolsInfo
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class BaseResponseSymbolsInfo(BaseModel):
28
- """
29
- BaseResponseSymbolsInfo
30
- """ # noqa: E501
31
- status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded")
32
- data: Optional[SymbolsInfo] = None
33
- message: Optional[StrictStr] = None
34
- errors: Optional[List[ErrorModel]] = None
35
- meta: Optional[MetaModel] = Field(default=None, description="Metadata")
36
- __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of BaseResponseSymbolsInfo from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([
70
- ])
71
-
72
- _dict = self.model_dump(
73
- by_alias=True,
74
- exclude=excluded_fields,
75
- exclude_none=True,
76
- )
77
- # override the default output from pydantic by calling `to_dict()` of data
78
- if self.data:
79
- _dict['data'] = self.data.to_dict()
80
- # override the default output from pydantic by calling `to_dict()` of each item in errors (list)
81
- _items = []
82
- if self.errors:
83
- for _item_errors in self.errors:
84
- if _item_errors:
85
- _items.append(_item_errors.to_dict())
86
- _dict['errors'] = _items
87
- # override the default output from pydantic by calling `to_dict()` of meta
88
- if self.meta:
89
- _dict['meta'] = self.meta.to_dict()
90
- # set to None if data (nullable) is None
91
- # and model_fields_set contains the field
92
- if self.data is None and "data" in self.model_fields_set:
93
- _dict['data'] = None
94
-
95
- # set to None if message (nullable) is None
96
- # and model_fields_set contains the field
97
- if self.message is None and "message" in self.model_fields_set:
98
- _dict['message'] = None
99
-
100
- # set to None if errors (nullable) is None
101
- # and model_fields_set contains the field
102
- if self.errors is None and "errors" in self.model_fields_set:
103
- _dict['errors'] = None
104
-
105
- return _dict
106
-
107
- @classmethod
108
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
109
- """Create an instance of BaseResponseSymbolsInfo from a dict"""
110
- if obj is None:
111
- return None
112
-
113
- if not isinstance(obj, dict):
114
- return cls.model_validate(obj)
115
-
116
- _obj = cls.model_validate({
117
- "status": obj.get("status") if obj.get("status") is not None else True,
118
- "data": SymbolsInfo.from_dict(obj["data"]) if obj.get("data") is not None else None,
119
- "message": obj.get("message"),
120
- "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None,
121
- "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None
122
- })
123
- return _obj
124
-
125
-
@@ -1,90 +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, StrictInt, StrictStr
20
- from typing import Any, ClassVar, Dict, List
21
- from typing import Optional, Set
22
- from typing_extensions import Self
23
-
24
- class Boundary(BaseModel):
25
- """
26
- Boundary
27
- """ # noqa: E501
28
- start_addr: StrictInt = Field(description="Start address of the function boundary")
29
- end_addr: StrictInt = Field(description="End address of the function boundary")
30
- name: StrictStr = Field(description="Name of the function")
31
- __properties: ClassVar[List[str]] = ["start_addr", "end_addr", "name"]
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 Boundary 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
- return _dict
73
-
74
- @classmethod
75
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of Boundary from a dict"""
77
- if obj is None:
78
- return None
79
-
80
- if not isinstance(obj, dict):
81
- return cls.model_validate(obj)
82
-
83
- _obj = cls.model_validate({
84
- "start_addr": obj.get("start_addr"),
85
- "end_addr": obj.get("end_addr"),
86
- "name": obj.get("name")
87
- })
88
- return _obj
89
-
90
-
@@ -1,102 +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, StrictInt
20
- from typing import Any, ClassVar, Dict, List, Optional
21
- from revengai.models.boundary import Boundary
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class SymbolsInfo(BaseModel):
26
- """
27
- SymbolsInfo
28
- """ # noqa: E501
29
- base_addr: Optional[StrictInt] = None
30
- provided_boundaries: Optional[Boundary] = None
31
- __properties: ClassVar[List[str]] = ["base_addr", "provided_boundaries"]
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 SymbolsInfo 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
- # override the default output from pydantic by calling `to_dict()` of provided_boundaries
73
- if self.provided_boundaries:
74
- _dict['provided_boundaries'] = self.provided_boundaries.to_dict()
75
- # set to None if base_addr (nullable) is None
76
- # and model_fields_set contains the field
77
- if self.base_addr is None and "base_addr" in self.model_fields_set:
78
- _dict['base_addr'] = None
79
-
80
- # set to None if provided_boundaries (nullable) is None
81
- # and model_fields_set contains the field
82
- if self.provided_boundaries is None and "provided_boundaries" in self.model_fields_set:
83
- _dict['provided_boundaries'] = None
84
-
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of SymbolsInfo from a dict"""
90
- if obj is None:
91
- return None
92
-
93
- if not isinstance(obj, dict):
94
- return cls.model_validate(obj)
95
-
96
- _obj = cls.model_validate({
97
- "base_addr": obj.get("base_addr"),
98
- "provided_boundaries": Boundary.from_dict(obj["provided_boundaries"]) if obj.get("provided_boundaries") is not None else None
99
- })
100
- return _obj
101
-
102
-