Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

Confusion about Reverse bit operation #99

Closed
laanwj opened this issue Nov 16, 2016 · 4 comments
Closed

Confusion about Reverse bit operation #99

laanwj opened this issue Nov 16, 2016 · 4 comments
Assignees

Comments

@laanwj
Copy link

laanwj commented Nov 16, 2016

In [10]: claripy.BVV(0x00000001, 32).reversed
Out[10]: <BV32 0x1000000>

I'd have expected <BV32 0x80000000>, reversing the order of bits in a word.

The documentation says that the Reverse operation "Reverses a bit expression."

I understand why the operation does what it does, reverse by byte for an endian flip, but the naming and documentation could use improvement. When I first saw it as output in a symbolic expression I was really confused, "why would this code flip all the bits around".

@ltfish
Copy link
Member

ltfish commented Nov 16, 2016

I agree that the documentation can use some improvement. Here Reverse is referring to byte-level reversing used in an endianness conversion.

I'm assigning it to @zardus since he is a native speaker.

@salls
Copy link
Member

salls commented Nov 16, 2016

We've been having some discussion concerning the lack of clarity in naming. I guess this is another example we should consider

@zardus
Copy link
Member

zardus commented Nov 16, 2016

Thanks for bringing this up. I've added it to the "project" where we're tracking these usability improvements we need to make (https://github.com/angr/angr/projects/1).

@rhelmot
Copy link
Member

rhelmot commented Nov 15, 2017

The official operations appendix now lists .reverse as "endian-reverses a bitvector"

@rhelmot rhelmot closed this as completed Nov 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants