about summary refs log tree commit diff
path: root/afl-wine-trace
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-07-29 11:39:00 +0200
committerGitHub <noreply@github.com>2020-07-29 11:39:00 +0200
commit4550613f58342632061944ef09add63240d774cc (patch)
tree7896b5ec1f49b3ebe32d1466e85ea8f536ad599e /afl-wine-trace
parentff107714f1af1bd908a35ce54701da1eca8ce25d (diff)
parent015fde3703c7b67ee65d74b0f4b7b68b5d1e4d7e (diff)
downloadafl++-4550613f58342632061944ef09add63240d774cc.tar.gz
Merge branch 'dev' into text_inputs
Diffstat (limited to 'afl-wine-trace')
-rwxr-xr-xafl-wine-trace7
1 files changed, 6 insertions, 1 deletions
diff --git a/afl-wine-trace b/afl-wine-trace
index 65525a33..8853a757 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))