Skip to content

Instantly share code, notes, and snippets.

View DavidBuchanan314's full-sized avatar
🌍
Hack the planet!

David Buchanan DavidBuchanan314

🌍
Hack the planet!
View GitHub Profile
@justecorruptio
justecorruptio / gif.py
Created June 8, 2017 09:44
gif encoder inspired by /DavidBuchanan314/gif-enc
from struct import pack
from random import sample
dist = lambda a, b: (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 + (a[2] - b[2]) ** 2
nn = lambda rgb, centers: min((dist(rgb, c), i) for i, c in enumerate(centers))[1]
class GIF(object):
def __init__(self, data, size):
self.size = size
self.data = data
sc.killAutoHandle();
sc.getService("ns:am2", (hndle) => {
utils.log("got handle 0x" + hndle.toString(16));
// GetApplicationManagerInterface
var res = sc.ipcMsg(7996).data(0).sendTo(hndle).assertOk();
sc.withHandle(res.movedHandles[0], (amih) => {
utils.log("got handle 0x" + amih.toString(16));
// launch
#!/usr/bin/python3
"""
IMPORTANT - READ BEFORE CONTINUING:
1. This tool is only intended to repair machines that have been infected and never turned back on again. i.e. NO ENCRYPTION HAS HAPPENED YET
2. You should make a full disk backup before continuing. I am not responsible if this makes things worse.
3. This tool does not repair part of NTLDR which is corrupted by the malware (The second sector of the NTFS partition), you will need a secondary tool to do this.
@tott
tott / read-backlight.py
Created November 22, 2018 11:41
Read backlight for x230 / x330 taobao FHD mod
#!/usr/bin/env python
import sys
import array
import usb.core
import usb.util
import os
path = "/tmp/backlight-value"
# decimal vendor and product values
@justgerd
justgerd / 1_switchmemes.md
Last active September 25, 2019 15:26
ReSwitched #offtopic pins.

Accuracy of CTU simulating the Switch

Accuracy meme

Confused people

Switch to Linux distros

Accuracy of Mephisto emulating the Switch

Accuracy meme 2

Windows Update vs Switch Hacking

@kgsws
kgsws / sdbhax.js
Last active January 22, 2020 19:41
sc.killAutoHandle();
function c32to8(data)
{
var len = data.length;
var ret = new Uint8Array(len * 4);
var offs = 0;
for(i = 0; i < len; i++)
{
@nicolas17
nicolas17 / boostpp_math.c
Created November 4, 2020 18:05
Cursed boost.pp math
// SPDX-FileCopyrightText: 2020 Nicolás Alvarez <nicolas.alvarez@gmail.com>
//
// SPDX-License-Identifier: MIT
#include <boost/preprocessor.hpp>
// Utilities to convert from numbers (bytes) or words (highbyte,lowbyte pairs)
// into nibbles.
// a -> (a1,a0)
@rflaperuta
rflaperuta / user_agent_listing.txt
Created February 12, 2017 22:20
List of user Agents - 2017
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0.2 Safari/602.3.12
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Mozilla/5.0 (Windows NT 6.1; WOW64;
@angavrilov
angavrilov / gist:926972
Created April 19, 2011 07:45
mmap injection on linux (emulation of VirtualAllocEx)
/* Support for executing system calls in the context of the game process. */
static const int injection_size = 4;
static const char nop_code_bytes[injection_size] = {
/* This is the byte pattern used to pad function
addresses to multiples of 16 bytes. It consists
of RET and a sequence of NOPs. The NOPs are not
supposed to be used, so they can be overwritten. */
0xC3, 0x90, 0x90, 0x90
@DavidLudwig
DavidLudwig / sdl2gles2gears.c
Last active November 15, 2022 09:45
GLGears for SDL2 + OpenGL ES 2
/*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* 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:
*