Skip to content

Instantly share code, notes, and snippets.

View tbodt's full-sized avatar

tbodt tbodt

View GitHub Profile
@tbodt
tbodt / patch.m
Created July 3, 2018 01:08
dylib that patches out PT_DENY_ATTACH on hopper disassembler 4.3.25 demo
static void *decrypt_start = (void *) 0x1000bafd5;
static void patch(void *addr, char value) {
*(char *) addr = value ^ (addr - decrypt_start) & 0xff;
}
static void __attribute__((constructor)) init() {
patch((void *) 0x1000bb00b, 0); // boobs
}

Keybase proof

I hereby claim:

  • I am tbodt on github.
  • I am tbodt (https://keybase.io/tbodt) on keybase.
  • I have a public key ASDdlt9zLG4QSx4QiLFP3vguVpUCgVtSE-xtM1XCRExXhAo

To claim this, I am signing this object:

@tbodt
tbodt / spectre.c
Created February 8, 2018 23:47 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@tbodt
tbodt / buffer.c
Created August 4, 2017 02:57
circular buffer
#include <pthread.h>
#include <string.h>
#include <errno.h>
#include "buffer.h"
#define lock(thing) pthread_mutex_lock(&(thing)->lock)
#define unlock(thing) pthread_mutex_unlock(&(thing)->lock)
#define wait_for(thing, what) pthread_cond_wait(&(thing)->what, &(thing)->lock)
#define signal(thing, what) pthread_cond_broadcast(&(thing)->what)
std::__1::__tree_iterator<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, std::__1::__tree_node<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, void*>*, long> std::__1::__tree<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, std::__1::__map_value_compare<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, std::__1::less<std::__1::pair<WTF::MediaTime, WTF::MediaTime> >, true>, std::__1::allocator<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> > > >::__insert_unique<std::__1::pair<std::__1::pair<WTF::MediaTime, WTF::MediaTime> const, WTF::RefPtr<WebCore::MediaSample> >&>(std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF:
std::__1::__tree_iterator<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, std::__1::__tree_node<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, void*>*, long> std::__1::__tree<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, std::__1::__map_value_compare<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> >, std::__1::less<std::__1::pair<WTF::MediaTime, WTF::MediaTime> >, true>, std::__1::allocator<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF::RefPtr<WebCore::MediaSample> > > >::__insert_unique<std::__1::pair<std::__1::pair<WTF::MediaTime, WTF::MediaTime> const, WTF::RefPtr<WebCore::MediaSample> >&>(std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::pair<WTF::MediaTime, WTF::MediaTime>, WTF:
//
// Decompiled by Procyon v0.5.30
//
package one.krake.mcexe.screens;
import one.krake.design.event.DCMouseEvent;
import one.krake.design.frame.Frame;
import one.krake.design.alert.Alert;
import javax.swing.Icon;
# Ooohhh! A vending machine!
# This is a time vending machine. You can buy timepieces. You pay by waiting.
#################################### Data segment ####################################
# All sorts of data.
.data
welcome_message:
.int 30
.ascii "Time vending/killing machine\n\n"
@tbodt
tbodt / fox.s
Created February 3, 2017 23:11
# What does the fox say? This program will tell you, but only if you tell it.
# Proud author: Theodore Dubois
.data
dataStart:
animalPrompt:
.int 16
.ascii "Type an animal: "
soundPrompt:
@tbodt
tbodt / lisp.py
Last active December 25, 2016 00:09
lisp in python
class Null:
def __repr__(self):
return '()'
null = Null()
class cons:
def __init__(self, car, cdr):
self.car = car
self.cdr = cdr