Your Name 1 year ago
parent
commit
402e19f98c
8 changed files with 272 additions and 0 deletions
  1. 60 0
      chris-cursive.svg
  2. BIN
      chris-cursive.xcf
  3. BIN
      chris-test.png
  4. 60 0
      chris-x-y.svg
  5. BIN
      cocoon.png
  6. 121 0
      code.py
  7. 9 0
      inkscape.md
  8. 22 0
      toHex.php

File diff suppressed because it is too large
+ 60 - 0
chris-cursive.svg


BIN
chris-cursive.xcf


BIN
chris-test.png


+ 60 - 0
chris-x-y.svg

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="210mm"
+   height="297mm"
+   viewBox="0 0 210 297"
+   version="1.1"
+   id="svg1483"
+   inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
+   sodipodi:docname="chris-x-y.svg">
+  <defs
+     id="defs1477" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="318.81762"
+     inkscape:cy="657.38452"
+     inkscape:document-units="mm"
+     inkscape:current-layer="layer1"
+     inkscape:document-rotation="0"
+     showgrid="false"
+     inkscape:window-width="1920"
+     inkscape:window-height="1017"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata1480">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       sodipodi:nodetypes="cssccssccscsccc"
+       id="path1430"
+       d="m 50.153589,151.3639 c -15.292113,-3.16964 -21.122116,21.07463 -15.529699,30.34111 5.867131,9.72167 19.790231,2.68027 30.171536,-5.13545 6.318115,-4.75668 8.214873,-17.30145 1.945669,-17.30145 -1.990249,0 -5.629249,-0.65106 -3.986927,25.4703 1.684001,-7.49196 5.318794,-10.72017 8.041402,-7.98465 1.822881,1.83152 1.843892,8.4373 3.972137,8.46629 5.613304,0.0765 5.190474,-9.93026 2.738683,-10.68977 2.819953,1.24956 5.440447,2.67857 10.27866,0.332 -0.543403,2.84233 -1.458468,7.46594 0.220377,8.62303 2.739745,1.88828 9.504736,-2.25259 11.098842,-9.56561 -1.275977,4.78741 -2.652201,12.52764 6.391001,6.69639 1.50499,-0.97045 3.24888,-5.21669 4.56523,-7.50824 7.70168,14.12733 1.53344,11.90201 -3.89929,8.46404 19.07591,10.90478 37.65637,-3.56809 48.01684,-22.72955"
+       style="fill:none;stroke:#000000;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+  </g>
+</svg>

BIN
cocoon.png


+ 121 - 0
code.py

