Skip to content

Instantly share code, notes, and snippets.

View miou-gh's full-sized avatar

miou miou-gh

  • Canada
View GitHub Profile
class Color:
def __init__(self, r, g, b):
self.r = r
self.g = g
self.b = b
def to_rgb_color(argb:int, remove_alpha:bool = True) -> Color:
a = (argb >> 24) & 255
r = (argb >> 16) & 255
g = (argb >> 8) & 255
@miou-gh
miou-gh / WPEMFCSelect.au3
Last active June 14, 2017 11:57
WPE Pro MFC Selector
#include <MsgBoxConstants.au3>
#include <SendMessage.au3>
#include <GuiMenu.au3>
#include <GuiTreeView.au3>
#Include <WindowsConstants.au3>
HotKeySet("^q", "QuitApp")
MsgBox($MB_SYSTEMMODAL, "WPE Select", "Make sure only the first packet is showing by moving the hex editor view up.")
using System;
using System.IO;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace SPTReader
{
class Program
{
static void Main(string[] args)
import bson
import struct
from enum import Enum
class SPT:
def __init__(self):
pass
class Packet:
@miou-gh
miou-gh / WPEPACReader.py
Last active June 14, 2017 14:36
A WPE PAC Reader
import struct
from enum import Enum
class Packet:
def __init__(self, data, socket_id, source_addr, destination_addr, packet_size, function):
self.data = data
self.socket_id = socket_id
self.source_addr = source_addr
self.destination_addr = destination_addr
@miou-gh
miou-gh / pac2spt.py
Last active June 14, 2017 16:57
WPE PAC to SPT Converter with Filtering
import struct
import sys
import re
import argparse
class SPT_Packet:
def __init__(self, name, data):
self.name = name
self.data = data
public static (int x, int y) DiamondToStaggered(int x, int y) =>
(x: (((y - x) >> 1) * -1) * 2, y: x + y);
# place in ~/.bashrc
# replace ~/scripts/ with the directory where you placed the script
yt() {
(python /home/allie/scripts/youtube.py "$1" </dev/null &>/dev/null &)
}
############
# youtube.py
############
import sys
public static class StringExtensions
{
public static string FormatIRC(this string input)
{
return Regex.Replace(input, @"\[([^\]]*)\]\((.*?)\s*?\s*\)", (match) => {
var codes_portion = (match.Groups[1].Value).Split(' ', ',');
var color_check = new Func<string, ColorCode>((value) => Enum.TryParse(value, true, out ColorCode result) ? result : ColorCode.Invalid);
var control_check = new Func<string, ControlCode>((value) => Enum.TryParse(value, true, out ControlCode result) ? result : ControlCode.Invalid);
public static class StringExtensions
{
public static string FormatIRC(this string input)
{
return Regex.Replace(input, @"\[([^\]]*)\]\((.*?)\s*?\s*\)", (match) => {
var codes_portion = (match.Groups[1].Value).Split(' ', ',');
var color_check = new Func<string, ColorCode>((value) => Enum.TryParse(value, true, out ColorCode result) ? result : ColorCode.Invalid);
var control_check = new Func<string, ControlCode>((value) => Enum.TryParse(value, true, out ControlCode result) ? result : ControlCode.Invalid);