From a5e38186c0252d44941233d0f255c805d0bfc008 Mon Sep 17 00:00:00 2001 From: Kyle Zeng Date: Tue, 30 Jan 2024 00:54:46 -0700 Subject: [PATCH] linting --- angrop/rop_value.py | 5 +++-- tests/test_chainbuilder.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/angrop/rop_value.py b/angrop/rop_value.py index 0c230eb..91c09b3 100644 --- a/angrop/rop_value.py +++ b/angrop/rop_value.py @@ -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() @@ -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 diff --git a/tests/test_chainbuilder.py b/tests/test_chainbuilder.py index de67304..3bb863c 100644 --- a/tests/test_chainbuilder.py +++ b/tests/test_chainbuilder.py @@ -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()