Jump to content

Duckiesque


kdodge

Recommended Posts

a C program:

/*  
*  #Duckiesque#
*  Sort-of ducky simulator
*/
#include 
#include 

void norm(char key){
 keybd_event(key, MapVirtualKey(key, 0), 0, 0);
 keybd_event(key, MapVirtualKey(key, 0), KEYEVENTF_KEYUP, 0);
}

void shift(char key){
 keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), 0, 0);
 keybd_event(key, MapVirtualKey(key, 0), 0, 0);
 keybd_event(key, MapVirtualKey(key, 0), KEYEVENTF_KEYUP, 0);
 keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), KEYEVENTF_KEYUP, 0);
}

void gui_r(){
 keybd_event(VK_LWIN, MapVirtualKey(VK_LWIN, 0), 0, 0);
 norm('R');
 keybd_event(VK_LWIN, MapVirtualKey(VK_LWIN, 0), KEYEVENTF_KEYUP, 0);
}

void enter(){
 norm(VK_RETURN);
}

void string(char *a){
 for(int i = 0; i < strlen(a); i++){
   char x = a[i];
   if(x == ' '){
     norm(VK_SPACE);
   }else if(x == '!'){
     shift('1');
   }else if(x == '"'){
     shift(VK_OEM_7);
   }else if(x >= '#' && x <= '%'){
     x += 0x10;
     shift(x);
   }else if(x == '&'){
     shift('7');
   }else if(x == '\''){
     norm(VK_OEM_7);
   }else if(x == '('){
     shift('9');
   }else if(x == ')'){
     shift('0');
   }else if(x == '*'){
     shift('8');
   }else if(x == '+'){
     shift(VK_OEM_PLUS);
   }else if(x == ','){
     norm(VK_OEM_COMMA);
   }else if(x == '-'){
     norm(VK_OEM_MINUS);
   }else if(x == '.'){
     norm(VK_OEM_PERIOD);
   }else if(x == '/'){
     norm(VK_OEM_2);
   }else if(x >= '0' && x <= '9'){
     norm(x);
   }else if(x == ':'){
     shift(VK_OEM_1);
   }else if(x == ';'){
     norm(VK_OEM_1);
   }else if(x == '<'){
     shift(VK_OEM_COMMA);
   }else if(x == '='){
     norm(VK_OEM_PLUS);
   }else if(x == '>'){
     shift(VK_OEM_PERIOD);
   }else if(x == '?'){
     shift(VK_OEM_2);
   }else if(x == '@'){
     shift('2');
   }else if(x >= 'A' && x <= 'Z'){
     shift(x);
   }else if(x == '['){
     norm(VK_OEM_4);
   }else if(x == '\\'){
     norm(VK_OEM_5);
   }else if(x == ']'){
     norm(VK_OEM_6);
   }else if(x == '^'){
     shift('6');
   }else if(x == '_'){
     shift(VK_OEM_MINUS);
   }else if(x == '`'){
     norm(VK_OEM_3);
   }else if(x >= 'a' && x <= 'z'){
     x -= 0x20;
     norm(x);
   }else if(x == '{'){
     shift(VK_OEM_4);
   }else if(x == '|'){
     shift(VK_OEM_5);
   }else if(x == '}'){
     shift(VK_OEM_6);
   }else if(x == '~'){
     shift(VK_OEM_3);
   }
 }
}

int main(){
 gui_r();
 Sleep(500);
 string("powershell \"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null; [System.Windows.Forms.MessageBox]::Show('Duckiesque Works!', 'PS', 0, 0);\"");
 enter();
 return 0;
}

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...