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

Commit e65557c

Browse files
authored
Merge pull request #3 from eset/non_windows_path_support
Fix dot file generation for non-Windows IDA
2 parents 5c81e8c + 15b78b2 commit e65557c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

FIDL/decompiler_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from compiler_consts import expr_ctype # To pretty print debug messages
2626
from compiler_consts import expr_final, expr_assignments, insn_conditions
2727

28+
import os
2829
import random
2930
import traceback
3031
import networkx as nx
@@ -1966,7 +1967,7 @@ def dump_cfg(self, out_dir):
19661967
dot += "}\n"
19671968

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

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

19961997
c.dump_cfg(out_dir)
19971998

1998-
cmd = r"{dot_exe} -Tpng -o {out_dir}\decompiled.png {out_dir}\decompiled.dot".format(
1999+
cmd = "{dot_exe} -Tpng -o '{png_file}' '{dot_file}'".format(
19992000
dot_exe=dot_exe,
2000-
out_dir=out_dir)
2001-
cmd2 = r"{out_dir}\decompiled.png".format(out_dir=out_dir)
2001+
dot_file=os.path.join(out_dir, "decompiled.dot"),
2002+
png_file=os.path.join(out_dir, "decompiled.png"))
2003+
cmd2 = os.path.join(out_dir, "decompiled.png")
20022004

20032005
print("Trying to run: {}...".format(cmd))
20042006
os.system(cmd)

0 commit comments

Comments
 (0)