From 901a398b31dcc4dc7f1bd85217372065f5023725 Mon Sep 17 00:00:00 2001 From: William Ballenthin Date: Tue, 8 Jun 2021 11:09:32 -0600 Subject: [PATCH] insn: render negative number, offset correctly closes #619 --- capa/features/insn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/capa/features/insn.py b/capa/features/insn.py index ca612e56..82e0ad7a 100644 --- a/capa/features/insn.py +++ b/capa/features/insn.py @@ -6,6 +6,7 @@ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and limitations under the License. +import capa.render.utils from capa.features import Feature @@ -24,7 +25,7 @@ class Number(Feature): super(Number, self).__init__(value, arch=arch, description=description) def get_value_str(self): - return "0x%X" % self.value + return capa.render.utils.hex(self.value) class Offset(Feature): @@ -32,7 +33,7 @@ class Offset(Feature): super(Offset, self).__init__(value, arch=arch, description=description) def get_value_str(self): - return "0x%X" % self.value + return capa.render.utils.hex(self.value) class Mnemonic(Feature):