Skip to content

Instantly share code, notes, and snippets.

View jojonas's full-sized avatar

Jonas Lieb jojonas

View GitHub Profile
@jojonas
jojonas / one-time-token.py
Last active September 9, 2015 13:42
One-Time-Token generator (RFC 6238)
import argparse
import time
import base64
import hmac
import hashlib
# pads the string to a multiple of 8 bytes using "="
def pad_base32(string):
return string + "=" * (8 - ((len(string)-1) % 8) - 1)
@jojonas
jojonas / winscp-deobfuscator.py
Last active February 10, 2022 09:26
WinSCP deobfuscator
import argparse
class Decrypter:
SIMPLE_STRING = "0123456789ABCDEF"
SIMPLE_MAGIC = 0xA3
def __init__(self, password):
self.data = password
def next(self):
@jojonas
jojonas / love2d-unpacker.py
Last active July 8, 2024 14:22
Love2d executable unpacker.
import argparse
import os, os.path
import zipfile
import io
def readui32(file):
bytes = file.read(4)
number = bytes[0]
number += bytes[1] << 8
number += bytes[2] << 16
@jojonas
jojonas / wp_image_shortcode.php
Last active June 17, 2016 21:05
Wordpress plugin for [image id="123" width="300" align="left"]
<?php
/*
Plugin Name: Image Shortcode
Description: Insert an image by id. This plugin automatically fetches title, size and embedded image.
Version: 1.1
Plugin URI: https://gist.github.com/jojonas/f6f9590a596645124cb8
Author: Jonas Lieb
Author URI: http://www.jonaslieb.com
*/
@jojonas
jojonas / st2vim_themes.py
Last active March 28, 2024 16:22
Converter for Sublime Text themes to VIM themes
from __future__ import print_function
import sys
import argparse
import os.path
import textwrap
import re
from pprint import pprint
import xml.etree.ElementTree as ET
@jojonas
jojonas / changeofficelang.py
Last active March 6, 2018 03:20
Change the language of Microsoft Office documents
"""
Changing the spelling language for Microsoft Office documents is a pain.
You can set the default spell-checker language as you desire, but this will
not modify existing templates. Templates are copied during installation
to the path '%appdata%\Microsoft\Templates' and done. Text elements within
these templates will retain their default spelling language.
This leads to a quite painful user experience when working with templates
and multiple languages.
@jojonas
jojonas / atmega328.patch
Created April 7, 2024 09:20
Ghidra Patch for ATmega328 Support
diff -Naur OLD/ghidra_11.0.2_PUBLIC/Ghidra/Processors/Atmel/data/languages/atmega328.pspec NEW/ghidra_11.0.2_PUBLIC/Ghidra/Processors/Atmel/data/languages/atmega328.pspec
--- OLD/ghidra_11.0.2_PUBLIC/Ghidra/Processors/Atmel/data/languages/atmega328.pspec 1970-01-01 01:00:00.000000000 +0100
+++ NEW/ghidra_11.0.2_PUBLIC/Ghidra/Processors/Atmel/data/languages/atmega328.pspec 2024-04-07 09:13:59.826455000 +0200
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<processor_spec>
+
+ <programcounter register="PC"/>
+ <data_space space="mem"/>