Skip to content

Instantly share code, notes, and snippets.

View mentlerd's full-sized avatar

David Mentler mentlerd

  • Shapr3D
  • Hungary
View GitHub Profile
@mentlerd
mentlerd / avatargen.py
Last active February 21, 2023 20:38
Transparent Windows user avatar
import argparse
import subprocess
import pathlib
import winreg
#
# This script turned out to be quite large, so might as well document the recipe here..
#
# Windows (like many services...) does not support transparent backgrounds for profile
# pictures natively, it squashes beautiful, lossless, transparent .png files into
@mentlerd
mentlerd / monterey_xnu_sdt.hexpat
Created March 30, 2022 19:08
ImHex pattern to extract DTrace SDT probes from Apple XNU
# Powered by https://github.com/WerWolv/ImHex
#
# /System/Library/Kernels/kernel
# uname -a -> xnu-8020.101.4
struct nullstr {
char data[while(std::mem::read_unsigned($, 1) != 0x00)];
};
struct sdt_entry {
@mentlerd
mentlerd / serialize.lua
Last active November 10, 2018 22:47
Alternative serializer PoC for Factorios 'global' table
local function lookupify(...)
local hash = {}
local function entry(key, ...)
if key == nil then return end
hash[key] = true
return entry(...)
@mentlerd
mentlerd / sh_grep.lua
Created January 28, 2015 12:10
Pretty printing for gmod13
-- Global 'nil' value
NIL = {}
-- Localise for faster access
local pcall = pcall
local string_len = string.len
local string_sub = string.sub
local string_find = string.find