@@ -0,0 +1,121 @@
+"""
+  Hello Chris!
+
+  Happy merry holiday Christmas time.  Emma and I wanted to get you a
+  mouse wiggler so we ended up getting you the deluxe version.  Your wiggler
+  comes tricked out with (seriously):
+
+    + 120MHz CPU
+    + 4 KB L1 Cache
+    + a true random number generator
+    + elliptic curve cryptography hardware support (also RSA and DSA)
+    + Direct Memory Access Conroller (zero copy writes)
+    + USB host and device peripheral support in hardware
+    + USART, I2C, SPI, LIN, and RS458 busses
+    + proximity sense / capacitive touch peripherals
+    + a bunch of GPIO, timers, DAC, comparators, temp sensor, everything
+    + built-in RAM, seems underwhelming, but not to be scoffed at: 192 KB
+    + built-in flash storage (again not a lot, but low power): 512 KB
+
+  It is actually a break-out-board for an ARM system-on-a-chip, the
+  [ATSAMD51 Cortex M4](https://www.microchip.com/en-us/product/atsamd51g19a).
+  It is packaged by Adafruit on their ItsyBitsy M4 Express board.  The reason
+  we picked this package is that it comes with an approachable interactive
+  developer environment.  Adafruit added an external 2 MB (it is on-board) flash
+  memory chip to write programs to.  You can copy files to the board using a
+  generic file manager.
+  The firmware that is flashed into the SoC has a built-in Python interpreter.
+  It is not Python3, so you will not be able to use any of the NumPy,
+  psycopg2, or other common Python3 compatible libraries.  The interpreter
+  supports something called CircuitPython.  You can write code in Python, save
+  the code to the flash-drive, then it will automatically begin executing your
+  code in hardware.  This is somewhat a dream for programming.  Usually one
+  does not get this level of support.  I am jealous.
+  Anyways, aside from the limitation of the lack of Python3 libraries, this is
+  still a powerful IDE.  And as far as mouse-wigglers, it is ultra-overkill.
+  We want you to reprogram it.  If you do, let us know, share your code with
+  us we really hope that you like it.  Now you can write custom mouse wigglers
+  keyboard injectors in case MS-Teams changes "busy" criteria.  You may also
+  find it useful in pen-testing as you can type whatever commands you want from
+  the keyboard.
+
+  Kyle + Emma
+"""
+
+import time
+import usb_hid
+from adafruit_hid.mouse import Mouse
+
+"""
+Hmmm, I wonder what this could be?  Maybe you should shake it to find out what
+it is?  It seems to be nicely wrapped.  You can see a red ribbon with a
+beautifully tied bow.  Did it just move?
+"""
+aGift = \
+    b'\x7F' b'\x7F' b'\x84' b'\x7E' b'\x84' b'\x80' b'\x83' b'\x7F' b'\x83' \
+    b'\x81' b'\x83' b'\x80' b'\x83' b'\x81' b'\x83' b'\x82' b'\x82' b'\x82' \
+    b'\x82' b'\x82' b'\x82' b'\x82' b'\x82' b'\x83' b'\x81' b'\x83' b'\x82' \
+    b'\x83' b'\x83' b'\x88' b'\x82' b'\x88' b'\x81' b'\x88' b'\x80' b'\x89' \
+    b'\x80' b'\x89' b'\x7E' b'\x88' b'\x7E' b'\x87' b'\x7E' b'\x83' b'\x7E' \
+    b'\x83' b'\x7D' b'\x83' b'\x7D' b'\x82' b'\x7D' b'\x82' b'\x7D' b'\x82' \
+    b'\x7D' b'\x81' b'\x7C' b'\x81' b'\x7D' b'\x81' b'\x7C' b'\x80' b'\x7C' \
+    b'\x81' b'\x7C' b'\x7F' b'\x7C' b'\x80' b'\x7C' b'\x7F' b'\x78' b'\x80' \
+    b'\x78' b'\x7E' b'\x78' b'\x7D' b'\x77' b'\x7D' b'\x78' b'\x7C' b'\x77' \
+    b'\x7B' b'\x78' b'\x7B' b'\x77' b'\x7B' b'\x78' b'\x7A' b'\x77' b'\x7A' \
+    b'\x78' b'\x7A' b'\x7B' b'\x7B' b'\x7C' b'\x7B' b'\x7C' b'\x7B' b'\x7C' \
+    b'\x7A' b'\x7C' b'\x7A' b'\x7E' b'\x7A' b'\x7D' b'\x7A' b'\x7E' b'\x7A' \
+    b'\x7F' b'\x7A' b'\x7F' b'\x7A' b'\x80' b'\x7B' b'\x80' b'\x7C' b'\x81' \
+    b'\x7C' b'\x82' b'\x7C' b'\x80' b'\x7E' b'\x81' b'\x7F' b'\x81' b'\x7E' \
+    b'\x81' b'\x7F' b'\x81' b'\x7F' b'\x81' b'\x80' b'\x81' b'\x7F' b'\x80' \
+    b'\x81' b'\x81' b'\x80' b'\x80' b'\x82' b'\x80' b'\x83' b'\x81' b'\x83' \
+    b'\x80' b'\x85' b'\x7F' b'\x87' b'\x80' b'\x87' b'\x7F' b'\x8A' b'\x7F' \
+    b'\x8B' b'\x7F' b'\x8D' b'\x7E' b'\x90' b'\x7C' b'\x75' b'\x7C' b'\x78' \
+    b'\x7D' b'\x7B' b'\x7E' b'\x7C' b'\x7D' b'\x7D' b'\x7D' b'\x7D' b'\x7D' \
+    b'\x7D' b'\x7D' b'\x7E' b'\x7D' b'\x7E' b'\x7D' b'\x7F' b'\x7D' b'\x7F' \
+    b'\x7D' b'\x80' b'\x7D' b'\x80' b'\x7D' b'\x80' b'\x7E' b'\x81' b'\x7E' \
+    b'\x80' b'\x7D' b'\x84' b'\x7D' b'\x89' b'\x7D' b'\x83' b'\x7E' b'\x83' \
+    b'\x7E' b'\x81' b'\x7E' b'\x80' b'\x7D' b'\x80' b'\x7E' b'\x7F' b'\x7C' \
+    b'\x7F' b'\x7C' b'\x7E' b'\x7C' b'\x7D' b'\x7D' b'\x7D' b'\x7D' b'\x7C' \
+    b'\x7E' b'\x7C' b'\x7E' b'\x7C' b'\x7F' b'\x7B' b'\x7E' b'\x7C' b'\x7F' \
+    b'\x7C' b'\x80' b'\x7B' b'\x7F' b'\x7D' b'\x80' b'\x7C' b'\x80' b'\x7D' \
+    b'\x81' b'\x7D' b'\x80' b'\x7E' b'\x78' b'\x83' b'\x7B' b'\x80' b'\x7B' \
+    b'\x80' b'\x7A' b'\x7F' b'\x7A' b'\x7F' b'\x7A' b'\x7D' b'\x79' b'\x7D' \
+    b'\x80' b'\x87' b'\x80' b'\x84' b'\x80' b'\x83' b'\x7F' b'\x83' b'\x7E' \
+    b'\x83' b'\x7E' b'\x82' b'\x7E' b'\x80' b'\x7E' b'\x80' b'\x7D' b'\x80' \
+    b'\x7D' b'\x80' b'\x7C' b'\x7F' b'\x7D' b'\x7E' b'\x7C' b'\x7E' b'\x7C' \
+    b'\x7E' b'\x7C' b'\x7E' b'\x7C' b'\x7C' b'\x7C' b'\x7D' b'\x7C' b'\x7C' \
+    b'\x7D' b'\x7C' b'\x7C' b'\x7B' b'\x7D' b'\x7C' b'\x7D' b'\x7A' b'\x7D' \
+    b'\x7B' b'\x7E' b'\x7A' b'\x80' b'\x86' b'\x81' b'\x86' b'\x7F' b'\x82' \
+    b'\x7F' b'\x83' b'\x7F' b'\x82' b'\x7E' b'\x81' b'\x7E' b'\x81' b'\x7E' \
+    b'\x81' b'\x7D' b'\x80' b'\x7C' b'\x7F' b'\x7C' b'\x7F' b'\x7B' b'\x7E' \
+    b'\x7A' b'\x7C' b'\x79' b'\x7C' b'\x7D' b'\x7D' b'\x7D' b'\x7D' b'\x7B' \
+    b'\x77' b'\x7B' b'\x77' b'\x7B' b'\x78' b'\x7A' b'\x88' b'\x7C' b'\x87' \
+    b'\x7D' b'\x85' b'\x7D' b'\x84' b'\x7E' b'\x83' b'\x7F' b'\x82' b'\x80' \
+    b'\x81' b'\x80' b'\x81' b'\x81' b'\x7F' b'\x82' b'\x7F' b'\x82' b'\x7F' \
+    b'\x82' b'\x7E' b'\x86' b'\x7C' b'\x86' b'\x7A' b'\x79' b'\x83' b'\x79' \
+    b'\x81' b'\x79' b'\x82' b'\x78' b'\x80' b'\x78' b'\x80' b'\x78' b'\x7F' \
+    b'\x78' b'\x7F' b'\x78' b'\x7E' b'\x77' b'\x7E' b'\x78' b'\x7E' b'\x77' \
+    b'\x7C' b'\x77' b'\x7D' b'\x77' b'\x7C' b'\x77' b'\x7B' b'\x77' b'\x7B' \
+    b'\x76' b'\x7B' b'\x6F' b'\x76' b'\x6E' b'\x75' b'\x6E' b'\x73' b'\x6E' \
+    b'\x73' b'\x6E' b'\x72' b'\x6F' b'\x71' b'\x6F' b'\x71' b'\x6F' b'\x71'
+
+# CircuitPython already enumerates HID mouse, get a handle for it
+mouse = Mouse(usb_hid.devices)
+
+autoClick = False
+delay = 0.5
+
+# turn off the delay if auto-click is enabled
+if autoClick:
+    delay = 0
+
+while True:
+    # wiggle the mouse
+    for i in range(len(aGift) / 2):
+        mouse.move(x=-(aGift[2*i] - 127), y=aGift[2*i+1] - 127)
+    # reset mouse position, delay makes it easier to manually click the mouse
+    time.sleep(delay)
+    if autoClick: mouse.release(mouse.LEFT_BUTTON)
+    mouse.move(x=-211,y=26)
+    time.sleep(delay)
+    if autoClick: mouse.click(mouse.LEFT_BUTTON)

+ 9 - 0
inkscape.md

@@ -0,0 +1,9 @@
+# Inkscape
+One can create a path, then from exensions menu, click export, then plot.  Set serial port settings.  Read options, most I turned off.
+
+```
+IN;SP1;PU50,99;PD46,100,42,100,39,100,35,99,32,98,29,97,26,95,23,93,20,91,18,88,15,86,13,83,11,79,9,76,6,69,3,62,2,54,1,46,0,39,1,31,2,25,3,21,4,18,5,16,6,13,8,10,10,8,11,6,13,5,15,3,18,2,20,1,22,0,25,0,27,0,33,0,38,0,44,2,50,3,56,6,62,9,68,12,74,16,80,19,86,23,92,27,95,30,98,33,100,37,103,41,104,45,106,49,107,53,108,57,108,61,108,65,107,68,106,71,105,73,103,75,102,76,100,76,99,76,97,77,95,76,94,76,92,76,91,75,90,73,89,71,88,68,87,64,86,60,85,54,85,47,85,38,85,29,85,17,86,4,88,12,90,18,92,21,93,23,95,25,96,27,98,28,99,29,101,29,103,30,104,30,106,29,107,28,109,27,110,26,110,24,112,21,114,13,115,9,116,6,117,5,118,4,119,3,120,3,123,3,125,4,127,5,129,7,130,9,131,12,132,15,132,17,133,20,132,23,132,25,132,28,131,30,130,31,129,33,128,33,134,31,137,30,140,29,144,29,148,29,152,30,157,32,156,26,155,22,155,18,155,15,155,12,156,10,157,9,157,8,159,7,161,7,163,7,165,7,167,8,170,9,172,10,174,12,177,14,179,16,181,18,183,21,185,24,187,28,188,31,189,35,188,30,187,24,186,21,186,19,187,16,187,14,188,12,189,11,191,10,193,10,196,10,199,12,203,13,207,16,209,17,210,20,214,25,217,32,220,37,224,30,226,24,228,19,230,15,230,12,230,10,230,8,228,7,227,6,225,6,223,6,220,7,215,10,209,13,214,11,219,8,224,6,229,5,234,4,239,3,244,3,249,3,254,3,259,4,263,5,268,6,273,7,277,9,282,11,286,14,291,16,295,19,299,22,303,25,311,33,319,40,326,49,333,58,339,68,345,78;PU0,0;SP0;IN;
+```
+
+# com0com
+In order to capture output from Inkscape, one needs to setup a virtual serial port pair.  You can open puTTY on one end and have Inkscape export to the other.

