(draft; work in progress)
See also:
- Compilers
- Program analysis:
- Dynamic analysis - instrumentation, translation, sanitizers
(draft; work in progress)
See also:
// 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) |
Updated: Just use qutebrowser (and disable javascript). The web is done for.
#!/usr/bin/env python | |
import os | |
import sys | |
from ctypes import CDLL | |
from subprocess import call | |
# Morrowind | |
os.environ["SteamAppId"] = "22320" | |
# Enable Steam Overlay |
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
These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).
First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter
(2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.
Finally all remaining files are listed using git ls
, the files to keep are removed from that using grep -v
and the resulting list is passed to git rm
which is invoked by git filter-branch --index-filter
(3.). A bit convoluted but it does the trick.
-- 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 |
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 |
<?php | |
/* | |
Gmod Command (Including quotes!): | |
lua_error_url "http://example.com/log_errors.php" | |
Expected POST data | |
Array | |
( | |
[v] => 4 |
#! /usr/bin/env ruby | |
# usage: | |
# $ das_download.rb email password [download_directory] | |
require 'mechanize' | |
# gem 'mechanize-progressbar' | |
email = ARGV[0] or raise('Please provide the email address for your account') | |
password = ARGV[1] or raise('Please provide the password for your account') | |
path = ARGV[2] || './' |