Created
May 2, 2016 09:41
-
-
Save CreateRemoteThread/670ee4b12d37d3428f46997d44d3d559 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import struct | |
from PIL import Image | |
img = Image.new("RGB",(5000,5000),"black") | |
pixels = img.load() | |
f = open("usbdata.txt") | |
data = f.readlines() | |
f.close() | |
startX = 2500 | |
startY = 2500 | |
for d in data: | |
stripped_d = d.rstrip() | |
if len(stripped_d) == 0: | |
continue | |
(control,xmov,ymov,flags) = stripped_d.split(":") | |
(xmov_int,) = struct.unpack(">b",xmov.decode("hex")) | |
(ymov_int,) = struct.unpack(">b",ymov.decode("hex")) | |
startX += xmov_int | |
startY += ymov_int | |
print " setting pixel at %d,%d" % (startX,startY) | |
if control == "01": | |
pixels[startX,startY] = (255,255,255) | |
img.save("fuck.bmp") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment