Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special characters not accepted; debug message sent to stdout #8

Open
doublehp opened this issue Jan 21, 2018 · 3 comments
Open

special characters not accepted; debug message sent to stdout #8

doublehp opened this issue Jan 21, 2018 · 3 comments

Comments

@doublehp
Copy link

# echo -e "\x1B" | python duckencoder/duckencoder.py -l us -r | hexdump -C
00000000  1b 20 69 6e 74 65 72 70  72 65 74 65 64 20 61 73  |. interpreted as|
00000010  20 41 53 43 49 49 5f 31  42 2c 20 62 75 74 20 6e  | ASCII_1B, but n|
00000020  6f 74 20 66 6f 75 6e 64  20 69 6e 20 63 68 6f 73  |ot found in chos|
00000030  65 6e 20 6c 61 6e 67 75  61 67 65 20 70 72 6f 70  |en language prop|
00000040  65 72 74 79 20 66 69 6c  65 2e 20 53 6b 69 70 70  |erty file. Skipp|
00000050  69 6e 67 20 63 68 61 72  61 63 74 65 72 21 0a 28  |ing character!.(|
00000060  00                                                |.|
00000061

This is wrong at several levels:

1B is a standart character, and used for many commands:
http://www-ug.eecg.toronto.edu/~gizmodoc/demos/code/Colour_Escape/keyCodes.txt

The error message is sent to stdout instead of stderror; what means:

  • user can not see the error message (I lost 4h on tracking the root problem)
  • invalid data are sent to the next command on the pipe, resulting in garbage sent to the host (USB HID Gadget client)

This implies the encoder can only work on pure alpha keys, and is unable to deal with ESC, arrows, function keys, or home ...

@doublehp
Copy link
Author

Error message coming out of stdout issue lays in duckencoder.py line 313; similar issue is expected on lines 325 and 326.

@mame82
Copy link
Owner

mame82 commented Jan 21, 2018

Good point, I need to review this

@mame82
Copy link
Owner

mame82 commented Jan 21, 2018

Not sending errors to stdout is a good idea. Considering the missing characters in the layouts, this is a problem whuch arised because the logic (and the layouts) are mostly the same as in legacy DuckEncoder.

The whole tool needs a reimplementation, at least for P4wnP1.

Unfortunately I'm lacking the time to work on thus in near future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants