Skip to content

Instantly share code, notes, and snippets.

View iceBear67's full-sized avatar
🍭
:(

iceBear67

🍭
:(
View GitHub Profile
@czm23333
czm23333 / matcher.cpp
Last active January 19, 2025 15:52
POC for compile-time pattern matcher generation
#include <bitset>
#include <variant>
#include <iostream>
#include <algorithm>
#include <optional>
#include <array>
template<size_t N>
struct ct_string_literal {
constexpr ct_string_literal() = default;
@hanxiao
hanxiao / testRegex.js
Last active September 4, 2025 18:54
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@RigoLigoRLC
RigoLigoRLC / template.svg
Created April 13, 2024 07:33
红色电音极地大冲击模板 (CC BY-NC 4.0)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Unity IL2CPP Reverse Engineering

Unity games are fun.

Modding them is more fun.

Most unity games ship as "Mono". This means .NET IL code is right there for your viewing pleasure and makes for one of the easiest modding experience you can have (outside of official mod support).

Recently, many Unity games have been shipping with "IL2CPP" which optimizes out the "just in time" compilation with actual compilation. This process makes the game perform better for the player, but it also obfuscates game code meaning we have less information to work with when attempting to reverse engineer. This document describes the process of reverse engineering a Unity game built with IL2CPP despite the limitations. Keep in mind the best process for reverse engineering will change as Unity Engine evolves and the tools available change, and so this may become outdated.

@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@iceBear67
iceBear67 / youdao.max.js
Last active September 1, 2023 07:15
Youdao Translator
0. API Addr
`POST https://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule`
1. Overview of Post Arguments
Translation Input: `test amount`
Post Arguments:
```
i=test+amount
&from=AUTO // language name
@iceBear67
iceBear67 / SimpleEncryption.java
Last active October 12, 2021 15:24
self-made simple encryption based on PRNG in Java
```java
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class SimpleEncryption {
public static void main(String[] args) throws IOException {
String key="achars";
byte[] iv = "114514".getBytes(StandardCharsets.UTF_8);
@iceBear67
iceBear67 / BUkkitResetWorld.java
Created July 18, 2021 15:29
Reset minecraft world without file-copying.
package io.ib67.bukkitjni;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
@iceBear67
iceBear67 / gist:9a8ddf0b1b900ca849e88e410fce5ffe
Created February 9, 2021 15:04
Java Swing Component Collection
`Add by comment.`
@howard-haowen
howard-haowen / VectorSearch.py
Last active April 4, 2024 16:41
Text similarity search using sentence_transformers and faiss
# Reference: kstathou/acl-search-engine
# !pip install faiss-cpu --no-cache
# !pip install sentence_transformers
import faiss
import numpy as np
import pandas as pd
import pickle
import torch