angr.storage.memory_mixins.paged_memory.pages.symbolic_bitmap¶
- class angr.storage.memory_mixins.paged_memory.pages.symbolic_bitmap.SymbolicBitmap¶
Bases:
objectTracks, for every byte of an
UltraPage, whether that byte is symbolic or not.The map is stored as a bitmap where the i-th bit of the map lives in bit
i & 7of bytei >> 3(least-significant bit first). This makesint.from_bytes(..., "little")a direct view of the map as a big integer and lets range scans be done withbit_length()instead of a Python-level loop.A page whose map is uniform (all bytes are symbolic or concrete) does not store any map.
All ranges are half-open
[start, stop)and are assumed to lie within[0, size].- size
- property nbytes: int¶
The number of bytes of backing store this map currently occupies (0 while uniform).
- property uniform_value: int | None¶
Return 0/1 if every byte of the page has that symbolic-ness, or None if the map is mixed.
- set(i, value)¶
Mark byte
ias symbolic (valuetruthy) or concrete.
- set_range(start, stop)¶
Mark
[start, stop)as symbolic.
- clear_range(start, stop)¶
Mark
[start, stop)as concrete.
- next_set(start, stop)¶
Return the smallest
iin[start, stop)whose byte is symbolic, orstopif there is none.A whole range is turned into one big integer and located with
(w & -w).bit_length()rather than being walked bit by bit. Long ranges are probed 64 bits at a time first.
- next_clear(start, stop)¶
Return the smallest
iin[start, stop)whose byte is concrete, orstopif there is none.
- all_set(start, stop)¶
Return True if every byte in
[start, stop)is symbolic.
- any_set(start, stop)¶
Return True if any byte in
[start, stop)is symbolic.
- view(start, stop)¶
Return the packed bits covering
[start, stop): bitiof the result is bytestart + iof the page.When
startis byte-aligned, the result is a writable view of this map’s own backing store, so a native consumer (e.g., unicorn engine) can update the page’s symbolic-ness in place. Returning such a view pins the backing store: it may no longer be dropped in favor of the uniform representation.An unaligned
startcannot be expressed as a view of the backing store, so the bits are shifted into place and returned read-only. Consumers like unicorn engine should not use this view for writing!- Return type:
- Parameters:
- copy()¶
- Return type: