Skip to content

Instantly share code, notes, and snippets.

View mochaaP's full-sized avatar
🦜
I don't use Arch btw.

Zephyr Lykos mochaaP

🦜
I don't use Arch btw.
View GitHub Profile
@mochaaP
mochaaP / dup2_patch.hexpat
Last active May 16, 2024 20:00
simple imhex pattern for diablo2oo2's universal patcher's rsrc
#include <std/io.pat>
namespace dup2 {
u32 offset @ 0x16;
u32 count @ 0x1E;
fn read_pat(auto pat) {
str hex_pat = "";
for (auto i = 0, i < pat.size, i = i + 1) {
if (!pat.Mask[i])
@mochaaP
mochaaP / 0001-Revert-cv1k-remove-Akai-Katana-and-Dodonpachi-Saidai.patch
Created April 18, 2024 14:59
Revert cv1k: remove Akai Katana and Dodonpachi Saidaioujou
diff --git a/src/mame/cave/cv1k.cpp b/src/mame/cave/cv1k.cpp
index 503b199a060..8a23cfbeb80 100644
--- a/src/mame/cave/cv1k.cpp
+++ b/src/mame/cave/cv1k.cpp
@@ -182,10 +182,6 @@ Remaining Video issues
Timing
- Correct CPU slowdown emulation and flags (and speed of RAM). Most slowdown seems due to SH-3 uncached RAM access wait states, which is not implemented.
-31/12/2021:
- Akai Katana and Dodonpachi Saidaioujou removed at the request of the
@mochaaP
mochaaP / day01.hs
Created December 3, 2023 09:41
advent of code 2023 done wrong
module AoC2023.Day01 where
import Data.Char (isDigit)
main :: IO ()
main = do
res <- readFile "input/1.txt"
let i = lines res
-- part one
print
@mochaaP
mochaaP / uniE0B0_PowerlineSymbols.svg
Last active July 5, 2023 12:20
Powerline glyphs exported from the original font, path only
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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.

@mochaaP
mochaaP / getent
Created May 22, 2023 08:37
getent.sh: The world's cheesiest getent implementation
#!/bin/sh
# Copyright 2009 Rob Landley <rob at landley.net>, licensed under GPLv2.
isnum()
{
[ ! -z "$(echo $1 | grep '^[0-9]*$')" ]
}
nocomments()
%global commit0 a3b934e7b2d13ecf05ff4521459ad2202a3a477b
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global selinuxtype targeted
%global modulename tailscaled
Name: tailscale-selinux
Version: 0.0.0
Release: 4%{?dist}
Summary: Tailscale SELinux policy
@mochaaP
mochaaP / types.d.lua
Last active August 3, 2023 15:29
Devilspie2's lua type annotation
---@meta devilspie2
-- SPDX-License-Identifier: 0BSD
-- If index = 0 then the ‘current’ monitor (with the window's centre point)
-- is used (falling back on then the first monitor showing part of the
-- window then the first monitor).
--
-- If index = -1 then all monitors are treated as one large virtual monitor.
--
@mochaaP
mochaaP / ktk3_savefile.md
Created April 15, 2023 11:49
IWKTK3 savefile verification analysis

KTK3 savefile analysis

It's a bit frustrating when I Wanna Kill The Kamilia 3 (IWKTK3) savefile have some sort of machine-binding mechanism in place and I can't find any information about it. So here you go.

Fields

All the following fields are random numbers generated on first launch.

registry_set_root(0);
@mochaaP
mochaaP / Dockerfile
Created April 1, 2023 17:30
anisette server
FROM dadoum/anisette-server:latest AS app
FROM debian:unstable-slim AS base
ENV DEBIAN_INTERFACE=noninteractive
RUN apt-get update && apt-get install -y libcurl4
FROM base AS builder
WORKDIR /app