Skip to content

Instantly share code, notes, and snippets.

@handsomematt
handsomematt / class.lua
Created June 28, 2013 17:11
Classes in Lua.
-- class.lua
-- Compatible with Lua 5.1 (not 5.0).
function Class(base, _ctor)
local c = {} -- a new class instance
if not _ctor and type(base) == 'function' then
_ctor = base
base = nil
elseif type(base) == 'table' then
-- our new class is a shallow copy of the base class!
for i,v in pairs(base) do
@handsomematt
handsomematt / tradable.lua
Created June 28, 2013 17:14
Example usage of classes.
local Tradable = Class(function(self, inst)
self.inst = inst
self.goldvalue = 0
end)
function Tradable:CollectUseActions(doer, target, actions)
if target.components.trader and target.components.trader.enabled then
table.insert(actions, ACTIONS.GIVE)
end
end
#ifndef _LND_H_
#define _LND_H_
// Includes
#include <mvmath.h> // This include file includes the math functions
#include <ddraw.h> // for DXT3
//
// Structures
local gmod = gmod
local pairs = pairs
local isfunction = isfunction
local isstring = isstring
local IsValid = IsValid
local unpack = unpack
module( "hook" )
local Hooks = {}
// ==UserScript==
// @name acecooled
// @namespace http://gayyyyy.com
// @version 0.1
// @description enter something useful
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @match http://*facepunch.com/showthread.php?t=*
// @copyright 2012+, You
// ==/UserScript==
@handsomematt
handsomematt / kill_steam.js
Created October 16, 2014 18:13
Chrome extension to kill Steam link filter
chrome.webRequest.onBeforeRequest.addListener(function(pre_req) {
var url = pre_req.url;
var match = url.match("url=(.*)");
if (match && match[1]) {
return { redirectUrl: match[1] };
}
}, {
"""
//
// This will take all cross references to strings containing '.cpp', and pre-pend the name of the .cpp file
// to any IDA-recognized subs that xref that string. For example, if sub_b0aafd references a string that
// looks like '..\dev\src\game\client\main\file.cpp', this script will re-name sub_b0aafd to file.cpp_sub_b0aafd.
//
// To use:
// Run this as an idaPython script. I don't know IDA very well, so I usually just copy it, in its entirety, into the
// Python command window.
//

Keybase proof

I hereby claim:

  • I am HandsomeMatt on github.
  • I am handsomematt (https://keybase.io/handsomematt) on keybase.
  • I have a public key whose fingerprint is 2474 B173 6C4B D14E 046E CCF8 5A42 002F DEE1 9A31

To claim this, I am signing this object:

"""
//
// 3ds_svc_calls.py
//
// This will go through each svc call and leave a comment based on it's
// service call
//
"""
from idaapi import *
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <3ds.h>
#include <citro3d.h>
#include "vshader_shbin.h"