GithubHelp home page GithubHelp logo

dummy-decoy / flipperzero_badusb_kl Goto Github PK

View Code? Open in Web Editor NEW
83.0 3.0 5.0 137 KB

keyboard layout file generator for the badusb application of the flipperzero device

License: MIT License

C 99.19% Makefile 0.81%
flipperzero

flipperzero_badusb_kl's Introduction

Keyboard layout file generator for the flipperzero badusb application

Usage

flipperzero_badusb_kl.exe <options> [<file>]

options are:
    -h      display this help
    -r      read layout file <file> and work from here
    -w      write layout file <file> when done
    -d      dump current keyboard layout
    -m <char> <key> <mods>
            map a key to a character. repeat option as necessary.
                <char> is any character between ascii(32) and ascii(126)
                <key>  is the hid key code (see -k)
                <mods> is any combination of none, lshift, lctrl, lalt,
                       lgui, rshift, rctrl, ralt, rgui separated by a +
    -k      display valid hid key codes\
    -g      display a simplified graphical representation of the
            resulting mapping. good for a quick check, prefer -l for
            serious diagnostic
    -l      list exhaustively the content of the resulting mapping
    -e      expert mode. suppress all checks on following -m options,
            effectively allowing to put whatever you see fit into the
            keyboard layout. 

options are applied in the following order: -r -d -m -k -g -l -w

Requirements

Building

The included makefile is intended for the MingW-W64 port of GCC on Windows.

Execution

Obviously requires a Windows computer.

Examples

  • Create a new layout file from your own current keyboard layout:

      flipperzero_badusb_kl.exe -d -w my_layout.kl
    
  • Open an existing layout file and display its simplified view:

      flipperzero_badusb_kl.exe -r -g my_layout.kl
    
  • Open an existing layout, set the key for $ to ctrl+shift+1, set the key for # to altgr+0, and save the modified layout:

      flipperzero_badusb_kl.exe -r -m $ 1e ctrl+shift -m # 27 ralt -w my_layout.kl
    
  • The second argument to the -m option (1e and 27 in the example above) is the key code. See what code correspond to each key:

      flipperzero_badusb_kl.exe -k
    
  • Just display a simplified view of the current keyboard layout, without saving anything:

      flipperzero_badusb_kl.exe -d -g
    

.kl file format

A .kl file is a binary file format which stores, for each ASCII code point in order from ASCII(0) to ASCII(127), a 16 bit little endian value composed of a USB HID code in the low order byte and a bit set of modifier keys in the high order byte.

USB HID codes for each key of a standard 102/105 key keyboard are (as displayed passing option -k to the software):

     ---------------------------------------------------------------------- 
    | 35 | 1e | 1f | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 2d | 2e |  <- |
     ---------------------------------------------------------------------- 
    |  -> | 14 | 1a | 08 | 15 | 17 | 1c | 18 | 0c | 12 | 13 | 2f | 30 |    |
     ------------------------------------------------------------------|   |
    |   o  | 04 | 16 | 07 | 09 | 0a | 0b | 0d | 0e | 0f | 33 | 34 | 31 |   |
     ---------------------------------------------------------------------- 
    |  ^  | 64 | 1d | 1b | 06 | 19 | 05 | 11 | 10 | 36 | 37 | 38 |    ^    |
     ---------------------------------------------------------------------- 
    | ctrl | gui | alt |              2c                | alt | gui | ctrl |
     ---------------------------------------------------------------------- 

Modifier key bits are listed in order, starting from bit 1: lctrl, lshift, lalt, lgui, rctrl, rshift, ralt, rgui.

flipperzero_badusb_kl's People

Contributors

dummy-decoy avatar francis2054 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flipperzero_badusb_kl's Issues

How to use generated layouts on Flipper?

Dumb question, but... How do we use a generated layout on the Flipper in badUSB? Does there need to be some kind of command in each ducky script that tells the Flipper what layout to use for the attack, or how do we tell the Flipper which layout to use?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.