Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications for new version of bitstream #388

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pyvex/lifting/gym/arm_spotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ def _load_le_instr(self, bitstream: bitstring.ConstBitStream, numbits: int) -> s
if (self.addr & 1) == 1 and numbits > 16:
chunk = ""
oldpos = bitstream.pos
for _ in range(0, numbits, 16):
chunk += bitstring.Bits(uint=bitstream.peek("uintle:%d" % 16), length=16).bin
bitstream.pos += 16
bitstream.pos = oldpos
try:
for _ in range(0, numbits, 16):
chunk += bitstring.Bits(uint=bitstream.peek("uintle:%d" % 16), length=16).bin
bitstream.pos += 16
finally:
bitstream.pos = oldpos
return chunk
return super()._load_le_instr(bitstream, numbits)

Expand Down
2 changes: 1 addition & 1 deletion pyvex/lifting/util/lifter_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _decode_next_instruction(self, addr):
# if we are out of input, ignore.
# there may be other, shorter instructions that still match,
# so we continue with the loop
except bitstring.ReadError:
except (bitstring.ReadError, bitstring.InterpretError):
pass

# If no instruction matches, log an error
Expand Down
Loading