Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from eset/non_windows_path_support
Browse files Browse the repository at this point in the history
Fix dot file generation for non-Windows IDA
  • Loading branch information
carlosgprado authored Nov 29, 2019
2 parents 5c81e8c + 15b78b2 commit e65557c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions FIDL/decompiler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from compiler_consts import expr_ctype # To pretty print debug messages
from compiler_consts import expr_final, expr_assignments, insn_conditions

import os
import random
import traceback
import networkx as nx
Expand Down Expand Up @@ -1966,7 +1967,7 @@ def dump_cfg(self, out_dir):
dot += "}\n"

print("[DEBUG] Writing DOT file...")
od = "{}\\decompiled.dot".format(out_dir)
od = os.path.join(out_dir, "decompiled.dot")
with open(od, 'wb') as f:
f.write(dot)

Expand Down Expand Up @@ -1995,10 +1996,11 @@ def get_cfg_for_ea(ea, dot_exe, out_dir):

c.dump_cfg(out_dir)

cmd = r"{dot_exe} -Tpng -o {out_dir}\decompiled.png {out_dir}\decompiled.dot".format(
cmd = "{dot_exe} -Tpng -o '{png_file}' '{dot_file}'".format(
dot_exe=dot_exe,
out_dir=out_dir)
cmd2 = r"{out_dir}\decompiled.png".format(out_dir=out_dir)
dot_file=os.path.join(out_dir, "decompiled.dot"),
png_file=os.path.join(out_dir, "decompiled.png"))
cmd2 = os.path.join(out_dir, "decompiled.png")

print("Trying to run: {}...".format(cmd))
os.system(cmd)
Expand Down

0 comments on commit e65557c

Please sign in to comment.