Skip to content

Instantly share code, notes, and snippets.

@CreateRemoteThread
Created May 2, 2016 09:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CreateRemoteThread/670ee4b12d37d3428f46997d44d3d559 to your computer and use it in GitHub Desktop.
Save CreateRemoteThread/670ee4b12d37d3428f46997d44d3d559 to your computer and use it in GitHub Desktop.
#!/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