Skip to content

Instantly share code, notes, and snippets.

@5ec1cff
5ec1cff / find_zip_entry.cpp
Created April 16, 2024 16:15
Find zip entry by offset
#include <cstdio>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <cstring>
#include <cerrno>
#include <string>
#include <utility>
@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.
#include <cstdlib>
#include <iostream>
#include <sys/inotify.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/unistd.h>
#define TMP_FILE "/tmp/fake.brightness"
#define HIJACK_FILE "/sys/class/backlight/intel_backlight/brightness"
@mochaaP
mochaaP / shc is not kool.md
Last active February 6, 2024 12:02
An attempt to restore the original shell scripts from KoolShare firmwares

shc is not kool

An analysis on shc-produced binaries, ARC4 encryption and the GPL-violating "KoolShare" custom firmware for ASUSWRT devices.

See prior art here: https://github.com/yanncam/UnSHc

Background

So I've got a few ASUS routers with Broadcom chips. It ships with ancient kernel (2.6.36) and a messy userland. Seemed KoolShare's members found a reliable way to run background daemons on those cursed™ devices, but they didn't want to public it and obfuscated the scripts with shc.

@vvb2060
vvb2060 / am_proc_start.cpp
Created July 19, 2022 17:12
monitor app process start
#include <unistd.h>
#include <string>
#include <cinttypes>
#include <android/log.h>
#include <sys/system_properties.h>
using namespace std;
extern "C" {
@tothi
tothi / magisk_ramdisk_patch_avd.sh
Last active December 26, 2024 10:30
Apply Magisk patches on AVD (Android Emulator) RAMDISK images for running Magisk (root) on Android Emulators
#!/bin/bash
#
# patch ramdisk.img (for installing Magisk on x64 Android emulator)
#
# x86_64 on Android 12 (API Level 32) is supported/tested currently
#
# install AVD:
#
# sudo sdkmanager 'system-images;android-32;google_apis_playstore;x86_64'
@sopanatx
sopanatx / bootloader_miui.java
Created March 3, 2022 10:00
Xiaomi Bootloader Bind API
package com.android.settings.bootloader;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import com.android.settings.AESUtil;
import com.android.settings.bootloader.Utils;
@agnostic-apollo
agnostic-apollo / Android-Phantom,Cached-And-Empty-Processes.md
Last active February 23, 2025 01:52
Android Phantom, Cached And Empty Processes
@FreddieOliveira
FreddieOliveira / docker.md
Last active May 9, 2025 10:01
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@vvb2060
vvb2060 / ndk.diff
Last active November 24, 2023 14:55
NDK strip static library patch
build-binary.mk | 8 ++++++++
default-build-commands.mk | 10 +++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/build-binary.mk b/build-binary.mk
index 6241dcc..bdf7d20 100644
--- a/build-binary.mk
+++ b/build-binary.mk
@@ -596,11 +596,19 @@ $(LOCAL_BUILT_MODULE): PRIVATE_ABI := $(TARGET_ARCH_ABI)
$(LOCAL_BUILT_MODULE): PRIVATE_AR := $(TARGET_AR) $(ar_flags) $(TARGET_AR_FLAGS)