This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.IO; | |
using System.Linq; | |
using System.IO.Compression; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
public class MMArchiveHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int GfxFVFOffset(int fvfFlags, int a2) | |
{ | |
int result = 0; | |
if (a2 != 0x2) | |
{ | |
result += 12; | |
if (a2 != 0x10) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#include <stdexcept> | |
#include <cstdio> | |
class scoped_seh | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2018 Brick | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software | |
and associated documentation files (the "Software"), to deal in the Software without restriction, | |
including without limitation the rights to use, copy, modify, merge, publish, distribute, | |
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import json | |
if True: | |
import lzf # pip install python-lzf | |
else: | |
import ctypes | |
class lzf: | |
_lzf_dll = ctypes.CDLL('lzf.dll') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import contextlib | |
import os | |
import sys | |
def clean_binja_snapshots(conn, limit = 1): | |
with conn as cur: | |
for section in [ 'snapshot', 'file_data' ]: | |
cur.execute(f'DELETE FROM {section} WHERE id NOT IN (SELECT id FROM {section} ORDER BY id DESC LIMIT ?)', (limit,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstddef> | |
#include <cstdint> | |
#include <initializer_list> | |
#include <limits> | |
#include <type_traits> | |
constexpr std::size_t popcount(std::uint8_t value) noexcept | |
{ | |
value -= (value >> 1) & 0x55; | |
value = (value & 0x33) + ((value >> 2) & 0x33); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <limits> | |
#include <type_traits> | |
enum class int_cast_mode | |
{ | |
lossless, | |
check_sign, | |
check_max, | |
check_trip, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL.h> | |
#include <SDL_opengl.h> | |
#include <SDL_syswm.h> | |
#include <Windows.h> | |
enum class UpdateReason | |
{ | |
Main, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
bool PolyMul(uint32_t from, uint32_t to, uint32_t& out_mul) | |
{ | |
for (; ~from & 1; from >>= 1, to >>= 1) { | |
if (to & 1) | |
return false; | |
} | |
uint32_t result = 0; |
OlderNewer