Skip to content

Instantly share code, notes, and snippets.

using Sandbox;
using System;
using System.Text;
namespace Hammer
{
/// <summary>
/// Change the color of the wireframe box in the Hammer 2D views.
/// </summary>
[AttributeUsage( AttributeTargets.Class )]
@handsomematt
handsomematt / digitalocean-cloudflare-firewall.sh
Created May 3, 2018 19:47
Creates or updates a firewall on DigitalOcean based on CloudFlare's current list of IPs.
#!/bin/bash
FIREWALL_NAME="cloudflare"
# for new use: POST /v2/firewalls
# for update use: PUT /v2/firewalls/$FIREWALL_ID
API_URL="https://api.digitalocean.com/v2/firewalls"
API_METHOD="POST"
API_TOKEN=""
ips=`curl https://www.cloudflare.com/ips-v4`

Keybase proof

I hereby claim:

  • I am handsomematt on github.
  • I am handsomematt (https://keybase.io/handsomematt) on keybase.
  • I have a public key ASDyXHnIuQaA4X95UtAE_ngZhv2IAFkJ7npdv4VYdV8QHQo

To claim this, I am signing this object:

@handsomematt
handsomematt / dstt.md
Last active August 23, 2017 08:54
dstt notes

Cart Command

int CartCommand(char cmd, int data1, int data2)
{
  CARDCMD_0 = cmd;
  CARDCMD_1 = BYTE3(data1);
  CARDCMD_2 = (unsigned int)(data1 << 8) >> 24;
  CARDCMD_3 = (unsigned int)(data1 << 16) >> 24;
  CARDCMD_4 = data1;
@handsomematt
handsomematt / fcore.py
Last active August 20, 2017 00:54
Simple tool to split and decrypt fcore files into their respective sections
#!/usr/bin/env python
# Requires Python >= 3.2 or >= 2.7
# Simple tool to split and decrypt fcore files into their respective sections
import argparse
from struct import *
from binascii import *
permutation_key = bytearray.fromhex("00C001C104C405C506C607C70ACA0BCB0CCC0DCD08C809C902C203C30ECE0FCF10D011D114D415D516D617D71ADA1BDB1CDC1DDD18D819D912D213D31EDE1FDF4080418144844585468647874A8A4B8B4C8C4D8D48884989428243834E8E4F8F5090519154945595569657975A9A5B9B5C9C5D9D58985999529253935E9E5F9F6020612164246525662667276A2A6B2B6C2C6D2D68286929622263236E2E6F2F7030713174347535763677377A3A7B3B7C3C7D3D78387939723273337E3E7F3FA0E0A1E1A4E4A5E5A6E6A7E7AAEAABEBACECADEDA8E8A9E9A2E2A3E3AEEEAFEFB0F0B1F1B4F4B5F5B6F6B7F7BAFABBFBBCFCBDFDB8F8B9F9B2F2B3F3BEFEBFFF")
@handsomematt
handsomematt / 3ds_svc.py
Last active August 22, 2017 11:50
not that great, mainly for usage on games and not firmware
"""
//
// 3ds_svc.py
//
// This will go through each svc call and leave a comment based on it's
// service call
//
// also maps some service calls to procedures
//
"""
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <3ds.h>
#include <citro3d.h>
#include "vshader_shbin.h"
"""
//
// 3ds_svc_calls.py
//
// This will go through each svc call and leave a comment based on it's
// service call
//
"""
from idaapi import *

Keybase proof

I hereby claim:

  • I am HandsomeMatt on github.
  • I am handsomematt (https://keybase.io/handsomematt) on keybase.
  • I have a public key whose fingerprint is 2474 B173 6C4B D14E 046E CCF8 5A42 002F DEE1 9A31

To claim this, I am signing this object:

"""
//
// This will take all cross references to strings containing '.cpp', and pre-pend the name of the .cpp file
// to any IDA-recognized subs that xref that string. For example, if sub_b0aafd references a string that
// looks like '..\dev\src\game\client\main\file.cpp', this script will re-name sub_b0aafd to file.cpp_sub_b0aafd.
//
// To use:
// Run this as an idaPython script. I don't know IDA very well, so I usually just copy it, in its entirety, into the
// Python command window.
//