Skip to content

Instantly share code, notes, and snippets.

@shakna-israel
shakna-israel / Prose.md
Created October 23, 2019 23:32
Obfuscating Lua

Obfuscating Lua

I've had some fun ruining Python recently, but Python is what I use at work. I prefer to use other languages when I'm doing stuff for fun.

And obfuscation only really makes sense in fun and competition - given a suffeciently determined actor, your code will be reverse engineered. Unless you write it in Malboge.

For this particular experiment, I'll be using Lua 5.3. As I'll probably need to dive into some of the less portable functions to commit our atrocities, I can't guarantee it will run on other popular versions like Luajit or 5.1.


@shakna-israel
shakna-israel / Prose.md
Last active January 6, 2025 17:00
Obfuscating Python

Obfuscating Python

Obfuscation isn't difficult in most programming languages. It's why we have "good practices" because it is so easy to hide what you mean in badly written code.

Obfuscation tends to be even easier in dynamic languages because of how forgiving they tend to be - and because they tend to give you direct access to the environment so that you can manipulate it.

Today, for fun, I'm going to obfuscate this code:

def _(n):

if n <= 0:

@shakna-israel
shakna-israel / crusher
Created August 11, 2018 04:43
crush all the images!
#!/bin/bash
png() {
w=$(mktemp)
pngcrush -brute "$1" "$w"
rm "$1"
mv "$w" "$1"
du -b "$1"
}
@shakna-israel
shakna-israel / .vimrc
Last active March 21, 2018 07:12
A simple vim
set nocompatible " must be the first line
filetype on
filetype indent on
filetype plugin on
set nowrap
set laststatus=2
set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ col=%c%V\ \ totlin=%L%)\ \ \%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%P
set ofu=syntaxcomplete#Complete
" Above is SSH compatibility fixes
flflnitzd fiatzs t$matt
WASHINGTON, DC 20510
November 15, 2017
The Honorable David L. Hunt
Inspector General
#include <EEPROM.h>
#include "base64.hpp"
void help() {
Serial.println(F("Ardl Helpfile\n"
"\n"
"System Limitations:\n"
"Maximum Input Length: 255 characters\n"
"CPU Speed: 8Mhz\n"
"\n"
@shakna-israel
shakna-israel / Original regex
Created January 30, 2018 16:57
Perl Email::Valid regex
[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*@[\040\t]*(?:\([^\\\x80-\xff\n\015()
@shakna-israel
shakna-israel / # tcc - 2018-01-08_20-04-19.txt
Created January 8, 2018 09:17
tcc on macOS 10.13.2 - Homebrew build logs
Homebrew build logs for tcc on macOS 10.13.2
Build date: 2018-01-08 20:04:19
@shakna-israel
shakna-israel / keybase.md
Created January 31, 2017 23:40
keybase.md

Keybase proof

I hereby claim:

  • I am shakna-israel on github.
  • I am shakna (https://keybase.io/shakna) on keybase.
  • I have a public key whose fingerprint is CE67 2507 AB85 EA82 46A5 D3B6 A089 B2D6 AA04 9EFE

To claim this, I am signing this object:

@shakna-israel
shakna-israel / unittest.scm
Created July 1, 2016 13:12
Unit Testing Framework for Scheme
;
; Unit test framework for scheme, originally by http://c2.com/cgi/wiki?JohnClonts
; Heavily modified by me, https://github.com/shakna-israel
;
#|
This is a brain-dead simple unit-testing framework.
It differs wildly from John Clonts' which is where it began life (http://c2.com/cgi/wiki?SchemeUnit), but that was mainly aimed at number equivalency testing.
Basic Usage: