Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: pdbparse DBI - real number of references is in the sum of cRefCnt #7

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion drakpdb/pdbparse/dbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ def parse_stream(stream):
fileIndex = sstFileIndex.parse_stream(stream)
modStart = Array(fileIndex.cMod, Int16ul).parse_stream(stream)
cRefCnt = Array(fileIndex.cMod, Int16ul).parse_stream(stream)
NameRef = Array(fileIndex.cRef, Int32ul).parse_stream(stream)
# In theory: cRef is supposed to contain the number of source files, but 16-bits
# is to short for having more than 64K source files. The real number of names is
# sum of cRefCnt
# Source: https://llvm.org/docs/PDB/DbiStream.html#file-info-substream
realcRef = sum(cRefCnt)
NameRef = Array(realcRef, Int32ul).parse_stream(stream)
modules = [] # array of arrays of files
files = [] # array of files (non unique)
Names = stream.read(end - stream.tell())
Expand Down