sto_subarray
Index into a xahaud serialized array and return the location and length of an index
Concepts
Behaviour
Parse a STArray pointed to by
read_ptr
Find the array index specified by
array_id
Return the byte offset and length of the serialized field within the STObject, if it is found
🚧Field ID encodingThe
sto_
apis accept afield_id
parameter encoded as follows:(type << 16U) + field
Thus type 1 field 2 would be0x10002U
.In the case of this array field ID is
array_id
.
Definition
C
Example
C
📘hookmacro.h already contains the
SUB_OFFSET
andSUB_LENGTH
macros.
Parameters
read_ptr
uint32_t
Pointer to the buffer containing the STArray
read_len
uint32_t
Length of STArray
array_id
uint32_t
The index of the entry within the STArray you are seeking. Starts from 0.
Return Code
int64_t
The location of the field within the specified buffer:
- The high 32 bits are the offset location.
- The low 32 bits are the length.
If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.
TOO_SMALL
- Input buffer isn't large enough to possibly contain a valid STArray.
DOESNT_EXIST
- The searched for index isn't present in the supplied STArray.
PARSE_ERROR
- The supplied STArray is malformed or not an STArray.
Last updated