Skip to content

Instantly share code, notes, and snippets.

@shuffle2
shuffle2 / bf1.cpp
Created November 20, 2010 21:02
BITS
#include <stdio.h>
#include <string.h> // for memset
// T : type
// F : offset in bits
// S : size in bits
template <typename T, int F, int S>
class BF
{
public:
@shuffle2
shuffle2 / gist:9380130
Created March 6, 2014 01:00
dolphin-emu PR #136 test
#include <memory>
#include <cstdio>
#include <cstdint>
//"MakeUnique.h"
#include "make_unique_impl.h"
struct Base {
Base()
: a(0), b(1), c(2) {
@shuffle2
shuffle2 / example.py
Last active November 21, 2016 20:40
machine-readable powerpc ISA (32bit, espresso / nintendo)
'''
example of consuming insns.xml
'''
from xml.etree.ElementTree import ElementTree
class Instructions:
def __init__(s):
s.root = ElementTree(file = 'insns.xml')
def dump(s):
diff --git a/Source/Core/Common/Thread.h b/Source/Core/Common/Thread.h
index d108359..8e03c6a 100644
--- a/Source/Core/Common/Thread.h
+++ b/Source/Core/Common/Thread.h
@@ -24,6 +24,8 @@
#include <sys/time.h>
#endif
+#include <concrt.h>
+
@shuffle2
shuffle2 / gist:a4deca329f885d26da71
Last active August 29, 2015 14:01
GetIpForwardTable C++
#include <winsock2.h>
#include <iphlpapi.h>
#include <cstdio>
#include <memory>
#pragma comment(lib, "iphlpapi.lib")
#pragma comment(lib, "ws2_32.lib")
int main()
{
@shuffle2
shuffle2 / dbg.py
Created July 8, 2015 08:23
powersaves-amiibo-frida stuffs
'''
Input MD5 : BB4E83D7A77AADD7F62728314EF09461
File Name : C:\Program Files (x86)\Powersaves For AMIIBO\Powersaves For AMIIBO.exe
0x108fd0 : schannel_recv -> log buffer on end
0x1090d0 : schannel_recv end
0x108d10 : schannel_send -> log buffer on start
0xce61 : deals with https "Token"
0xceab : deals with https "Vuid"
@shuffle2
shuffle2 / jffs2-unfuck.py
Last active August 29, 2015 06:28
easily dump files from jffs2 without jumping through the mtd hoops
from construct import *
import zlib
from array import array
import struct
import binascii
import os
import sys
u8 = UBInt8
u16 = UBInt16
u32 = UBInt32
@shuffle2
shuffle2 / digiview-quad-spi.cpp
Created January 4, 2016 17:40
Simple decoding for flash using QREAD
// This plugin is aware of Macronix-specific sflash behavior, such that it may
// fully decode bus transactions.
// latches input on SCLK rising edge, shifts data out on falling edge of SCLK
// CS active low
// supports 4 byte addresses
// supports up to 4-wire parallel IO
#include "../Cmdparser.cpp"
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdint>
#include <memory>
#include <map>
#include <list>
#include <vector>
#include <set>
#include <algorithm>
#include "crypto.h"
@shuffle2
shuffle2 / ios_so_getaddrinfo.c
Last active June 1, 2017 05:54
IOS59 SO getaddrinfo
/*
00000000
00000000 iov struc ; (sizeof=0x8, mappedto_25)
00000000 ptr DCD ?
00000004 len DCD ?
00000008 iov ends
00000008
00000000 ; ---------------------------------------------------------------------------
00000000
00000000 so_hints struc ; (sizeof=0x20, mappedto_27)