From 55ca41ccd9b2cd91f4d806a0fc75797b6c8c5735 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 16 May 2017 17:35:49 -0400 Subject: Adding pointer information to constant reference list --- python/function.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'python/function.py') diff --git a/python/function.py b/python/function.py index 509d9b3b..f32f6ad6 100644 --- a/python/function.py +++ b/python/function.py @@ -205,11 +205,15 @@ class Variable(object): class ConstantReference(object): - def __init__(self, val, size): + def __init__(self, val, size, ptr, intermediate): self.value = val self.size = size + self.pointer = ptr + self.intermediate = intermediate def __repr__(self): + if self.pointer: + return "" % self.value if self.size == 0: return "" % self.value return "" % (self.value, self.size) @@ -626,7 +630,7 @@ class Function(object): refs = core.BNGetConstantsReferencedByInstruction(self.handle, arch.handle, addr, count) result = [] for i in xrange(0, count.value): - result.append(ConstantReference(refs[i].value, refs[i].size)) + result.append(ConstantReference(refs[i].value, refs[i].size, refs[i].pointer, refs[i].intermediate)) core.BNFreeConstantReferenceList(refs) return result -- cgit v1.3.1