mirror of
https://github.com/angr/angr
synced 2026-08-17 12:23:11 -04:00
UltraPage: Write to concrete_data as a single block instead of loop (#6760)
This commit is contained in:
parent
4a9c1454dc
commit
f4b23d4444
1 changed files with 5 additions and 6 deletions
|
|
@ -185,17 +185,16 @@ class UltraPage(MemoryObjectMixin, PageBase):
|
|||
self.symbolic_bitmap.clear_range(addr, addr + size)
|
||||
|
||||
# store
|
||||
arange = range(addr, addr + size)
|
||||
ival = data if type(data) is int else data.object.args[0]
|
||||
if endness == "Iend_BE":
|
||||
arange = reversed(arange)
|
||||
|
||||
assert memory.state.arch.byte_width == 8
|
||||
# TODO: Make UltraPage support architectures with greater byte_widths (but are still multiples of 8)
|
||||
concrete_data = self._concrete()
|
||||
for subaddr in arange:
|
||||
concrete_data[subaddr] = ival & 0xFF
|
||||
ival >>= 8
|
||||
|
||||
# Serialize in one step.
|
||||
concrete_data[addr : addr + size] = (ival & ((1 << (size * 8)) - 1)).to_bytes(
|
||||
size, "big" if endness == "Iend_BE" else "little"
|
||||
)
|
||||
else:
|
||||
# mark range as symbolic
|
||||
self.symbolic_bitmap.set_range(addr, addr + size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue