Skip to content

Latest commit

 

History

History
614 lines (428 loc) · 22.7 KB

HypervisorHooksApi.md

File metadata and controls

614 lines (428 loc) · 22.7 KB

corellium.HypervisorHooksApi

Request timeouts

Every API method accepts _request_timeout in seconds: a positive float for the urllib3 total timeout, or a pair of positive floats (connect, read). This controls HTTP transport waiting, not how long the server operation may run. It is not a wall-clock deadline for the operation or for all retries combined.

Transport timeouts raise urllib3.exceptions.TimeoutError subclasses such as ReadTimeoutError and ConnectTimeoutError. When retries are exhausted, urllib3 can instead raise urllib3.exceptions.MaxRetryError; inspect its reason to distinguish a timeout from other connection failures. Retry behavior depends on the HTTP method and Configuration.retries. These are client-side exceptions, not HTTP response statuses or SDK ApiException responses.

A timeout does not guarantee cancellation or rollback of an operation accepted by the server. For example, after a start request times out, the instance may still be starting or may already be running; the timeout alone does not establish its state or mean it was stopped or destroyed. The request might not have reached the server at all, leaving the instance off. Treat the outcome as unknown and fetch the instance's current state before deciding whether to retry. If it has since been destroyed, that lookup may return not found; the timeout itself does not prove destruction. Do not blindly repeat a state-changing request.

Catch urllib3.exceptions.TimeoutError and urllib3.exceptions.MaxRetryError separately from the SDK ApiException. MaxRetryError is not a subclass of TimeoutError. With _with_http_info the same rules apply. With _without_preload_content, a read timeout may also occur later when reading the returned response body.

All URIs are relative to https://app.corellium.com/api

Method HTTP request Description
v3_clear_hyper_trace_hooks POST /v3/instances/{instanceId}/hooks/clear Stop hypervisor hooks
v3_create_hook POST /v3/instances/{instanceId}/hooks Create a hypervisor hook for an instance
v3_delete_hook DELETE /v3/hooks/{hookId} Delete a hypervisor hook
v3_execute_hyper_trace_hooks POST /v3/instances/{instanceId}/hooks/execute Run hypervisor hooks
v3_get_hook GET /v3/hooks/{hookId} Get a hypervisor hook by ID
v3_list_hooks GET /v3/instances/{instanceId}/hooks List hypervisor hooks for an instance
v3_update_hook PUT /v3/hooks/{hookId} Update a hypervisor hook

v3_clear_hyper_trace_hooks

v3_clear_hyper_trace_hooks(instance_id)

Stop hypervisor hooks

Deactivates the hypervisor hooks on this device, so they stop running. The hook definitions are kept and can be activated again with v3ExecuteHyperTraceHooks.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.HypervisorHooksApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance ID.

    try:
        # Stop hypervisor hooks
        api_instance.v3_clear_hyper_trace_hooks(instance_id)
    except Exception as e:
        print("Exception when calling HypervisorHooksApi->v3_clear_hyper_trace_hooks: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance ID.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 No content -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_create_hook

Hook v3_create_hook(instance_id, create_hook_body)

Create a hypervisor hook for an instance

Adds a hypervisor hook to a device: the patch code runs each time the device executes address. Hooks are enabled by default. Activate the device's hooks with POST /v3/instances/{instanceId}/hooks/execute and deactivate them with .../hooks/clear. Returns 201 with the new hook.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.create_hook_body import CreateHookBody
from corellium.models.hook import Hook
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.HypervisorHooksApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance identifier.
    create_hook_body = corellium.CreateHookBody() # CreateHookBody | 

    try:
        # Create a hypervisor hook for an instance
        api_response = api_instance.v3_create_hook(instance_id, create_hook_body)
        print("The response of HypervisorHooksApi->v3_create_hook:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling HypervisorHooksApi->v3_create_hook: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance identifier.
create_hook_body CreateHookBody

Return type

Hook

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Hook created. -
400 Invalid request body. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_delete_hook

v3_delete_hook(hook_id)

Delete a hypervisor hook

Deletes a hypervisor hook from its device.

Deletes are idempotent: an unknown hookId, or a hook that was already deleted, is a successful no-op that still returns 204, and repeated calls return 204 as well. A 404 means the request path did not match a delete route, not that the target was missing.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.HypervisorHooksApi(api_client)
    hook_id = '2a1192e8-c7de-4981-bc11-c87fd1f12d13' # str | Hook identifier.

    try:
        # Delete a hypervisor hook
        api_instance.v3_delete_hook(hook_id)
    except Exception as e:
        print("Exception when calling HypervisorHooksApi->v3_delete_hook: %s\n" % e)

Parameters

Name Type Description Notes
hook_id str Hook identifier.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Hook deleted. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_execute_hyper_trace_hooks

v3_execute_hyper_trace_hooks(instance_id)

Run hypervisor hooks

Activates the hypervisor hooks configured for this device. A hook is a small patch, written in a C-like (csmfcc) or assembly-like (csmfvm) language, that runs whenever the device executes a chosen memory address; create and manage hooks with the Hypervisor Hooks endpoints (POST /v3/instances/{instanceId}/hooks). Only hooks marked enabled run. Does nothing if no hooks are configured.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.HypervisorHooksApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance ID.

    try:
        # Run hypervisor hooks
        api_instance.v3_execute_hyper_trace_hooks(instance_id)
    except Exception as e:
        print("Exception when calling HypervisorHooksApi->v3_execute_hyper_trace_hooks: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance ID.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 No content -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
401 Not signed in: the `Authorization: Bearer <token>` header is missing, or the token is invalid or expired. Get a new token and retry. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_get_hook

Hook v3_get_hook(hook_id)

Get a hypervisor hook by ID

Returns one hypervisor hook, including its address, patch code and whether it is enabled.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.hook import Hook
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.HypervisorHooksApi(api_client)
    hook_id = '2a1192e8-c7de-4981-bc11-c87fd1f12d13' # str | Hook identifier.

    try:
        # Get a hypervisor hook by ID
        api_response = api_instance.v3_get_hook(hook_id)
        print("The response of HypervisorHooksApi->v3_get_hook:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling HypervisorHooksApi->v3_get_hook: %s\n" % e)

Parameters

Name Type Description Notes
hook_id str Hook identifier.

Return type

Hook

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Hook. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -
404 No hook with the given hookId. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_list_hooks

HookList v3_list_hooks(instance_id, limit=limit, offset=offset, sort=sort)

List hypervisor hooks for an instance

Lists the hypervisor hooks set up on a device. A hook is a small piece of code, written in a C-like or assembly-like language, that the hypervisor runs whenever the device executes a chosen memory address, without changing the software on the device. Use hooks to log values, change behavior, or bypass checks while testing. Results are paginated; sort orders them by creation date.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.hook_list import HookList
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.HypervisorHooksApi(api_client)
    instance_id = 'f7f9832a-f824-416f-a5ea-4adfe34754b5' # str | Instance identifier.
    limit = 100 # float | Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. (optional) (default to 100)
    offset = 0 # float | How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. (optional) (default to 0)
    sort = DESC # str | Sort order by creation date. (optional) (default to DESC)

    try:
        # List hypervisor hooks for an instance
        api_response = api_instance.v3_list_hooks(instance_id, limit=limit, offset=offset, sort=sort)
        print("The response of HypervisorHooksApi->v3_list_hooks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling HypervisorHooksApi->v3_list_hooks: %s\n" % e)

Parameters

Name Type Description Notes
instance_id str Instance identifier.
limit float Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. [optional] [default to 100]
offset float How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. [optional] [default to 0]
sort str Sort order by creation date. [optional] [default to DESC]

Return type

HookList

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 List of hypervisor hooks. -
400 Invalid query parameters. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_update_hook

Hook v3_update_hook(hook_id, update_hook_body=update_hook_body)

Update a hypervisor hook

Changes a hypervisor hook. Send only the fields you want to change, for example enabled: false to switch it off without deleting it. Returns the updated hook.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.hook import Hook
from corellium.models.update_hook_body import UpdateHookBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.HypervisorHooksApi(api_client)
    hook_id = '2a1192e8-c7de-4981-bc11-c87fd1f12d13' # str | Hook identifier.
    update_hook_body = corellium.UpdateHookBody() # UpdateHookBody |  (optional)

    try:
        # Update a hypervisor hook
        api_response = api_instance.v3_update_hook(hook_id, update_hook_body=update_hook_body)
        print("The response of HypervisorHooksApi->v3_update_hook:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling HypervisorHooksApi->v3_update_hook: %s\n" % e)

Parameters

Name Type Description Notes
hook_id str Hook identifier.
update_hook_body UpdateHookBody [optional]

Return type

Hook

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Updated hook. -
400 Invalid request body. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -
404 No hook with the given hookId. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]