Skip to content

Instantly share code, notes, and snippets.

View MikuAuahDark's full-sized avatar

Miku AuahDark MikuAuahDark

View GitHub Profile
@MikuAuahDark
MikuAuahDark / timerhack.lua
Last active October 11, 2020 13:59
timeBeginPeriod inject
-- This code injects call to "timeBeginPeriod" to specified PID
-- Note that it's inadvisable to set the timer resolution
-- as it can affect battery life and your electricity bills.
-- Attribution to MikuAuahDark (me) is appreciated, but you can
-- use part or all of this code without my permission.
local ffi = require("ffi")
ffi.cdef[[
int __stdcall timeBeginPeriod(uint32_t);
void* __stdcall CreateRemoteThread(void*, void*, size_t, void*, void*, uint32_t, uint32_t*);
@MikuAuahDark
MikuAuahDark / PKGBUILD
Last active September 8, 2020 15:31
LOVE PKGBUILD for ArchLinux
# This PKGBUILD is based on community love package and AUR love-hg package.
# * love (https://www.archlinux.org/packages/community/x86_64/love)
# For the dependency list
# * love-hg (https://aur.archlinux.org/packages/love-hg)
# For the building block
pkgname=love-git
pkgver=11.3.r3665.9f62bafea2b8
pkgrel=1
pkgdesc="An open-source 2D game engine which uses the versatile Lua scripting language to create dynamic gaming experiences."
arch=('i686' 'x86_64')
@MikuAuahDark
MikuAuahDark / main.cpp
Last active September 6, 2020 12:14
Z -> Left Click in Krita + X11
// You can use part or all of this code without my permission
// $ clang++ main.cpp -lX11 -lXtst -lpthread
#include <csignal>
#include <chrono>
#include <iostream>
#include <string>
#include <thread>
@MikuAuahDark
MikuAuahDark / io_open_wide.lua
Last active August 20, 2020 01:02
LuaJIT io.open monkeypatch in Windows to load UTF-8 filenames
-- io.open patch to allow UTF-8 filenames in Windows
-- Copyright (c) 2020 Miku AuahDark
-- You can use portion of this code or as a whole without my permission.
local ffi = require("ffi")
if ffi.os ~= "Windows" then
-- Not Windows
return
end
@MikuAuahDark
MikuAuahDark / wav_reorder.lua
Created July 29, 2020 04:58
Reorder WAV chunks
-- Reorder WAV chunks files
-- This often useful if particular program expects "WAVE" identifier
-- followed by "fmt " chunk and followed by "data " chunk. Particularly
-- GTA San Andreas User Tracks.
-- You can use part or all of this code without my permissions.
local arg = {...}
local fin = assert(io.open(assert(arg[1], "need input file"), "rb"))
local fout = assert(io.open(assert(arg[2], "need output file"), "wb"))
@MikuAuahDark
MikuAuahDark / dummy.cpp
Created July 25, 2020 04:45
MinGW-w64 32-bit __thiscall test
/*
Using MSVC toolchain, compile this as follows
$ clang.exe -target i386-pc-windows-msvc -shared -o dummy.dll dummy.cpp
*/
#include <cstdio>
struct __declspec(dllexport) DummyBase
{
int someValue;
@MikuAuahDark
MikuAuahDark / timerEx.lua
Created June 19, 2020 12:55
timerEx 2020 rewrite
-- timerEx 2020 by MikuAuahDark
-- A rewrite of my 7-year-old timerEx 4.0
-- The old can be found here
-- https://www.unrealsoftware.de/files_show.php?file=13759
--[[---------------------------------------------------------------------------
-- Copyright (c) 2020 Miku AuahDark
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation
@MikuAuahDark
MikuAuahDark / mapextract.php
Last active February 20, 2020 16:08
PHP Script to extract beatmap files from osu!lazer
#!/usr/bin/env php
<?php
function showUsage(string $scriptName): void
{
echo "Usage: $scriptName <[l]ist|e[x]tract|[s]ync|[h]ash> <options>", PHP_EOL;
echo 'List usage: list', PHP_EOL;
echo 'Extract usage: extract <ID from list> <zip output>', PHP_EOL;
echo 'Sync usage: sync <osustable install>', PHP_EOL;
echo 'Hash usage: hash <ID from list>', PHP_EOL;
@MikuAuahDark
MikuAuahDark / main.c
Last active October 13, 2019 15:46
Lazy HCA2WAV using clHCA
/* HCA2WAV */
/* This is one shot tool, error handling is lazy, */
/* memory may not be freed. Any efforts fixing this */
/* is useless */
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE
#endif
@MikuAuahDark
MikuAuahDark / DecrypterBenchmark.md
Last active September 4, 2019 13:05
SIF Decrypter Benchmark

Decrypter Benchmark

Test comparison of HonokaMiku v6.0.3 vs libhonoka v2.1.0 (both are not open source program)

Executable is 32-bit, compiled with Visual Studio 2010, with /Ox /Ot /Oi optimization.
HonokaMiku also additionally compiled with /EHsc option.

CPU: Intel Core i5-7200u 2.5GHz (up to 3.1GHz) OS: Windows 10 64-bit