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
#define F for(i=0;i<l;i++)
#define W;write(1,// Hire Me
main(n){int i,j,w=640,h=480,
l=w*h,o[]={-w-1,-w,-w+1,-1,1
, w-1, w, w+1}; char b[l*4];
memset(b, 128, l*3); F b[i]=
rand()W"YUV4MPEG2 W640 H480"
" F60:1 C444\n",31);for(W"F"
"RAME\n",6)W b,l*3)){F{for(n
=0,j=0;j<8;n+=b[(i+l+o[j++])
@DavidBuchanan314
DavidBuchanan314 / gol2.c
Last active December 4, 2016 13:19
gcc gol.c -Ofast && ./a.out | mpv -
#define F for(i=0;i<l*2;i++)
#define W;write(1,// David B
main(n){int i,j,w=640,h=480,
l=w*h,o[]={-w-1,-w,-w+1,-1,1
,w-1,w,w+1};char b[l*3];F b[
i]=rand()W"YUV4MPEG2 W640 H"
"480 F60:1 C444\n",31);for(W
"FRAME\n",6)W b,l*3)){F{for(
n=j=0;j<8;n+=b[(i+l+o[j++])%
l]&1);b[i+l]=(n^3&&!b[i]|n^2
#define F for(i=0;i<l*3;i++)
main(n){int i,j,w=640,h=480,l
=w*h,o[]={~w,-w,-w+1,-1,1,w-1
,w,w+1},b[l*4];F b[i]=rand();
for(puts("YUV4MPEG2 W640 H48"
"0 F30 C444");puts("FRAME");)
{F{for(n=j=0;j<8;n+=b[(i+l+o[
j++])%l]&1);b[i+l]=(n^3&&!b[i
]|n^2)-1;}F putchar(b[i]=b[i+
l]);}}// gcc c&&./a.out|mpv -

#Notes on compiling LineageOS for Sony Xperia Z2 (sirius)

Firstly, this is a great guide for the general procedure: https://harryyoud.co.uk/blog/android/2016/12/29/building-lineageos/

This is the contents of my roomservice.xml file which I eventually got to work:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="AdrianDC/proprietary_vendor_sony" path="vendor/sony" remote="github" />
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
// ==UserScript==
// @name fbhax
// @namespace davidbuchanan
// @description hax
// @include https://*.apps.fbsbx.com/*
// @version 1
// @grant none
// ==/UserScript==
var originalSetScore = FBInstant.setScore;
# This class renders an undefined subset of Markdown to HTML
class Markdown
def initialize(fileName)
@input = preprocess(File.read(fileName))
@line_count = @input.lines.count
@line_state = []
@line_flags = {
isCodeBlock: false
"""
Solution for RCTF 2017 challenge "Need a waiter"
714 points, 9 solves
"""
import codecs
rearranger = [11,15,14,13,7,9,6,3,0,1,2,10,5,12,8,4]
#!/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.
lut = open("lut2.bin", "rb").read()
sbox = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,