Skip to content

Instantly share code, notes, and snippets.

@eddieh
Last active August 21, 2025 00:43
Show Gist options
  • Save eddieh/b0146a6acd97448a061450908dda879c to your computer and use it in GitHub Desktop.
Save eddieh/b0146a6acd97448a061450908dda879c to your computer and use it in GitHub Desktop.
Find Windows library that exports symbol using PowerShell
# > find-symbol Some_SymbolToFind
function find-symbol {
$symbolToFind = $args[0]
$libDir = "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64"
Write-Output "Looking for $symbolToFind in `"$libDir`""
Get-ChildItem -Path "$libDir" | Foreach {
#Write-Output "Looking in $_.name"
#$pattern = $symbolToFind
$pattern = "^.*(" + [regex]::escape($symbolToFind) + ").*$"
$found = (dumpbin /linkermember:2 $_.name | Select-String -Pattern $pattern)
if ($found.Matches.Length -gt 0) {
"Found $symbolToFind in $($_.Name)"
for ($i = 0; $i -le $found.Matches.Length - 1; $i++) {
" $($_.Name) $($found.Matches[$i].Value)"
}
}
}
}
@eddieh
Copy link
Author

eddieh commented Aug 21, 2025

dumpbin is a wrapper around link /dump, so it might be better to use link /dump /linkermember since I'm not sure dumpbin adds anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment