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

Automate downloading, extracting and updating of cab files #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Automate downloading, extracting and updating of cab files #1

wants to merge 2 commits into from

Conversation

SkyLined
Copy link

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:

PDBTypeCopy.py [binary file name] [from hash] [to hash] [symbol cache folder]

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

    • Downloading PDB Cab file for ntdll.pdb @ 6610BBDECCA44BA5B080A03FA694E08C2...
      • Cab file size: 628446 bytes.
    • Extracting PDB Cab file to c:\symbols\ntdll.pdb\6610BBDECCA44BA5B080A03FA694E08C2...
      • PDB file size: 2124800 bytes.
    • Downloading PDB Cab file for ntdll.pdb @ 00C54168286C479D81823570A9C442462...
      • Cab file size: 624210 bytes.
    • Extracting PDB Cab file to c:\symbols\ntdll.pdb\00C54168286C479D81823570A9C442462...
      • PDB file size: 2132992 bytes.
    • Copying PDB type data...
    • Saving updated PDB file...
      • PDB file size: 2117668 bytes.

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 by fbDownloadPDB.py)

Please have a look, optionally update the code style to fit yours and merge if you think others will find it useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant