Automate downloading, extracting and updating of cab files #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to automate a few manual steps and to make it easier to do this in bulk, I added scripts that can download and extract PDB files from the Microsoft Symbol server and then apply the type information from one of these files to another.
PDBTypeCopy.py
is the main script.Usage:
Where:
binary file name
= the binary for which to download and update PDB-s (e.g. ntdll.dll)from hash
= the PDB's hash from which to copy type information.to hash
= the PDB's hash to which to copy type information.symbol cache folder
= the symbol cache folder in which to download and update the files.Example:
H:\dev\py\scripts>PDBTypeCopy.py ntdll.pdb 6610BBDECCA44BA5B080A03FA694E08C2 00C54168286C479D81823570A9C442462 c:\symbols
fbDownloadPDB.py
is a helper script to download a Cab PDB file from the Microsoft symbol server and extract the PDB into a given symbol cache folder.fbCopyPDBTypeData.py
is a helper script that contains a copy of the "type_theft" function with minor changes to fit the code and output style of the rest of my code.ExpandCab.ps1
is a powershell script that can extract a cab file to a folder (used byfbDownloadPDB.py
)Please have a look, optionally update the code style to fit yours and merge if you think others will find it useful.