From c576698a4aff141a3babcc23a4d7f8900b98764d Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Mon, 15 Apr 2024 17:31:31 +0200 Subject: [PATCH] Split pdbresym.vm Split pdbresym.vm into pdbresym.vm and dbs.pdbresym.vm to separate the download of the symbols (which increases the VM size considerable) and the too installation. --- packages/pdbresym.vm/pdbresym.vm.nuspec | 2 +- .../pdbresym.vm/tools/chocolateyinstall.ps1 | 20 +++++-------------- .../pdbs.pdbresym.vm/pdbs.pdbresym.vm.nuspec | 13 ++++++++++++ .../tools/chocolateyinstall.ps1 | 13 ++++++++++++ scripts/test/lint.py | 3 ++- 5 files changed, 34 insertions(+), 17 deletions(-) create mode 100644 packages/pdbs.pdbresym.vm/pdbs.pdbresym.vm.nuspec create mode 100644 packages/pdbs.pdbresym.vm/tools/chocolateyinstall.ps1 diff --git a/packages/pdbresym.vm/pdbresym.vm.nuspec b/packages/pdbresym.vm/pdbresym.vm.nuspec index 5ea45932b..8c51b4f1b 100644 --- a/packages/pdbresym.vm/pdbresym.vm.nuspec +++ b/packages/pdbresym.vm/pdbresym.vm.nuspec @@ -2,7 +2,7 @@ pdbresym.vm - 1.3.3 + 1.3.3.20240415 Stephen Eckels Download PDBs diff --git a/packages/pdbresym.vm/tools/chocolateyinstall.ps1 b/packages/pdbresym.vm/tools/chocolateyinstall.ps1 index 87655d7ec..59139e242 100644 --- a/packages/pdbresym.vm/tools/chocolateyinstall.ps1 +++ b/packages/pdbresym.vm/tools/chocolateyinstall.ps1 @@ -1,20 +1,10 @@ $ErrorActionPreference = 'Stop' Import-Module vm.common -Force -DisableNameChecking -try { - $toolName = 'PDBReSym' - $category = 'Utilities' +$toolName = 'PDBReSym' +$category = 'Utilities' - $zipUrl = 'https://github.com/mandiant/STrace/releases/download/v1.3.3/PDBReSym.zip' - $zipSha256 = '803dfc0321581bc39001f050cdafe672e9e3247e96ffd42606fda3d641f0fd57' +$zipUrl = 'https://github.com/mandiant/STrace/releases/download/v1.3.3/PDBReSym.zip' +$zipSha256 = '803dfc0321581bc39001f050cdafe672e9e3247e96ffd42606fda3d641f0fd57' - $executablePath = (VM-Install-From-Zip $toolName $category $zipUrl -zipSha256 $zipSha256 -consoleApp $true -innerFolder $false -arguments "--help")[-1] - - # Iterate through C:\Windows\System32 downloading all PDBs concurrently - VM-Write-Log "INFO" "Iterating through C:\Windows\System32 downloading PDBs to C:\symbols" - & $executablePath cachesyms - # The downloaded symbols are store into C:\symbols - VM-Assert-Path "C:\symbols" -} catch { - VM-Write-Log-Exception $_ -} +VM-Install-From-Zip $toolName $category $zipUrl -zipSha256 $zipSha256 -consoleApp $true -innerFolder $false -arguments "--help" diff --git a/packages/pdbs.pdbresym.vm/pdbs.pdbresym.vm.nuspec b/packages/pdbs.pdbresym.vm/pdbs.pdbresym.vm.nuspec new file mode 100644 index 000000000..c9da44593 --- /dev/null +++ b/packages/pdbs.pdbresym.vm/pdbs.pdbresym.vm.nuspec @@ -0,0 +1,13 @@ + + + + pdbs.pdbresym.vm + 0.0.0.20240415 + Stephen Eckels + Download PDBs + + + + + + diff --git a/packages/pdbs.pdbresym.vm/tools/chocolateyinstall.ps1 b/packages/pdbs.pdbresym.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..989e3d0f9 --- /dev/null +++ b/packages/pdbs.pdbresym.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,13 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +try { + # Iterate through C:\Windows\System32 downloading all PDBs concurrently + $executablePath = Join-Path ${Env:RAW_TOOLS_DIR} PDBReSym\PDBReSym.exe -Resolve + VM-Write-Log "INFO" "Iterating through C:\Windows\System32 downloading PDBs to C:\symbols" + & $executablePath cachesyms + # The downloaded symbols are store into C:\symbols + VM-Assert-Path "C:\symbols" +} catch { + VM-Write-Log-Exception $_ +} diff --git a/scripts/test/lint.py b/scripts/test/lint.py index 0141d7e8c..11a9c0a22 100644 --- a/scripts/test/lint.py +++ b/scripts/test/lint.py @@ -302,9 +302,9 @@ def check(self, path): class UsesInvalidCategory(Lint): # Some packages don't have a category (we don't create a link in the tools directory) EXCLUSIONS = [ + ".dbgchild.vm", ".ollydumpex.vm", ".scyllahide.vm", - ".dbgchild.vm", "common.vm", "debloat.vm", "dokan.vm", @@ -316,6 +316,7 @@ class UsesInvalidCategory(Lint): "notepadpp.plugin.", "npcap.vm", "openjdk.vm", + "pdbs.pdbresym.vm", "python3.vm", "x64dbgpy.vm", ]