@jshookmcp/jshook 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSE +661 -661
  2. package/dist/native/scripts/linux/enum-windows.sh +12 -12
  3. package/dist/native/scripts/macos/enum-windows.applescript +22 -22
  4. package/dist/native/scripts/windows/enum-windows-by-class.ps1 +51 -51
  5. package/dist/native/scripts/windows/enum-windows.ps1 +44 -44
  6. package/dist/native/scripts/windows/inject-dll.ps1 +21 -21
  7. package/dist/src/index.js +0 -0
  8. package/dist/src/modules/captcha/AICaptchaDetector.js +73 -73
  9. package/dist/src/modules/process/MacProcessManager.js +25 -25
  10. package/dist/src/modules/process/memory/availability.js +49 -49
  11. package/dist/src/modules/process/memory/injector.js +185 -185
  12. package/dist/src/modules/process/memory/reader.js +50 -50
  13. package/dist/src/modules/process/memory/scanner.darwin.js +41 -41
  14. package/dist/src/modules/process/memory/scanner.windows.js +124 -124
  15. package/dist/src/modules/process/memory/writer.js +54 -54
  16. package/dist/src/server/domains/browser/definitions.tools.page-core.js +59 -59
  17. package/dist/src/server/domains/browser/definitions.tools.runtime.js +40 -40
  18. package/dist/src/server/domains/browser/definitions.tools.security.js +79 -79
  19. package/dist/src/server/domains/transform/handlers.impl.transform-base.js +102 -102
  20. package/dist/src/server/domains/workflow/handlers.impl.workflow-base.js +51 -51
  21. package/dist/tests/e2e/phases/browser-phases.js +8 -8
  22. package/dist/tests/modules/analyzer/CodeAnalyzer.test.js +15 -15
  23. package/dist/tests/modules/collector/PageScriptCollectors.test.js +4 -4
  24. package/dist/tests/modules/crypto/CryptoDetector.test.js +4 -4
  25. package/dist/tests/modules/detector/ObfuscationDetector.test.js +7 -7
  26. package/dist/tests/modules/emulator/AIEnvironmentAnalyzer.test.js +4 -4
  27. package/package.json +128 -148
  28. package/scripts/postinstall.cjs +37 -37
  29. package/src/native/scripts/linux/enum-windows.sh +12 -12
  30. package/src/native/scripts/macos/enum-windows.applescript +22 -22
  31. package/src/native/scripts/windows/enum-windows-by-class.ps1 +51 -51
  32. package/src/native/scripts/windows/enum-windows.ps1 +44 -44
  33. package/src/native/scripts/windows/inject-dll.ps1 +21 -21
