Project

General

Profile

Actions

$bvar » History » Revision 7

« Previous | Revision 7/13 (diff) | Next »
Per Amundsen, 01/02/2019 03:34 AM


Added in 1.9.0

$bvar(&binvar,N,M)

Returns M ASCII values from a &binvar starting from the Nth byte.

N-N2 can be used to get a range of ASCII values.
N- can be used to get all ASCII values from position N.

Parameters

&binvar - The &binvar to use.
N - Position to start retrieving bytes.
M - Numbers of bytes to get.

Properties

.text - Returns plain text instead of ASCII values.
word - Outputs decimal value of a 2-byte word, seeing bytes in little-endian byte order (low value first)
.nword - Outputs decimal value of a 2-byte word, seeing bytes in big-endian byte order (high value first)
.long - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in little-endian byte order (low value first)
.nlong - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in big-endian byte order (high value first)

Example

; Returns the length of the binary variable.
//echo -ag $bvar(&binvar,0)        

; Returns ASCII value at position N.
//echo -ag $bvar(&binvar,1)

; Returns ASCII values from 5 to 8.
//echo -ag $bvar(&binvar,5,3)

; Returns ASCII values from 5 to end.
//echo -ag $bvar(&binvar,5-)

; Returns plain text from 5 to 8 up to the first zero character.
//echo -ag $bvar(&binvar,5,3).text

; Returns &binvar if the binvar exists.
//echo -ag $bvar(&binvar)

Updated by Per Amundsen almost 6 years ago · 7 revisions

Also available in: PDF HTML TXT