BinaryMid

From AutoIt Wiki

Jump to: navigation, search

Extracts a number of bytes from a binary variant. Adapted from AutoIt docs.

Contents

Syntax

$x = BinaryMid(bin,start [,count])

Parameters

binThe binary data to evaluate.
startThe byte position to start at. 1 for first byte.
countThe 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)

Related Functions

Binary BinaryLen

Personal tools