Skip to content

Instantly share code, notes, and snippets.

@candycode
candycode / ld-preload-intercept-method.cpp
Created May 23, 2016 21:12 — forked from mooware/ld-preload-intercept-method.cpp
Intercept C++ methods with LD_PRELOAD
// this file is an example of how to intercept a C++ method by using the
// LD_PRELOAD environment variable of the GNU dynamic linker.
//
// it works like this:
//
// 1) define a method that will have the same symbol as the intercepted
// method when compiled. For example, the method Foo::getValue()
// defined here has the mangled symbol "_ZNK3Foo8getValueEv".
// tools like nm, objdump or readelf can display the symbols of
// binaries.
@candycode
candycode / core.clj
Last active August 29, 2015 14:16 — forked from Misophistful/core.clj
(ns apples.core
(:require [play-clj.core :refer :all]
[play-clj.g2d :refer :all]
[play-clj.math :refer :all]))
(declare apples main-screen)
(def speed 14)
(defn- get-direction []
(cond
@candycode
candycode / websocketserver.py
Created October 22, 2012 15:17 — forked from jkp/websocketserver.py
A simple WebSockets server with no dependencies
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
class WebSocketsHandler(SocketServer.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'