From 741fb0538e0ac6ab14928f78697196803dbd2ed5 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 19 Dec 2019 16:04:11 -0500 Subject: LLIL_JUMP_TO/MLIL_JUMP_TO now contain mappings from address to destination instruction --- suite/binaries | 2 +- suite/testcommon.py | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) (limited to 'suite') diff --git a/suite/binaries b/suite/binaries index f1702611..24abb8fd 160000 --- a/suite/binaries +++ b/suite/binaries @@ -1 +1 @@ -Subproject commit f17026111d327e1604d89daad9737831fe832929 +Subproject commit 24abb8fd8fe00a7188b5255bdcf9df36edc5febc diff --git a/suite/testcommon.py b/suite/testcommon.py index cb034f30..06ef1b5b 100644 --- a/suite/testcommon.py +++ b/suite/testcommon.py @@ -189,8 +189,29 @@ class BinaryViewTestBuilder(Builder): retinfo.append("Function: {:x} Instruction: {:x} Mapped MLIL: {}".format(func.start, ins.address, str(ins.mapped_medium_level_il))) retinfo.append("Function: {:x} Instruction: {:x} Value: {}".format(func.start, ins.address, str(ins.value))) retinfo.append("Function: {:x} Instruction: {:x} Possible Values: {}".format(func.start, ins.address, str(ins.possible_values))) - retinfo.append("Function: {:x} Instruction: {:x} Prefix operands: {}".format(func.start, ins.address, str(ins.prefix_operands))) - retinfo.append("Function: {:x} Instruction: {:x} Postfix operands: {}".format(func.start, ins.address, str(ins.postfix_operands))) + + prefixList = [] + for i in ins.prefix_operands: + if isinstance(i, dict): + contents = [] + for j in sorted(i.keys()): + contents.append((j, i[j])) + prefixList.append(str(contents)) + else: + prefixList.append(i) + retinfo.append("Function: {:x} Instruction: {:x} Prefix operands: {}".format(func.start, ins.address, str(prefixList))) + + postfixList = [] + for i in ins.postfix_operands: + if isinstance(i, dict): + contents = [] + for j in sorted(i.keys()): + contents.append((j, i[j])) + postfixList.append(str(contents)) + else: + postfixList.append(i) + retinfo.append("Function: {:x} Instruction: {:x} Postfix operands: {}".format(func.start, ins.address, str(postfixList))) + retinfo.append("Function: {:x} Instruction: {:x} SSA form: {}".format(func.start, ins.address, str(ins.ssa_form))) retinfo.append("Function: {:x} Instruction: {:x} Non-SSA form: {}".format(func.start, ins.address, str(ins.non_ssa_form))) return fixOutput(retinfo) @@ -236,15 +257,25 @@ class BinaryViewTestBuilder(Builder): prefixList.append(str(round(i, 21))) elif isinstance(i, float): prefixList.append(str(round(i, 11))) + elif isinstance(i, dict): + contents = [] + for j in sorted(i.keys()): + contents.append((j, i[j])) + prefixList.append(str(contents)) else: prefixList.append(str(i)) retinfo.append("Function: {:x} Instruction: {:x} Prefix operands: {}".format(func.start, ins.address, str(sorted(prefixList)))) postfixList = [] - for i in ins.prefix_operands: + for i in ins.postfix_operands: if isinstance(i, float) and 'e' in str(i): postfixList.append(str(round(i, 21))) elif isinstance(i, float): postfixList.append(str(round(i, 11))) + elif isinstance(i, dict): + contents = [] + for j in sorted(i.keys()): + contents.append((j, i[j])) + postfixList.append(str(contents)) else: postfixList.append(str(i)) -- cgit v1.3.1