Skip to content

Instantly share code, notes, and snippets.

View modeco80's full-sized avatar
🧡
awoo!

Lily modeco80

🧡
awoo!
View GitHub Profile
@modeco80
modeco80 / html.h
Last active August 30, 2019 19:58
Simple STL-only HTML entity unescaper
inline void unescape(std::string& input) {
bool in_escape_block = false;
std::string::size_type begin{}, count{};
auto iter = input.begin();
while(iter != input.end()) {
char c = *iter;
if(c == '&' && !in_escape_block && /* Please send help */ (*(iter+1) != '&' && *(iter+1) != ' ')) {
// Entered a escape block
@modeco80
modeco80 / rtver.cpp
Last active October 4, 2019 18:04
Tool to get the Playstation 2 Runtime Library version used to compile a singular or set of Playstation 2 ELF, ERX, or IRX module(s).
//
// Tool to get the Playstation 2 Runtime Library version used to compile a singular or set of Playstation 2
// ELF, ERX, or IRX module(s).
//
// (c) 2019 modeco80, in the public domain.
//
// Compile with:
// g++ -std=c++17 -O2 rtver.cpp -o rtver
@modeco80
modeco80 / discord-webpack.js
Created October 26, 2019 17:45
Some stuff to mess around with Discord webpack stuff
var modules = Object.values(webpackJsonp.push([
[],
{
['']: (_,e,r) => {
e.cache=r.c
}
},
[
['']
]
@modeco80
modeco80 / emummc-backup.sh
Created March 19, 2020 23:05
Script for easily backing up emuMMC partitions
#!/bin/bash
# written by modeco80 and BlockBuilder57
# interactive interface for inputting emuMMC partition
# used if device argument is ommited from the command line
# or if the device argument is invalid
get_partition() {
local _result=$1
# display connected disks
sudo fdisk -l
@modeco80
modeco80 / source_location.h
Created September 11, 2020 06:34
std::source_location polyfill for C++17(and C++14, but please!) compilers
// std::source_location polyfill for C++17(and C++14, but please!) compilers.
//
// This polyfill does deviate a bit from the standard, as there is no consteval,
// but besides that, it should be nearly drop in replacement from this -> C++20.
//
// License details:
// Use this however you like.
// REQUIREMENTS:
// Your compiler must have the follwing intrinsic functions:
@modeco80
modeco80 / VSMapLoader.java
Created October 14, 2020 08:51
Ghidra script to load in function symbols of Link32/Visual C++ .map files
// Ghidra script to load in symbols of Link32/Visual C++ .map files
// aiding reverse-engineering of Windows/XBOX executables with
// said map files somehow available. Maybe this could be made better?
//@author Lily
//@category Lily.Tools
import java.io.*;
import java.util.*;
import ghidra.app.script.GhidraScript;
@modeco80
modeco80 / start.bat
Last active June 24, 2021 23:26
Sample script for running Minecraft with OpenJ9 JVM.
@echo off
:: Sample script for running the Minecraft server
:: with high performance tweaks,
:: using the OpenJ9 JVM's alternative GC's and AOT compilation.
setlocal
:: == Tweak variables ==
:: Set this to the directory your server files are.
@modeco80
modeco80 / function.hpp
Created December 14, 2021 10:49
Naive C++20 std::function<R(Args...)> implementation
#include <utility>
#include <new>
namespace detail {
template<class T, class ...Args>
struct BaseInvocable {
virtual ~BaseInvocable() = default;
@modeco80
modeco80 / test.md
Created February 25, 2022 00:21
please disregard unless I linked this

ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS ASS

HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK HOLY FUCK

@modeco80
modeco80 / nm_tip.hexpat
Last active April 25, 2022 17:42
ImHex pattern for (mostly) understanding Namco Museum (PS1) .TIP (TIP0/TIP1) image data.
//
// ImHex pattern for (mostly) understanding Namco Museum
// (PS1) .TIP (TIP0/TIP1) image data.
//
// (C) 2022 modeco80 <lily.modeco80@protonmail.ch>
//
// SPDX-License-Identifier: GPL-3.0-or-later
//