Skip to content

Instantly share code, notes, and snippets.

Avatar

Duy Tran Khanh khanhduytran0

View GitHub Profile
@khanhduytran0
khanhduytran0 / PojavOF117AssetsPatcher.java
Last active Sep 19, 2021
OptiFine 1.17.x assets patcher for PojavLauncher.
View PojavOF117AssetsPatcher.java
/*
* These following steps are not currently automated, so you need to do manually for now.
* download assets-v0.zip at https://cdn.discordapp.com/attachments/724164160761626624/860864619350065162/assets-v0.zip
* extract and copy the shaders folder to the resources folder.
* edit include/light.glsl add `#define texture texture2D` after `#version 100` line
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
@khanhduytran0
khanhduytran0 / dlopen.cpp
Created Aug 23, 2020
Example of dlopening greylisted libraries or dlopening libraries with custom LD_LIBRARY_PATH. Android 5.0+
View dlopen.cpp
#include <dlfcn.h>
#include <cstring>
#include <android/dlext.h>
#include "log.h" // LOGE, LOGW, etc...
bool (*_android_init_namespaces)(const char* public_ns_sonames, const char* anon_ns_library_path) = nullptr;
bool __unused android_init_namespaces(const char* public_ns_sonames, const char* anon_ns_library_path) {
if (!_android_init_namespaces) {
void *libdl_handle;
@khanhduytran0
khanhduytran0 / GLSCommandFinder.java
Created Jun 22, 2020
gl-streaming command finder from command index
View GLSCommandFinder.java
import java.util.*;
import java.io.*;
public class GLSCommandFinder
{
private static final String glsCmdHeaderPath = "/sdcard/AppProjects/gl-streaming/common/gls_command.h";
private static List<Integer> cmdlineList;
private static List<String> commandList;
public static void main(String[] args)
{