Skip to content

Commit

Permalink
Revert "Prologue Eval modification"
Browse files Browse the repository at this point in the history
This reverts commit 2ffc223.
  • Loading branch information
blattm committed Aug 28, 2024
1 parent 6deddca commit f1d579b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
6 changes: 3 additions & 3 deletions decompiler/frontend/binaryninja/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from ..frontend import Frontend
from .lifter import BinaryninjaLifter
from .parser import BinaryninjaParser
# from .tagging import CompilerIdiomsTagging
from .tagging import CompilerIdiomsTagging


class BinaryninjaFrontend(Frontend):
Expand Down Expand Up @@ -70,8 +70,8 @@ def lift(self, task: DecompilerTask):
task.function_return_type = lifter.lift(function.return_type)
task.function_parameters = [lifter.lift(param_type) for param_type in function.type.parameters]

# tagging = CompilerIdiomsTagging(self._bv, function.start, task.options)
# tagging.run()
tagging = CompilerIdiomsTagging(self._bv, function.start, task.options)
tagging.run()

task.cfg = parser.parse(function)
task.function_parameter_locations = self._parameter_locations(function)
Expand Down
22 changes: 1 addition & 21 deletions decompiler/pipeline/preprocessing/remove_go_prologue.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@
from decompiler.structures.pseudo.typing import Integer
from decompiler.task import DecompilerTask

import os
import shelve

def get_shelve():
path = os.environ.get("go_shelve_path", "go_prologue_results.shelve")
return shelve.open(path)
# return shelve.open("trash.shelve")


with get_shelve() as storage:
storage.clear()

class RemoveGoPrologue(PipelineStage):
"""
Expand All @@ -40,13 +29,7 @@ def run(self, task: DecompilerTask):
if self._check_and_remove_go_prologue():
pass
else:
with get_shelve() as shelve:
shelve[task.name] = None
print("Did not remove go prologue", flush=True)
# if not self._dont_crash:
# raise ValueError("Crash on purpose")
if os.environ.get("go_eval_only"):
raise ValueError("Crash on purpose")
logging.info("No Go function prologue found")

def _get_r14_name(self, task: DecompilerTask):
r14_parameter_index = None
Expand Down Expand Up @@ -377,9 +360,6 @@ def _remove_go_prologue(self, start_node: BasicBlock, morestack_node: BasicBlock
root.add_instruction_where_possible(comment)

logging.info(comment_string)
print("removed go prologue for function", function, flush=True)
with get_shelve() as shelve:
shelve[self._function_name] = str(function)

def _get_constant_condition(self, value: bool):
int_value = 1 if value else 0
Expand Down

0 comments on commit f1d579b

Please sign in to comment.