Skip to content

Instantly share code, notes, and snippets.

View sylv256's full-sized avatar
🎀
sylveons

Sylv sylv256

🎀
sylveons
View GitHub Profile
@XiaoPangxie732
XiaoPangxie732 / ImplLookupGetter.java
Created August 18, 2024 12:45
Get IMPL_LOOKUP using FFI via JNI
import java.lang.foreign.*;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.lang.reflect.Field;
public class ImplLookupGetter {
public static final MethodHandles.Lookup IMPL_LOOKUP;
public static final int JNI_VERSION_21 = 0x00150000;
@burningtnt
burningtnt / TrustedLookupAccessor.java
Last active October 15, 2024 03:38
Access IMPL_LOOKUP without Unsafe
package net.burningtnt.javatest;
import java.lang.foreign.*;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
public class TrustedLookupAccessor {
public static void main(String[] args) throws Throwable {
initialize();
@oSumAtrIX
oSumAtrIX / README.md
Last active December 27, 2024 07:57
Useful snippets for Discord

Discord console scripts

My collection of scripts for Discord.

Scripts

  • friend_invitelink.js: Generate a friend invite link
  • clientside_nitro.js: Spoof the client and enable client side Discord Nitro
/// Takes a symbolic type constant and returns its size
/// Probably missing a few types but those were the most important
size_t get_sizeof_type(GLenum type)
{
switch(type)
{
case GL_BYTE:
case GL_UNSIGNED_BYTE:
return sizeof(GLbyte);
case GL_SHORT:
@Patbox
Patbox / cardboard-not-so-great.md
Last active December 22, 2024 23:16
Why you shouldn't use cardboard, banner or any other "hybrid" server

By looking that you are here you most likely use Cardboard/Banner/some other weird bukkit + Fabric project (or just someone linked to it).

Don't do it, it will cause more harm/instabilities to your server than good. But let's start at the beginning.

Few definitions before we start:

  • Bukkit - It means bukkit, spigot, paper and any forks of these,
  • Cardboard - mod by IsaiahPatton that tries to port bukkit ecosystem to fabric.
  • Banner - another mod trying to make plugins work with Fabric, similar to Cardboard.
  • Fabric - a Minecraft modding platform, includes Fabric Loader and Fabric API, everything written in this gist also applies to Quilt.
  • Mods - Mods designed for fabric and compatible platforms
// To subscribe to an event, pass this JSON text to the client through the WebSocket:
{
"body": {
"eventName": "NameOfEvent" // Replace with an event name listed below
},
"header": {
"requestId": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx", // UUID
"messagePurpose": "subscribe",
"version": 1, // Protocol version (currently 1 as-of 1.0.2)