public override void Run(DuckyScript d) { foreach (char c in s) { short result = NativeMethods.VkKeyScan(c); uint keyCode = (uint)result & 0xFF; var modifiers = new List <DirectInputKeyCode>(); if ((result & 0x0100) != 0) { modifiers.Add(DirectInputKeyCode.DIK_LSHIFT); } if ((result & 0x0200) != 0) { modifiers.Add(DirectInputKeyCode.DIK_LCONTROL); } if ((result & 0x0400) != 0) { modifiers.Add(DirectInputKeyCode.DIK_LALT); } if ((result & 0x0800) != 0) { // TODO: What is the key code for the hankaku key? Possibilities DIK_CONVERT, DIK_NOCONVERT, DIK_KANA, DIK_KANJI ; } DirectInputKeyCode kc = (DirectInputKeyCode)NativeMethods.MapVirtualKey(keyCode, NativeMethods.MapVirtualKeyMapTypes.MAPVK_VK_TO_VSC); d.sim.Keyboard.ModifiedKeyStroke(modifiers, kc); System.Threading.Thread.Sleep(KeystrokeDelay); } }
public override void Run(DuckyScript d) { for (int i = 0; i < count; ++i) { command.Run(d); } }
public override void Run(DuckyScript d) { if ((modifiers == null) || (modifiers.Count() == 0)) { d.sim.Keyboard.KeyPress(key); } else { d.sim.Keyboard.ModifiedKeyStroke(modifiers, key); } }
public override void Run(DuckyScript d) { d.DefaultDelay = ms; }
public override void Run(DuckyScript d) { d.sim.Keyboard.TextEntry(s); }
public override void Run(DuckyScript d) { d.sim.Keyboard.Sleep(ms); }
public abstract void Run(DuckyScript d);