Skip to content

Commit

Permalink
Merge pull request #1027 from daddycocoaman/fix/pdbutility-signature
Browse files Browse the repository at this point in the history
fix guid and pdb_name for #1026
  • Loading branch information
ikelos authored Nov 14, 2023
2 parents 82c5af7 + 40dcff1 commit 19d40b1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The following packages are required for core functionality.
pefile>=2017.8.1
pefile>=2023.2.7

# The following packages are optional.
# If certain packages are not necessary, place a comment (#) at the start of the line.
Expand Down
2 changes: 1 addition & 1 deletion requirements-minimal.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# These packages are required for core functionality.
pefile>=2017.8.1 #foo
pefile>=2023.2.7 #foo
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The following packages are required for core functionality.
pefile>=2017.8.1
pefile>=2023.2.7

# The following packages are optional.
# If certain packages are not necessary, place a comment (#) at the start of the line.
Expand Down
12 changes: 6 additions & 6 deletions volatility3/framework/symbols/windows/pdbutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import re
import struct
from pathlib import PureWindowsPath
from typing import Any, Dict, Generator, List, Optional, Tuple, Union
from urllib import parse, request

Expand Down Expand Up @@ -226,13 +227,12 @@ def get_guid_from_mz(
return None

pdb_name = debug_entry.PdbFileName.decode("utf-8").strip("\x00")

# Let pathlib do the filename extraction. This will likely always be a Windows path though.
pdb_name = PureWindowsPath(pdb_name).name

age = debug_entry.Age
guid = "{:08x}{:04x}{:04x}{}".format(
debug_entry.Signature_Data1,
debug_entry.Signature_Data2,
debug_entry.Signature_Data3,
binascii.hexlify(debug_entry.Signature_Data4).decode("utf-8"),
)
guid = debug_entry.Signature_String[:32] # Removes the Age from the GUID
return guid, age, pdb_name

@classmethod
Expand Down

0 comments on commit 19d40b1

Please sign in to comment.