Skip to content

Instantly share code, notes, and snippets.

View Slaynash's full-sized avatar
🍉
Watching melons

Hugo "Slaynash" Flores Slaynash

🍉
Watching melons
View GitHub Profile
@Slaynash
Slaynash / TestConnect.java
Created October 26, 2018 14:11
[Java][MyAnimeList] Connection API workaround
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slaynash
Slaynash / CppUtils.cs
Last active December 19, 2023 23:08
SendMessageAny Hook for Unity 2018.4.23f1. Imports.Hook require MelonLoader, or a similar library supporting detour hooking.
using System;
using System.Diagnostics;
using System.Text;
public static class CppUtils
{
public static unsafe IntPtr ByReference(this IntPtr pointer) => (IntPtr)(&pointer);
public static unsafe IntPtr ByValue(this IntPtr pointer) => *(IntPtr*)(pointer);
public static unsafe string CharArrayPtrToString(this IntPtr ptr)
@Slaynash
Slaynash / CustomUnityRender.cs
Created July 3, 2020 12:14
Custom Unity render loop, drawing a magenta quad at 0,0 of 400x400px (hardcoded offsets for Unity 2018.4.23f1)
private delegate void PerformMainLoop(/* HWND__* */ IntPtr param_1, uint param_2, uint param_3, ulong param_4); // These parameters may be inaccurate
private delegate GfxDevice GetGfxDevice();
private delegate IntPtr GetIVRDevice();
private delegate void SetupPixelCorrectCoordinates(bool _0);
private static IntPtr GetFunctionPointerFromMethod(string methodName) =>
typeof(CustomUnityRender).GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Static).MethodHandle.GetFunctionPointer();
internal static void Init()
{
@Slaynash
Slaynash / QuickModeUtils.cs
Last active February 7, 2022 21:17
[VRChat] QuickMod Tab sample
public static class QuickModeUtils
{
public static (Transform tab, Transform menu) CreateNotificationTab(string name, string text, Color color, string imageDataBase64 = null)
{
List<GameObject> existingTabs = Resources.FindObjectsOfTypeAll<MonoBehaviourPublicObCoGaCoObCoObCoUnique>()[0].field_Public_ArrayOf_GameObject_0.ToList();
QuickMenu quickMenu = Resources.FindObjectsOfTypeAll<QuickMenu>()[0];
// Tab
@Slaynash
Slaynash / ImageDataDirectory.cs
Created May 12, 2021 14:02
PE (x64) Imports listing example
[StructLayout(LayoutKind.Explicit)]
internal struct ImageDataDirectory
{
[FieldOffset(0)]
public uint virtualAddress;
[FieldOffset(4)]
public uint size;
}
@Slaynash
Slaynash / Program.cs
Last active September 2, 2024 08:08
NSISBI Extractor (Unity Installer Extractor)
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
namespace UnityNSISReader
{
class Program