Skip to content

Instantly share code, notes, and snippets.

@iMoD1998
iMoD1998 / Detour.cpp
Last active October 26, 2024 17:30
Xbox 360 Detours
#include "Detour.h"
BYTE Detour::TrampolineBuffer[ 200 * 20 ] = {};
SIZE_T Detour::TrampolineSize = 0;
@WilliamBundy
WilliamBundy / wb_alloc.h
Created November 3, 2017 01:05
A single-file header allocation library for C (probably bugs out in C++, sorry)
/* This is free and unencumbered software released into the public domain. */
/* Check the bottom of this file for the remainder of the unlicense */
/* wb_alloc.h
*
* Three custom allocators that can (hopefully) safely allocate a very large
* amount of memory for you. Check the warnings below for an explanation
*
* Version 0.0.1 Testing Alpha
*/
@haasn
haasn / about:config.md
Last active August 9, 2024 10:23
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

Program Database (PDB) File Format

The PDB file format is a compound file. It is composed of numbered data streams, each of which stores some predefined information about the target program. For example, one stream appears to contain a list of symbol names, while another describes the code and data sections used by the linker.

A special stream, the root stream, contains all the information necessary to locate the other streams within the file.

All numbers are encoded in little-endian format.

Credit to http://www.informit.com/articles/article.aspx?p=22685 for reverse-engineering an older version of the PDB format, which helped considerably.

@jamestalmage
jamestalmage / forward.md
Last active April 9, 2024 17:21
Using Firebase to Authenticate to Google Drive

Note: There is a lot of information here, but if I have provided a link, it is probably something you should click on and read. OAuth is a complex enough subject on it's own, and hacking these two services together only adds to it.

Even so, I have found Firebase's API to be simpler than almost any other OAuth solution I have explored. When all is said and done, the important bits of code related to authentication is actually less than 10 lines. If you have ever tried to implement your own OAuth flow before, you know how amazing that is.

In the end, it may be worth using Firebase for authentication, even if that's the ONLY thing you use it for.

@soeminnminn
soeminnminn / DDSImageParser.cs
Last active November 18, 2023 16:39
Read DDS image in C# way. Converted from "[il_dds.c] https://github.com/DentonW/DevIL/blob/master/DevIL/src-IL/src/il_dds.c" (DevIL).
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
namespace S16.Drawing
{
#region DDSImage Class
@x1nixmzeng
x1nixmzeng / prelen.bt
Last active July 31, 2021 20:43
Binary template for reading strings of known or unknown length
//--------------------------------------
//--- 010 Editor v5.0.0 Binary Template
//
// File: prelen.bt
// Author: x1nixmzeng/WRS
// Revision: v1.03
// Purpose: Reading strings of known length
// History
// v1.03 Added optional STR_ENCODING macro to specify the charset
// used to format the template results
@gre
gre / easing.js
Last active October 30, 2024 16:49
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@kizzx2
kizzx2 / fun.cpp
Created January 11, 2012 14:29
Illustrative C++ Lua binding example/tutorial
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>