From ca75b6e8b299f7068a2de82c78b6b3f2b93c1702 Mon Sep 17 00:00:00 2001 From: Andrew Innes Date: Sat, 21 Oct 2023 12:34:48 +0800 Subject: [PATCH] Clean up parsedump some more Signed-off-by: Andrew Innes --- contrib/windows/parsedump/parsedump.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/contrib/windows/parsedump/parsedump.py b/contrib/windows/parsedump/parsedump.py index 3571b87971e7..740b51a53958 100644 --- a/contrib/windows/parsedump/parsedump.py +++ b/contrib/windows/parsedump/parsedump.py @@ -20,7 +20,6 @@ def find_first_existing_file(file_paths): return None # Return None if no file is found - def read_reg(path: pathlib.Path, hive=winreg.HKEY_LOCAL_MACHINE): try: with winreg.OpenKey(hive, str(path.parent)) as key: @@ -29,6 +28,7 @@ def read_reg(path: pathlib.Path, hive=winreg.HKEY_LOCAL_MACHINE): except (OSError, FileNotFoundError): return None + def find_zfs(): zfs_reg_path = ( pathlib.Path("SOFTWARE") @@ -64,10 +64,26 @@ def find_zfs(): zfs = find_zfs() +if zfs: + print(zfs) +else: + print("zfs not found.") + exit() + + dumpfilestr = "C:\\Windows\\MEMORY.DMP" symbolstr = "srv*;" + str(zfs / "symbols") + "\\;" +def quote(string): + return '"' + string + '"' + + +print(" ".join(["cdb command", quote(str(cdb)), + "-z", quote(dumpfilestr), + "-y", quote(symbolstr)])) + + def run(arg): result = subprocess.run( [str(cdb), "-z", dumpfilestr, "-c", arg, "-y", symbolstr],