mame82 / duckencoder.py

Python port of infamous duckencoder for RubberDucky
136 stars 49 forks source link

Question regarding "KEY_" values (e.g. KEY_BACKSLASH) #13

Open michalmonday opened 5 years ago

michalmonday commented 5 years ago

Hi, in keyboard.properties some of the values are in hex (preceded with 0x) but some of the values are in standard base 10. However, in the "gb.properties" file the KEY_BACKSLASH holds "64", is it supposed to be 0x64?

I tested it with "Keyboard" library of Arduino Pro Micro like this:

  KeyReport kr = {0x2, 0, // lack of 0x2 (0) results in backslash
    {
      0x64, 0, 0, 0, 0, 0
    }
  };
  HID().SendReport(2, &kr, sizeof(KeyReport));
  delay(50);

  kr = {0, 0, 
    {
      0, 0, 0, 0, 0, 0
    }
  };
  HID().SendReport(2, &kr, sizeof(KeyReport));

And it appears to correctly type the pipe character (which I was trying to type).

So my question is: are the "KEY_..." values within language-specific properties files actually hex values? E.g. Should KEY_ASH=100 be actually interpreted as 0x100?

Edit: It turns out that all the ascii characters are typed correctly using UK keyboard with English (UK) system settings and the KEY_ASH (or KEY_HASH?) value of 0x32 and KEY_BACKSLASH value of 0x64, however it was required to change the anomalies in the "ASCII_XX" order, e.g. ASCII_7E in the place of ASCII_7C ASCII_23 in the place of ASCII_5C https://github.com/michalmonday/duckencoder.py/blob/master/resources/gb.properties