Last active
August 21, 2025 00:43
-
-
Save eddieh/b0146a6acd97448a061450908dda879c to your computer and use it in GitHub Desktop.
Find Windows library that exports symbol using PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# > 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)" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dumpbin
is a wrapper aroundlink /dump
, so it might be better to uselink /dump /linkermember
since I'm not suredumpbin
adds anything