hook_param
Behaviour
Section titled “Behaviour”- Look up the value for a named parameter specified in
read_ptr - Write the parameter’s value to
write_ptr
- Retrieve the value of a parameter associated with the specified key.
- Returns the value associated with the key, or an error code if the retrieval fails.
Definition
Section titled “Definition”int64_t hook_param ( uint32_t write_ptr, uint32_t write_len, uint32_t read_ptr, uint32_t read_len);function hook_param(key: ByteArray | HexString): ErrorCode | ByteArrayExample
Section titled “Example”uint8_t pname[] = {0xCAU, 0xFEU};uint8_t pvalue[32];int64_t value_len = hook_param(pvalue, 32, pname, 2);const pname = [0xCA, 0xFE]const pvalue = hook_param(pname)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| write_ptr | uint32_t | Pointer to a buffer of a suitable size to store the output. Should be at least 32 bytes. |
| write_len | uint32_t | Length of the output buffer. |
| read_ptr | uint32_t | Pointer to a buffer containing the parameter’s name |
| read_len | uint32_t | Length of the parameter’s name |
| Name | Type | Description |
|---|---|---|
| key | ByteArray or HexString | The key for which to retrieve the parameter value. |
Return Code
Section titled “Return Code”| Type | Description |
|---|---|
| int64_t | The number of bytes written |
| Type | Description |
|---|---|
| ByteArray or ErrorCode | Returns the value associated with the key, or an error code if the retrieval fails. |