Skip to content

Instantly share code, notes, and snippets.

View Wunkolo's full-sized avatar
💻

Wunk Wunkolo

💻
View GitHub Profile
@Wunkolo
Wunkolo / cpu.cpp
Created August 23, 2012 04:37
Get cpu vendor ID x86
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
unsigned int idcmd = 0;
unsigned int EBX_REG=0;
unsigned int EDX_REG=0;
unsigned int ECX_REG=0;
unsigned int EAX_SIZE=0;
@Wunkolo
Wunkolo / Easing.hpp
Last active December 12, 2015 01:48
#pragma once
#include <math.h>
namespace Ease
{
//////////////////////////////////////////////////////////////////////////
//Clamping utils
template <class T>
const T& Clamped(const T& high, const T& low, const T& v)
{
@Wunkolo
Wunkolo / msparp.js
Last active December 24, 2015 03:49
Random scripts to mess around on msparp
var message = ["X","X"];
var count = 25;
var cross = 5;//Number of times to "cross" the helix
var spacemax = 60;
handle = setInterval(function(){
var string = ".".repeat(spacemax);
var strand1 = (Math.sin((i/count)*3.14*cross)*0.5+0.5)*spacemax;
string = string.substring(0,strand1) + message[0] + string.substring(strand1);
@Wunkolo
Wunkolo / FnvHash.hpp
Created October 28, 2013 18:15
Compile-time Fowler–Noll–Vo hash of strings. StringHash("Test").GetHash() will be compiled into an unsigned int hash at compile-time.
template<unsigned int N, unsigned int I>
struct FnvHash
{
inline static unsigned int Hash(const char (&str)[N])
{
return (FnvHash<N,I-1>::Hash(str) ^ str[I-1]) * 16777619u;
}
};
template<unsigned int N>
var gathers = [].slice.call(document.querySelectorAll('input[class="redbutton anybutton"]'));
var main = document.querySelector("#super-container").insertBefore(document.createElement('div'),document.querySelector("#super-container").children[5]);
main.id = "grab";
for (var i = 0; i < gathers.length; i++)
{
var posturl = "main.php?p=gather&action=" + gathers[i].value.toLowerCase();
gathers[i].parentNode = "";
$.ajax({
url: posturl,
type: 'POST',
@Wunkolo
Wunkolo / Sai2.md
Last active December 30, 2015 03:24
Sai2 notes

Binary arithmetic mask: (0x00010001) Decrypt constant:

80 00 << Size (128 bytes)
83B0BCBC D161AEAE 3A646868 416DB3B3
4887BBBB D72BCACA 89CFC2C2 5C2EBBBB
45223A3A 9C86A7A7 A9058484 C0FA0D0D
03E7BABA 96329696 50A5BDBD EFFFA2A2
EC1FF9F9 39A23D3D 16D76161 DD966565
77B4FEFE 28632F2F 742C1D1D C083BDBD
@Wunkolo
Wunkolo / CommandBankDump.py
Last active March 2, 2016 06:21
Some info from messing around with kero blaster
import struct
#used to quickly dump all the available commands from the executable
fIn = open("PinkHour.exe","rb")
fIn.seek(0xD2180)
for i in range(0,164):
magic = ''.join(struct.unpack("cccc",fIn.read(4)))
CmdNum = struct.unpack("I",fIn.read(4))[0]
argcount = struct.unpack("I",fIn.read(4))[0]
print "{0:<13} | {1:<14} | {2}".format('`'+magic+'`',argcount,CmdNum)
@Wunkolo
Wunkolo / MinBlit.hpp
Last active May 5, 2016 05:00
MinBlit
#pragma once
#include <stdint.h>
#include <initializer_list>
#include <memory>
#include <float.h>
/*
A Minimal 256 color index blitter
All images are 8-bit grayscale images
@Wunkolo
Wunkolo / Logger.cpp
Created December 23, 2012 20:23
Logger
#include "Logger.h"
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <sstream>
#include <stdarg.h>
void Logger::SetLogFile(const std::string FileName)
{
sFileName = FileName;
@Wunkolo
Wunkolo / ARDS.cpp
Last active May 15, 2016 20:37
Action Replay code snippets
// Parse Action Replay DS Code
#include <string>
#include <vector>
#define STR(x) # x
enum Button
{
A = 0xFFFE,
B = 0xFFFD,