Skip to content

Commit 830af7f

Browse files
committed
identified instances of tabs vs spaces in the original
identified 16 instances in the original code where tab was used vs spaces. updated to keep consistent.
1 parent 705bd42 commit 830af7f

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

data/exploits/powershell/powerdump.ps1

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function LoadApi
88
{
99
# already loaded
1010
return;
11-
}
11+
}
1212

1313
$code = @'
1414
using System;
@@ -21,7 +21,7 @@ namespace PowerDump
2121
public class Native
2222
{
2323
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
24-
public static extern int RegOpenKeyEx(
24+
public static extern int RegOpenKeyEx(
2525
int hKey,
2626
string subKey,
2727
int ulOptions,
@@ -73,16 +73,16 @@ namespace PowerDump
7373
}
7474
'@
7575

76-
$provider = New-Object Microsoft.CSharp.CSharpCodeProvider
77-
$dllName = [PsObject].Assembly.Location
78-
$compilerParameters = New-Object System.CodeDom.Compiler.CompilerParameters
79-
$assemblies = @("System.dll", $dllName)
80-
$compilerParameters.ReferencedAssemblies.AddRange($assemblies)
81-
$compilerParameters.GenerateInMemory = $true
82-
$compilerResults = $provider.CompileAssemblyFromSource($compilerParameters, $code)
83-
if($compilerResults.Errors.Count -gt 0) {
84-
$compilerResults.Errors | % { Write-Error ("{0}:`t{1}" -f $_.Line,$_.ErrorText) }
85-
}
76+
$provider = New-Object Microsoft.CSharp.CSharpCodeProvider
77+
$dllName = [PsObject].Assembly.Location
78+
$compilerParameters = New-Object System.CodeDom.Compiler.CompilerParameters
79+
$assemblies = @("System.dll", $dllName)
80+
$compilerParameters.ReferencedAssemblies.AddRange($assemblies)
81+
$compilerParameters.GenerateInMemory = $true
82+
$compilerResults = $provider.CompileAssemblyFromSource($compilerParameters, $code)
83+
if($compilerResults.Errors.Count -gt 0) {
84+
$compilerResults.Errors | % { Write-Error ("{0}:`t{1}" -f $_.Line,$_.ErrorText) }
85+
}
8686

8787
}
8888

@@ -218,22 +218,22 @@ function Get-RegKeyClass([string]$key, [string]$subkey)
218218
[int]$hkey=0
219219
if (-not [PowerDump.Native]::RegOpenKeyEx($nkey,$subkey,0,$KEYREAD,[ref]$hkey))
220220
{
221-
$classVal = New-Object Text.Stringbuilder 1024
222-
[int]$len = 1024
223-
if (-not [PowerDump.Native]::RegQueryInfoKey($hkey,$classVal,[ref]$len,0,[ref]$null,[ref]$null,
224-
[ref]$null,[ref]$null,[ref]$null,[ref]$null,[ref]$null,0))
225-
{
226-
$result = $classVal.ToString()
227-
}
228-
else
229-
{
230-
Write-Error "RegQueryInfoKey failed";
231-
}
232-
[PowerDump.Native]::RegCloseKey($hkey) | Out-Null
221+
$classVal = New-Object Text.Stringbuilder 1024
222+
[int]$len = 1024
223+
if (-not [PowerDump.Native]::RegQueryInfoKey($hkey,$classVal,[ref]$len,0,[ref]$null,[ref]$null,
224+
[ref]$null,[ref]$null,[ref]$null,[ref]$null,[ref]$null,0))
225+
{
226+
$result = $classVal.ToString()
227+
}
228+
else
229+
{
230+
Write-Error "RegQueryInfoKey failed";
231+
}
232+
[PowerDump.Native]::RegCloseKey($hkey) | Out-Null
233233
}
234234
else
235235
{
236-
Write-Error "Cannot open key";
236+
Write-Error "Cannot open key";
237237
}
238238
return $result;
239239
}

0 commit comments

Comments
 (0)