Skip to content

Instantly share code, notes, and snippets.

View whudson's full-sized avatar

William Hudson whudson

View GitHub Profile
@whudson
whudson / StarcomIP.lua
Created August 11, 2023 21:59
Wireshark Dissector for Starcom over IP
-- Refrences retrieved April 5 2023
-- StarComIP Encapsulation Spec: https://buyandsell.gc.ca/cds/public/2017/10/06/9d0480c5678292ea69a866e314b6e152/starcom_ip_implementation.pdf
-- StarCom Application Protocol Spec: https://buyandsell.gc.ca/cds/public/2017/11/08/e026edc197b91636a748c12daea4d4ca/ABES.PROD.PW__HN.B445.E73523.EBSU003.PDF
--
-- StarcomIP Wireshark LUA Dissector (C) William Hudson 2023
--
-- Lua 5.2
--
starcom = Proto("StarCom", "StarCom over IP")
@whudson
whudson / WebpackOutputBuildInfoPlugin.js
Created March 28, 2022 00:59
Webpack plugin to output some info about the build
class OutputBuildInfoPlugin { // webpack plugin
apply(compiler) {
compiler.hooks.done.tap('OutputBuildInfo', (stats) => {
let dateString = new Intl.DateTimeFormat('en-US', {
hour: "numeric",
minute: "numeric",
second: "numeric",
year: "numeric",
month: "2-digit",
day: "2-digit",
@whudson
whudson / python3-hex-print-\x-bytes.py
Last active March 28, 2022 13:50
Python3 - printing a bytestring as escaped bytes
payload = b'bytes'
pretty_payload = '\\x' + '\\x'.join("{0:0{1}x}".format(b, 2) for b in payload)
# the first 0 is the index of the bytes field
# the 0 after : is the fill character
# the {1} is our align width, from field 1 (align=2)
# x specifies lowercase hex format