Skip to content

Instantly share code, notes, and snippets.

View meepen's full-sized avatar

Devin Korb meepen

View GitHub Profile
@meepen
meepen / LICENSE
Last active July 1, 2017 20:58
Legendary old code from Meep Optimizer, previously unreleased code.
Copyright (c) 2015-2017 Meepen / MeepDarknessMeep
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
#!/usr/bin/python
import sys
import struct
import idaapi
from idc import *
class NCSDLoader(object):
class FIRMLoader(object):
@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())
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <direct.h>
static bool IsPathAbsolute(const char *path)
{
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
@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,
@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 / obfuscated.lua
Created November 20, 2016 04:27
obfuscation test 1
local
_,b
a.meme()local
a={}local
c=2
print(c)
@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 / 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