Ejemplo 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);
     }
 }
Ejemplo n.º 2
0
 public override void Run(DuckyScript d)
 {
     for (int i = 0; i < count; ++i)
     {
         command.Run(d);
     }
 }
Ejemplo 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);
     }
 }
Ejemplo n.º 4
0
 public override void Run(DuckyScript d)
 {
     d.DefaultDelay = ms;
 }
Ejemplo n.º 5
0
 public override void Run(DuckyScript d)
 {
     d.sim.Keyboard.TextEntry(s);
 }
Ejemplo n.º 6
0
 public override void Run(DuckyScript d)
 {
     d.sim.Keyboard.Sleep(ms);
 }
Ejemplo n.º 7
0
 public abstract void Run(DuckyScript d);