Skip to content

Instantly share code, notes, and snippets.

@p4yl0ad
Last active November 13, 2023 11:12
Show Gist options
  • Save p4yl0ad/2fa54d80f9055b68306acf0bfa0c147a to your computer and use it in GitHub Desktop.
Save p4yl0ad/2fa54d80f9055b68306acf0bfa0c147a to your computer and use it in GitHub Desktop.
$searchterm = "IID_IWSCProductList"
$dumpbinpath = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\Hostx64\x64\dumpbin.exe"
$x64_pathtosearch = "C:\Windows\System32\"
$x86_pathtosearch = "C:\Windows\SysWOW64\"
$stamp = (Get-Date).ToString("yyyy-mm-dd_HH-mm-ss")
$logpath = "C:\Users\user\Desktop\Initialize_hunt-$stamp.log"
foreach ($dllfullpath in (Get-ChildItem -Path $x64_pathtosearch -Recurse -ErrorAction SilentlyContinue -Include '*.dll' | select fullname)) {
$fullnamepath = $dllfullpath.Fullname;
echo "[i] x64 $fullnamepath" >> $logpath;
& "$dumpbinpath" /exports $fullnamepath | findstr /i $searchterm >> $logpath;
}
foreach ($dllfullpath in (Get-ChildItem -Path $x86_pathtosearch -Recurse -ErrorAction SilentlyContinue -Include '*.dll' | select fullname)) {
$fullnamepath = $dllfullpath.Fullname;
echo "[i] x86 $fullnamepath" >> $logpath;
& "$dumpbinpath" /exports $fullnamepath | findstr /i $searchterm >> $logpath;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment