BinaryMid
From AutoIt Wiki
Extracts a number of bytes from a binary variant. Adapted from AutoIt docs.
Contents |
Syntax
$x = BinaryMid(bin,start [,count])
Parameters
| bin | The binary data to evaluate. |
| start | The byte position to start at. 1 for first byte. |
| count | The number of bytes to extract. By default the entire remainder of the binary data.(Optional) |
Return Value
Returns the extracted binary data.
If start is out-of-bounds, an empty binary variant is returned. If start is valid but count is out-of-bounds, the entire remainder of the binary data is returned.
Example
$bin = Binary("0x10203040")
$extract = BinaryMid($bin, 2, 2)
MsgBox(0, "2nd and 3rd bytes are", $extract)