+ 22 - 0
toHex.php

@@ -0,0 +1,22 @@
+<?php
+// 30 dpi
+$arr = array(20,41,18,42,16,41,15,41,14,41,12,40,11,40,10,39,9,38,8,37,7,36,6,34,5,33,4,32,3,29,2,26,1,23,1,19,0,16,1,13,1,10,1,9,2,8,2,6,3,5,4,4,4,3,5,3,6,2,7,1,8,1,9,0,10,0,11,0,12,0,14,0,16,0,19,1,21,1,24,2,26,4,29,5,31,6,34,8,36,10,39,11,40,13,41,14,42,15,43,17,44,19,44,20,45,22,45,24,45,25,45,27,45,28,45,29,44,30,43,31,43,32,42,32,41,32,40,32,39,32,38,31,37,30,37,28,36,27,36,25,36,22,36,20,36,16,36,12,36,7,36,2,37,5,38,7,39,9,39,10,40,10,40,11,41,12,42,12,43,12,44,12,45,12,46,11,46,10,47,9,48,5,48,4,49,3,49,2,50,1,51,1,52,2,53,2,54,3,55,4,55,5,55,6,55,7,56,8,56,9,55,11,55,12,55,13,54,14,56,13,57,12,59,12,60,12,62,12,64,13,66,13,65,11,65,9,65,8,65,6,65,5,65,4,66,4,66,3,67,3,68,3,69,3,70,3,71,4,72,4,73,5,74,6,75,7,76,8,77,9,77,10,78,12,79,13,79,15,79,12,78,10,78,9,78,8,78,7,78,6,79,5,80,4,81,4,82,4,83,5,85,6,87,7,88,8,89,11,91,13,92,16,94,13,95,10,95,8,96,6,96,5,96,4,96,3,95,3,94,3,93,3,92,3,90,4,87,6,89,5,91,4,94,4,96,4,99,4,101,4,104,4,107,5,110,6,113,7,117,8,120,9,127,12,134,15,141,18,148,22,155,26,162,30,175,38,186,44);
+
+// 82 (90 dpi values exceed 255)
+$arr = array(58,125,53,126,48,125,44,125,40,123,36,122,32,120,28,117,25,114,22,111,19,108,16,104,14,100,11,96,7,87,4,78,2,69,1,59,0,49,1,40,2,32,3,28,4,24,6,20,8,17,10,14,12,11,14,9,17,7,19,5,22,4,25,2,28,2,31,1,34,1,41,0,48,1,55,3,63,5,70,8,78,12,85,16,93,20,100,25,108,30,115,35,119,39,122,43,125,47,128,52,131,57,132,62,134,67,135,72,135,77,135,82,134,86,133,89,131,92,128,95,127,96,125,96,123,97,121,97,119,97,117,96,115,96,114,94,112,93,111,90,110,86,108,82,107,76,107,68,106,60,106,49,106,37,106,23,107,6,110,16,113,23,115,27,116,30,118,32,120,34,122,36,124,37,126,38,128,38,130,38,132,37,134,36,136,35,137,33,138,32,140,27,142,17,144,13,145,9,146,7,147,6,149,5,150,5,153,5,156,6,159,8,161,10,163,13,164,16,165,19,165,23,166,26,166,29,165,33,165,35,164,38,163,40,161,42,160,43,167,39,171,38,175,37,180,37,185,37,190,39,196,41,195,33,194,28,193,24,193,20,194,16,195,13,196,12,197,11,199,10,201,9,204,9,206,10,209,11,212,12,215,13,218,16,221,18,224,21,226,24,229,28,231,31,233,36,235,40,236,45,235,38,233,31,233,28,233,24,233,21,234,19,235,17,236,15,238,14,241,14,244,14,248,15,253,18,259,21,261,23,263,25,267,33,271,41,275,48,280,39,283,31,285,25,287,20,288,16,288,13,287,11,286,9,284,9,281,9,278,9,275,10,268,13,261,18,267,14,273,12,279,9,286,8,293,7,300,7,307,7,314,8,322,9,329,10,337,13,345,15,353,18,361,22,369,26,378,30,394,39,411,49,428,61,445,73,462,86,478,100,494,114,510,128);
+
+$out = array();
+$len = count($arr);
+$last = array($arr[0], $arr[1]);
+for($i = $len/2; $i--;) {
+    $c = array($arr[$len - 2 * ($i + 1)], $arr[$len + 1 - 2 * ($i + 1)]);
+    $x = $last[0] - $c[0];
+    $y = $last[1] - $c[1];
+    $out[] = array($x,$y);
+    $last[0] = $c[0];
+    $last[1] = $c[1];
+}
+// print recentered output
+foreach($out as $v) {
+    echo sprintf("b'\\x%02X' b'\\x%02X' ", $v[0] + 127, $v[1] + 127);
+}

Some files were not shown because too many files changed in this diff