@@ -1,44 +1,44 @@
1
- param(
2
- [int]$TargetPid
3
- )
4
-
5
- Add-Type @"
6
- using System;
7
- using System.Runtime.InteropServices;
8
- public class Win32 {
9
- [DllImport("user32.dll")] public static extern IntPtr FindWindowEx(IntPtr parent, IntPtr childAfter, string className, string title);
10
- [DllImport("user32.dll")] public static extern int GetWindowThreadProcessId(IntPtr hWnd, out int pid);
11
- [DllImport("user32.dll")] public static extern int GetWindowText(IntPtr hWnd, System.Text.StringBuilder text, int count);
12
- [DllImport("user32.dll")] public static extern int GetClassName(IntPtr hWnd, System.Text.StringBuilder className, int maxCount);
13
- [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hWnd, out RECT rect);
14
- [StructLayout(LayoutKind.Sequential)] public struct RECT { public int Left, Top, Right, Bottom; }
15
- }
16
- "@
17
-
18
- $windows = @()
19
- $hwnd = [IntPtr]::Zero
20
- while ($true) {
21
- $hwnd = [Win32]::FindWindowEx([IntPtr]::Zero, $hwnd, $null, $null)
22
- if ($hwnd -eq [IntPtr]::Zero) { break }
23
- $windowPid = 0
24
- [Win32]::GetWindowThreadProcessId($hwnd, [ref]$windowPid) | Out-Null
25
- if ($windowPid -eq $TargetPid) {
26
- $title = New-Object System.Text.StringBuilder 256
27
- $className = New-Object System.Text.StringBuilder 256
28
- [Win32]::GetWindowText($hwnd, $title, 256) | Out-Null
29
- [Win32]::GetClassName($hwnd, $className, 256) | Out-Null
30
- $rect = New-Object Win32+RECT
31
- [Win32]::GetWindowRect($hwnd, [ref]$rect) | Out-Null
32
- $windows += @{
33
- Handle = $hwnd.ToString()
34
- Title = $title.ToString()
35
- ClassName = $className.ToString()
36
- ProcessId = $windowPid
37
- Left = $rect.Left
38
- Top = $rect.Top
39
- Right = $rect.Right
40
- Bottom = $rect.Bottom
41
- }
42
- }
43
- }
44
- $windows | ConvertTo-Json -Compress
1
+ param(
2
+ [int]$TargetPid
3
+ )
4
+
5
+ Add-Type @"
6
+ using System;
7
+ using System.Runtime.InteropServices;
8
+ public class Win32 {
9
+ [DllImport("user32.dll")] public static extern IntPtr FindWindowEx(IntPtr parent, IntPtr childAfter, string className, string title);
10
+ [DllImport("user32.dll")] public static extern int GetWindowThreadProcessId(IntPtr hWnd, out int pid);
11
+ [DllImport("user32.dll")] public static extern int GetWindowText(IntPtr hWnd, System.Text.StringBuilder text, int count);
12
+ [DllImport("user32.dll")] public static extern int GetClassName(IntPtr hWnd, System.Text.StringBuilder className, int maxCount);
13
+ [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hWnd, out RECT rect);
14
+ [StructLayout(LayoutKind.Sequential)] public struct RECT { public int Left, Top, Right, Bottom; }
15
+ }
16
+ "@
17
+
18
+ $windows = @()
19
+ $hwnd = [IntPtr]::Zero
20
+ while ($true) {
21
+ $hwnd = [Win32]::FindWindowEx([IntPtr]::Zero, $hwnd, $null, $null)
22
+ if ($hwnd -eq [IntPtr]::Zero) { break }
23
+ $windowPid = 0
24
+ [Win32]::GetWindowThreadProcessId($hwnd, [ref]$windowPid) | Out-Null
25
+ if ($windowPid -eq $TargetPid) {
26
+ $title = New-Object System.Text.StringBuilder 256
27
+ $className = New-Object System.Text.StringBuilder 256
28
+ [Win32]::GetWindowText($hwnd, $title, 256) | Out-Null
29
+ [Win32]::GetClassName($hwnd, $className, 256) | Out-Null
30
+ $rect = New-Object Win32+RECT
31
+ [Win32]::GetWindowRect($hwnd, [ref]$rect) | Out-Null
32
+ $windows += @{
33
+ Handle = $hwnd.ToString()
34
+ Title = $title.ToString()
35
+ ClassName = $className.ToString()
36
+ ProcessId = $windowPid
37
+ Left = $rect.Left
38
+ Top = $rect.Top
39
+ Right = $rect.Right
40
+ Bottom = $rect.Bottom
41
+ }
42
+ }
43
+ }
44
+ $windows | ConvertTo-Json -Compress
@@ -1,21 +1,21 @@
1
- param(
2
- [int]$TargetPid,
3
- [string]$DllPath
4
- )
5
-
6
- Add-Type @"
7
- using System;
8
- using System.Runtime.InteropServices;
9
- public class Injector {
10
- [DllImport("kernel32.dll")] public static extern IntPtr OpenProcess(int access, bool inherit, int pid);
11
- [DllImport("kernel32.dll")] public static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr addr, int size, int alloc, int protect);
12
- [DllImport("kernel32.dll")] public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr addr, byte[] buffer, int size, out int written);
13
- [DllImport("kernel32.dll")] public static extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr attr, int stack, IntPtr start, IntPtr param, int flags, out int threadId);
14
- [DllImport("kernel32.dll")] public static extern IntPtr GetModuleHandle(string name);
15
- [DllImport("kernel32.dll")] public static extern IntPtr GetProcAddress(IntPtr hModule, string name);
16
- [DllImport("kernel32.dll")] public static extern bool CloseHandle(IntPtr handle);
17
- }
18
- "@
19
-
20
- # Injection requires elevated privileges and is disabled for safety
21
- Write-Output "DLL injection is disabled for safety in this implementation. PID: $TargetPid, DLL: $DllPath"
1
+ param(
2
+ [int]$TargetPid,
3
+ [string]$DllPath
4
+ )
5
+
6
+ Add-Type @"
7
+ using System;
8
+ using System.Runtime.InteropServices;
9
+ public class Injector {
10
+ [DllImport("kernel32.dll")] public static extern IntPtr OpenProcess(int access, bool inherit, int pid);
11
+ [DllImport("kernel32.dll")] public static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr addr, int size, int alloc, int protect);
12
+ [DllImport("kernel32.dll")] public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr addr, byte[] buffer, int size, out int written);
13
+ [DllImport("kernel32.dll")] public static extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr attr, int stack, IntPtr start, IntPtr param, int flags, out int threadId);
14
+ [DllImport("kernel32.dll")] public static extern IntPtr GetModuleHandle(string name);
15
+ [DllImport("kernel32.dll")] public static extern IntPtr GetProcAddress(IntPtr hModule, string name);
16
+ [DllImport("kernel32.dll")] public static extern bool CloseHandle(IntPtr handle);
17
+ }
18
+ "@
19
+
20
+ # Injection requires elevated privileges and is disabled for safety
21
+ Write-Output "DLL injection is disabled for safety in this implementation. PID: $TargetPid, DLL: $DllPath"