Skip to content

Instantly share code, notes, and snippets.

@landaire
landaire / controller_disconnect.md
Last active November 23, 2020 22:12
Xbox 360 Dev Kit Controller Disconnect

Why controllers get disconnected, and why am I making this note?

Controllers get disconnected because they fail an authentication check that Microsoft broke at some point in time. Some people are unable to obtain newer recoveries because they simply do not have contacts or access to a GDN account, and are stuck on one of these broken recoveries

What do to fix making

Patch RgcSecAuthenticateDeviceAsyncStateMachine + 0x704 (should be a bge instruction, where if cr6 -- the result of r11 >= r10 -- then the authentication succeeds) so that this always branches to the "successful" block of code leaving the auth fail code as simply dead, unreachable code.

RgcSecAuthenticateDeviceAsyncStateMachine target

@landaire
landaire / auth.go
Created July 10, 2013 06:44
HTTP Basic Auth for Revel
package controllers
import (
"encoding/base64"
"errors"
"github.com/robfig/revel"
"net/http"
"strings"
)
@landaire
landaire / xval.rb
Created July 22, 2012 21:19
Ruby implementation of Redline99's "X" value decryption code (Xbox 360)
# xval.rb - Ruby implementation of Redline99's "X" value decryption code for the Xbox 360 by CLK
# See https://gist.github.com/2669789 for Python code
require 'optparse'
require 'openssl'
# Define our constants
FLAG_SSB_NONE = 0x0000
FLAG_SSB_AUTH_EX_FAILURE = 0x0001
FLAG_SSB_AUTH_EX_NO_TABLE = 0x0002
FLAG_SSB_AUTH_EX_RESERVED = 0x0004
#ifndef DYNAMICARRAY_H
#define DYNAMICARRAY_H
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
template<typename T>
@landaire
landaire / led_tits.ino
Last active December 22, 2015 14:48
Sample arduino code
int ledSpeed = 1, buttonVal = 0, ledState = 0;
const int buttonPin = 7, buttonPressAcknowledgedPin = 11;//, allOnPin = 11, blinkingPin = 4;
const int ledPins[] =
{
2, // red
8, // yellow
12 // blue
};
@landaire
landaire / id3.go
Last active December 19, 2015 14:58
Code for modifying songs on the fly with Revel, go-taglib, and binarydist
package controllers
import (
"bitbucket.org/kardianos/osext"
"bluefish/app/models"
"bytes"
"crypto/sha1"
"errors"
"fmt"
"github.com/kr/binarydist"
@landaire
landaire / xval.go
Created July 11, 2013 04:55
A golang implementation of Redline99's x-value decryption code
package xval
import (
"bytes"
"crypto/des"
"crypto/hmac"
"crypto/sha1"
"encoding/binary"
"encoding/hex"
"errors"
@landaire
landaire / Processbootsector.cs
Created June 17, 2013 23:03
Terrible party buffalo code
void ProcessBootSector()
{
Exception InvalidSectorsPerCluster = new Exception("FATX: found invalid sectors per cluster");
Exception InvalidBytesPerSector = new Exception("FATX: invalid bytes per cluster for growable file partition");
Exception TooSmallClusterSize = new Exception("FATX: found too small of cluster size");
Exception VolumeTooSmall = new Exception("FATX: volume too small to hold the FAT");
Exception TooManyClusters = new Exception("FATX: too many clusters");
// r31 = r3 + 0xa8
@landaire
landaire / music.rb
Last active December 16, 2015 05:38
Monitors a directory for new MP3 files and moves them to a different directory
require 'fileutils'
DOWNLOADS_PATH = '/Users/lander/Downloads'
while true
Dir.foreach(DOWNLOADS_PATH) do |entry|
next if !(entry =~ /.mp3$/i)
begin
FileUtils.mv(File.join(DOWNLOADS_PATH, entry), '/Users/lander/ext_music')
puts "Moved: #{File.join(DOWNLOADS_PATH, entry)}}"
#!/bin/sh
# Created by Lander Brandt
# This script will take all existing cloned subprojects and add them as
# proper git submodules
# To use, run this script from within the main project's root directory
set -e
for submodule in `git ls-files --stage | grep 160000 | cut -f 2`; do