Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Kyle committed Jan 30, 2024
1 parent 4c93b13 commit a5e3818
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions angrop/rop_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def _project_update(self):
self._value = claripy.BVV(self._value, self._project.arch.bits)
pie = self._project.loader.main_object.pic
self._code_base = self._project.loader.main_object.mapped_base if pie else 0
if not pie: self._rebase = False
if not pie:
self._rebase = False

def __add__(self, other):
cp = self.copy()
Expand Down Expand Up @@ -84,7 +85,7 @@ def symbolic(self):
def ast(self):
assert self._value.symbolic
return self.data

@property
def concreted(self):
assert not self._value.symbolic
Expand Down
6 changes: 3 additions & 3 deletions tests/test_chainbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ def test_ropvalue():
rop.save_gadgets(cache_path)

chain = rop.write_to_mem(0x800000, b"/bin/sh\x00")
assert sum([not x._rebase for x in chain._values]) == 4 # 4 values
assert sum(not x._rebase for x in chain._values) == 4 # 4 values

value = RopValue(0x800000, proj)
value._rebase = False
chain = rop.write_to_mem(value, b"/bin/sh\x00")
assert sum([not x._rebase for x in chain._values]) == 4 # 4 values
assert sum(not x._rebase for x in chain._values) == 4 # 4 values

value = RopValue(0x800000, proj)
value.rebase_ptr()
chain = rop.write_to_mem(value, b"/bin/sh\x00")
assert sum([not x._rebase for x in chain._values]) == 2 # 2 values
assert sum(not x._rebase for x in chain._values) == 2 # 2 values

def run_all():
functions = globals()
Expand Down

0 comments on commit a5e3818

Please sign in to comment.