Skip to content

Instantly share code, notes, and snippets.

View bmwalters's full-sized avatar

Bradley Walters bmwalters

  • Affirm
  • United States
View GitHub Profile
@MattPD
MattPD / analysis.draft.md
Last active April 24, 2024 14:53
Program Analysis Resources (WIP draft)
@mmozeiko
mmozeiko / test.c
Last active November 19, 2023 13:25
gtk widget from x11 window
// gcc test.c `pkg-config --cflags --libs gtk+-3.0 gdk-3.0` -lX11 && ./a.out
#include <X11/Xlib.h>
#include <unistd.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
static void my_gtk_realize(GtkWidget* widget, gpointer user)
local red = Color(255,0,0)
local green = Color(0,255,0)
local function log(color,s)
MsgC(color,s .. "\n")
end
function mdmp(out)
local files,_ = file.Find("*.mdmp","BASE_PATH")
if out then log(red,"Found " .. #files .. " files!") end
@steevp
steevp / openmw_steam.py
Last active January 17, 2024 10:42
Launch openmw and have Steam track your gameplay hours, etc as if you were playing Morrowind
#!/usr/bin/env python
import os
import sys
from ctypes import CDLL
from subprocess import call
# Morrowind
os.environ["SteamAppId"] = "22320"
# Enable Steam Overlay
FROM debian:jessie
RUN apt-get update && apt-get install -y \
build-essential \
ca-certificates \
curl \
binutils-dev \
libmad0-dev \
libgtk2.0-dev \
libasound-dev \
@haasn
haasn / about:config.md
Last active April 2, 2024 18:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

@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
function unrequire( modName )
if( not modName ) then return end
local _R = debug.getregistry()
local moduleMetatable = _R["_LOADLIB"]
package.loaded[ modName ] = nil
_G[ modName ] = nil
for k, ud in pairs( _R ) do
if( (type(k) == "string") and string.find( k, "^LOADLIB: .+gm.._" .. modName .. "_.+%.dll$" ) and (type(ud) == "_LOADLIB") and (getmetatable(ud) == moduleMetatable) ) then
print( "Unloading: " .. k )
@i-am-scott
i-am-scott / gist:10386462
Created April 10, 2014 14:10
Gmod lua_error_url
<?php
/*
Gmod Command (Including quotes!):
lua_error_url "http://example.com/log_errors.php"
Expected POST data
Array
(
[v] => 4

Exploiting Lua 5.1 on 32-bit Windows

The following Lua program generates a Lua bytecode program called ignore-unsigned-sga.fnt, which in turn loads a DLL from within an extremely locked down Lua 5.1 sandbox in a program called RelicCOH2.exe. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.

if string.dump(function()end):sub(1, 12) ~= "\27Lua\81\0\1\4\4\4\8\0" then
  error("This generator requires a 32-bit version of Lua 5.1")
end

local function outer()
  local magic -- In bytecode, the stack slot corresponding to this local is changed