Skip to content

Instantly share code, notes, and snippets.

View MDFL64's full-sized avatar
💣
Malevolent Dictator for Life.

Adam Coggeshall MDFL64

💣
Malevolent Dictator for Life.
View GitHub Profile
@MDFL64
MDFL64 / overlay.js
Created April 4, 2022 16:55
Wandering / Star Trek Overlay
// ==UserScript==
// @name Wandering / Star Trek Overlay
// @namespace http://tampermonkey.net/
// @version 0.3
// @description try to take over the canvas!
// @author cogg + Mikarific + probably stolen from someone else
// @match https://hot-potato.reddit.com/embed*
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant none
// ==/UserScript==

BENCH ROYALE

I want to make a less shitty, more comprehensive set of programming language benchmarks.

Obligatory "Microbenchmarks are not necessarily indicative of real world performance", but I am super unimpressed with The Benchmark Game and am at least convinced I could do what it does better.

TEST CODE GUIDELINES

Tests should primarily test the speed of code execution, and the efficiency of the garbage collector (if applicable).

@MDFL64
MDFL64 / glua86.lua
Last active October 29, 2018 10:37
-- based on https://github.com/nanochess/fbird
return function(cpu)
local call=cpu.call
local int=cpu.int
local status=cpu.status
local r8=cpu.r8
local r16=cpu.r16
local data8=cpu.data8
local data16=cpu.data16
local stack8=cpu.stack8
var cp = require("child_process");
var words = ["bash","-c","a=/tmp/gt\nb=>(./get* > $a)\nexpr $(sed -n 2p $a) > $b\ncat $a"];
var cmd = "${!#}<<<{";
for (var w=0;w<words.length;w++) {
var target_cmd=words[w];
cmd+="\\$\\'";
for (var i=0;i<target_cmd.length;i++) {
(import lua/basic)
(import lua/string)
(import lua/io)
(let* [(bytecode (lua/string/dump (call lua/basic/_G :loadstring (lua/io/read "*all"))))
(i 1)
(read-string (lambda (len)
(let* [(i' (+ i len))
(res (self bytecode :sub i (- i' 1)))]
(set! i i')
; Adam Coggehsall
; Writeup for Dakotacon CTF 2017: Postfix Shellcode
; Problem Description:
; There is a service listening on 138.247.115.12:9994.
; This service takes and executes exactly 80 bytes of x86 shellcode.
; There is a char pointer to a postfix expression in ebx.
; Your are to compute the value of that expression and store the result in eax.
; Possible numbers are 0-9 and possible operators are +,-,*,/.
; Every token is one char/byte.
local spawns = {
-- downtown
{"fountain",Vector(-1920.9022216797,-1552.2468261719,55.407211303711)},
{"fountain",Vector(-1994.2349853516,-1549.5101318359,-67.693962097168)},
{"fountain",Vector(-1852.3597412109,-1546.9318847656,-67.693962097168)},
{"fountain",Vector(-1799.9158935547,-1431.9406738281,-147.96875)},
{"fountain",Vector(-2042.1708984375,-1421.9338378906,-147.96875)},
{"fountain",Vector(-2035.2969970703,-1675.7540283203,-147.96875)},
{"fountain",Vector(-1802.9816894531,-1675.6978759766,-147.96875)},
{"plaza",Vector(-1524.4903564453,-1955.6204833984,-195.96875)},
@MDFL64
MDFL64 / module.cpp
Created August 23, 2014 21:18
gm_v8
#include <stdio.h>
#include <map>
#include "GarrysMod/Lua/Interface.h"
#include "Color.h"
#include "tier0/dbg.h"
#include "v8.h"
/// Lua Loadstring function -- Credit http://facepunch.com/showthread.php?t=1386454
@MDFL64
MDFL64 / wsdl.lua
Created August 22, 2014 04:31
Parakeet's Workshop Download Tool
local read_manifest = file.Read("wsdl_manifest.txt")
if read_manifest==nil then
print('[WSDL] No manifest. Run "wsdl_buildmanifest" to generate the manifest.')
else
read_manifest=util.JSONToTable(read_manifest)
for k,v in pairs(read_manifest.general) do
resource.AddWorkshop(v)
end
print("[WSDL] Added "..#read_manifest.general.." workshop addons to download list.")
@MDFL64
MDFL64 / vm.lua
Created August 17, 2014 02:21
o god why
if CLIENT then return end
/* jit.util library functions
funcbc = function: builtin#142
funck = function: builtin#143
funcinfo = function: builtin#141
traceinfo = function: builtin#145
tracek = function: builtin#147
tracesnap = function: builtin#148