Skip to content

Commit

Permalink
Clean up parsedump some more
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Innes <[email protected]>
  • Loading branch information
andrewc12 committed Oct 21, 2023
1 parent 8ab4db4 commit ca75b6e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion contrib/windows/parsedump/parsedump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit ca75b6e

Please sign in to comment.