Skip to content

Instantly share code, notes, and snippets.

View meepen's full-sized avatar

Devin Korb meepen

View GitHub Profile
@meepen
meepen / materialmeepen.lua
Last active February 5, 2017 04:38
A Derma skin for Garry's Mod. Mimics Windows 10 a bit.
local surface = surface
local draw = draw
local Color = Color
surface.CreateFont("MaterialMeepen", {
font = "Tahoma",
size = 13,
weight = 500,
antialias = true,
extended = true
@meepen
meepen / autorun_antinospread.lua
Last active July 13, 2016 14:36
no nospread allowed
local hashes = include "sha_rng.lua"
-- if this stops working find a non hackier way to run before everything else and alone
for k,v in pairs(debug.getregistry()[3]) do
if (v == "EntityFireBullets") then
debug.getregistry()[3][k] = "EntityFireBullets_SPREAD"
break
end
end
@meepen
meepen / coordbitmp.lua
Created August 5, 2016 16:51
WriteCoordBitMP/ReadCoordBitMP in Garry's Mod Lua (for prediction fixing!!!)
local function encodefloat(f, bIntegral, bLowPrecision)
local signbit = (f <= -( bLowPrecision and COORD_RESOLUTION_LOWPRECISION or COORD_RESOLUTION ));
local intval = math.floor(math.abs(f));
local fractval = bLowPrecision and
( bit.band(math.floor(math.abs(f*COORD_DENOMINATOR_LOWPRECISION)), (COORD_DENOMINATOR_LOWPRECISION-1))) or
( bit.band(math.floor(math.abs(f*COORD_DENOMINATOR)), (COORD_DENOMINATOR-1) ));
local bInBounds = intval < (2 ^ COORD_INTEGER_BITS_MP );
@meepen
meepen / obfuscated.lua
Created November 20, 2016 04:27
obfuscation test 1
local
_,b
a.meme()local
a={}local
c=2
print(c)
@meepen
meepen / async.lua
Created January 29, 2017 02:51
async.lua
local LOCALVERSION = 0
local async_mt = {}
local async = setmetatable({}, async_mt)
async.VERSION = LOCALVERSION
async.await = function(fn)
return coroutine.yield(fn)
end
@meepen
meepen / if-vs-fn.lua
Created February 28, 2017 16:57
if bst > fn lookup tbl
local clock = os.goodclock or os.clock
local fns = {
function(a,b) return a + b end,
function(a,b) return a - b end,
function(a,b) return a * b end,
function(a,b) return a / b end,
function(a,b) return a ^ b end,
function(a,b) return b + a end,
if (x > 2047) then
if (x > 3071) then
if (x > 3583) then
if (x > 3839) then
if (x > 3967) then
if (x > 4031) then
if (x > 4063) then
if (x > 4079) then
if (x > 4087) then
if (x > 4091) then
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <direct.h>
static bool IsPathAbsolute(const char *path)
{
@meepen
meepen / non-powerof2-png-gmod.lua
Last active February 22, 2021 17:40
Loads non power of 2 PNG into a Garry's Mod texture without fucking over scaling.
local function wait_png(matstr)
local html = vgui.Create("DHTML")
html:AddFunction("console", "memeify", function()
html.done = true
end)
local mat = Material(matstr)
local rw, rh = mat:GetInt "$realwidth", mat:GetInt "$realheight"
local f = file.Open("materials/"..matstr, "rb", "GAME")
local cont = f:Read(f:Size())
#!/usr/bin/python
import sys
import struct
import idaapi
from idc import *
class NCSDLoader(object):
class FIRMLoader(object):