package binsec
Install
dune-project
Dependency
Authors
-
AAdel Djoudi
-
BBenoit Boero
-
BBenjamin Farinier
-
CChakib Foulani
-
DDorian Lesbre
-
FFrédéric Recoules
-
GGuillaume Girol
-
JJosselin Feist
-
LLesly-Ann Daniel
-
MMahmudul Faisal Al Ameen
-
MManh-Dung Nguyen
-
MMathéo Vergnolle
-
MMatthieu Lemerre
-
NNicolas Bellec
-
OOlivier Nicole
-
RRichard Bonichon
-
RRobin David
-
SSébastien Bardin
-
SSoline Ducousso
-
TTa Thanh Dinh
-
YYaëlle Vinçont
-
YYanis Sellami
Maintainers
Sources
sha256=bb48234a4b60a872015a88282df4873f01dcc984753d49ad2583d49c1ae7d705
sha512=e8aa47a736b83bfd47d5b5e96d0988859b4873ad4a112fee7cd21d02bc72ecec61b7de610a959e38d2f2f5eef8082a2c100c201e5eae5ae3a880c747dce6ae63
doc/binsec.base/Binsec_base/Bitvector/index.html
Module Binsec_base.BitvectorSource
include Common with type t := t and type boolean = bool
ucompare t t' returns the comparison of the unsigned values of t and t'.
It is equivalent of Z.compare (value_of t) (value_of t').
The bitvector t and t' should be of the same size.
scompare t t' returns the comparison of the signed values of t and t'.
It is equivalent of Z.compare (signed_of t) (signed_of t').
The bitvector t and t' should be of the same size.
fill lo hi n returns a bitvector of size n where bits from lo to hi are set to one. By default, lo is equal to zero and hi is equal to n. Raise Invalid_argument if lo or hi have incoherent values.
is_zeros t (resp. is_ones t) checks if it exists n such that t is equal to zeros n (resp. ones n)
max_ubv n (resp. max_sbv n) returns a bitvector of size n containing the biggest possible unsigned (resp. signed) value for its size
is_max_ubv t (resp. is_max_sbv t) returns true if t is a bitvector containing the biggest possible unsigned (resp. signed) value for its size, or returns false otherwise
include Sigs.COMPARISON
with type t := t
and type boolean = bool
with type boolean = bool
include Sigs.ARITHMETIC with type t := t
is_neg t (resp. is_pos t) returns true if the signed interpretation of t is strictly negative (resp. strictly positive)
include Sigs.BITWISE with type t := t
Creation functions
of_string s converts a string s whose format respects (+-)?0xb0-9+ i.e., hex and bin strings
Otherwise raises Invalid_argument
to_string s converts a bitvector to hexadecimal notation (if size is a multiple of 4) or to binary (otherwise).
to_bitstring bv returns the binary string representation of bv, i.e., the string "0b"[01]+ with the same value and size as bv.
to_hexstring bv returns the hex string representation of bv, i.e., the string "0x"[0-9a-f]+ with the same value and size as bv.
to_asciistring bv returns the ascii string representation of bv.
Printing functions
pp ppf bv prints the decimal value of bv into ppf
pp_hex ppf bv prints the hexadecimal value of bv into ppf
pp_hex ppf bv prints the hexadecimal value of bv into ppf if possible, else prints the binary value of bv.
print bv behaves like pp Format.str_formatter bv; Format.flush_str_formatter ()