Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 public override void Run(DuckyScript d)
 {
     for (int i = 0; i < count; ++i)
     {
         command.Run(d);
     }
 }
Esempio n. 3
0
 public override void Run(DuckyScript d)
 {
     if ((modifiers == null) || (modifiers.Count() == 0))
     {
         d.sim.Keyboard.KeyPress(key);
     }
     else
     {
         d.sim.Keyboard.ModifiedKeyStroke(modifiers, key);
     }
 }
Esempio n. 4
0
 public override void Run(DuckyScript d)
 {
     d.DefaultDelay = ms;
 }
Esempio n. 5
0
 public override void Run(DuckyScript d)
 {
     d.sim.Keyboard.TextEntry(s);
 }
Esempio n. 6
0
 public override void Run(DuckyScript d)
 {
     d.sim.Keyboard.Sleep(ms);
 }
Esempio n. 7
0
 public abstract void Run(DuckyScript d);