From 024a88a6bbf2e25e5b61f061e9b98351cbc86a66 Mon Sep 17 00:00:00 2001 From: electricworry Date: Wed, 22 Jul 2020 20:19:55 +0100 Subject: [PATCH] Fixes AFLplusplus/AFLplusplus#464 winepath path translation for .cur_input. --- afl-wine-trace | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/afl-wine-trace b/afl-wine-trace index 65525a334f..8853a75702 100755 --- a/afl-wine-trace +++ b/afl-wine-trace @@ -68,7 +68,12 @@ else: argv = sys.argv[1:] for i in range(len(argv)): if ".cur_input" in argv[i]: - argv[i] = subprocess.run([os.path.join(os.path.dirname(wine_path), "winepath"), "--windows", argv[i]], universal_newlines=True, stdout=subprocess.PIPE).stdout + # Get the Wine translated path using the winepath tool + arg_translated = subprocess.run([os.path.join(os.path.dirname(wine_path), "winepath"), "--windows", argv[i]], universal_newlines=True, stdout=subprocess.PIPE).stdout + # Remove the spurious LF at the end of the path + if len(arg_translated) > 0 and arg_translated[-1] == '\n': + arg_translated = arg_translated[:-1] + argv[i] = arg_translated break print("[afl-wine-trace] exec:", " ".join([qemu_path, wine_path] + argv))