Skip to content

Instantly share code, notes, and snippets.

@Kethen
Kethen / param_sfo_dumper.c
Last active November 15, 2023 10:01
sony psp param.sfo dumper
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#define CONV_LE(addr, dest) { \
dest = addr[0] | addr[1] << 8 | addr[2] << 16 | addr[3] << 24; \
}
@Kethen
Kethen / save_param_dumper.c
Last active November 15, 2023 10:00
read out known non pointer psp save utility params
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdint.h>
struct pspUtilityDialogCommon
{
@Kethen
Kethen / hidl_perf_boost.py
Created March 28, 2023 12:36
prototype gbinder-python hidl booster
#!/usr/bin/python3
import dbus
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
import subprocess
import gbinder
import time
from threading import Thread
match_string = "type='signal',member='Changed',interface='org.gtk.Actions',path='/org/ayatana/indicator/power'"
@Kethen
Kethen / symbol_prober.sh
Created July 5, 2022 20:25
symbol prober
# probes for suitable libraries for certain symbols in an elf
# for inspecting android propietary elf blobs
target=$1
library_path=$2
readelf -W -s "$target" | grep 0000000000000000 | awk '{print $8}' | while read -r LINE
do
if [ -n "$LINE" ]
then
@Kethen
Kethen / log_to_data
Last active May 31, 2022 09:10
some init.rc debug init.rc stuffs
#!/system/bin/sh
/system/bin/logcat 1> /data/logcat_out &
/system/bin/cat /dev/kmsg 1> /data/dmesg &
@Kethen
Kethen / readme.md
Last active November 1, 2024 19:53
So steam deck recovery image dropped, let's boot it (sorta) (non amd hardware)

Booting the Steam Deck recovery image

https://help.steampowered.com/en/faqs/view/1B71-EDF2-EB6D-2BB3

SteamOS runs a custom grub to cater it's needs for it's A/B partition design. So far the said custom grub does not boot for me on ovmf/intel uefi (maybe it boots on amd? some said they managed to just rufus the image and boot it)

skip to https://gist.github.com/Kethen/698cfa8cf387e131ebd36fbfbfe9272e#gamescope-and-non-amd-gpu if it just boots for you

Upon closer inspection the official bootloader does load some kind of amd firmware before booting the kernel

@Kethen
Kethen / convert.py
Last active February 2, 2022 21:29
python script for merging themes.xml and colors.xml
from xml.etree.ElementTree import parse, indent
import re
import sys
colors = parse("material-theme/values/colors.xml")
day = parse("material-theme/values/themes.xml")
night = parse("material-theme/values-night/themes.xml")
def get_color(tree, colorString):
colorName = re.compile("@color/(.+)").match(colorString).group(1)
for color in tree.getroot().findall("color"):
@Kethen
Kethen / gist:eeeecfb1887f7efddc02849fb046e638
Created June 13, 2021 08:43
remove country restriction on call recording, only use this when it's legal to call record
# patch Dialer to remove call record country restriction
(
cd packages/apps/Dialer
git checkout .
)
OLD_IFS=$IFS
IFS=$'\n'
echo patching call recorder to ignore country restrictions, please refer to your country\'s law and use at your own risk
echo > /tmp/CallRecorder.java
cat packages/apps/Dialer/java/com/android/incallui/call/CallRecorder.java | while read -r LINE
@Kethen
Kethen / gist:12f5bcd43b7d1a726fa51012404ab95e
Last active May 26, 2021 15:39
Android module for disabling.. modules?
# found on http://qiushao.net/2019/12/12/Android%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91%E5%85%A5%E9%97%A8/6-%E5%88%A0%E9%99%A4%E5%8E%9F%E7%94%9F%E5%86%85%E7%BD%AEAPK/
# creating a fake module that does nothing but overrides modules that are unwanted, a snipplet for docker-lineage-cicd build.sh
if ! [ -z "$REMOVE_PACKAGES" ]; then
mkdir -p vendor/remove_unused_module
echo '
include $(CLEAR_VARS)
LOCAL_MODULE := remove_unused_module
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := FAKE