Skip to content

Instantly share code, notes, and snippets.

View MikuAuahDark's full-sized avatar

Miku AuahDark MikuAuahDark

View GitHub Profile
@MikuAuahDark
MikuAuahDark / cp2seq.lua
Last active December 27, 2022 03:58
[Lua] Unicode code point to UTF-8 sequence
---@param code integer
function cp2seq(code)
if code <= 0x7F then
-- 0xxxxxxx
return string.char(code)
elseif code <= 0x7FF then
-- 110xxxxx 10xxxxxx
return string.char(
0xC0 + math.floor(code / 0x40),
0x80 + code % 0x40)
@MikuAuahDark
MikuAuahDark / generate_center_description.php
Created September 24, 2015 11:47
[Php] Effect string from Leader Skill string
<?php
$ur_skill_reversemap=[
"Princess" => "Smile",
"Angel" => "Pure",
"Empress" => "Cool"
];
// It expects English center skill.
function generate_center_description($str) {
global $ur_skill_reversemap;
@MikuAuahDark
MikuAuahDark / SaveCard.ps1
Last active September 27, 2015 14:52
SaveCard
# CardInstall.ps1
<#
Script to add all cards to database as .card files.
The specification of the .card file can be found here:
(some_link)
#>
# Enumeration definition
$rarityEnum=@{N=0;R=1;SR=2;UR=3}
$attributeEnum=@{Smile=0;Pure=1;Cool=2;All=3}
@MikuAuahDark
MikuAuahDark / HonokaMiku.cpp
Last active July 20, 2019 13:14
SIF Decryption (prototype). The fully working project is in https://github.com/MikuAuahDark/HonokaMiku
// HonokaMiku.cpp
// Loads SIF libGame.so and execute it's decrypt function
// 10/15/2015: JP is now supported. Requires SIF JP v2.0.5 x86 libGame.so
#if !defined(_M_IX86) && !defined(__i386__)
#error "Only x86 targets are supported!"
#endif
#include <cstdlib>
@MikuAuahDark
MikuAuahDark / png_crop.cpp
Created October 17, 2015 14:02
Crop PNG from 0x0 to specificed pixel
#include <iostream>
#include <string>
#include <cstdarg>
#include <png.h>
using namespace std;
// Prints message in stderr and exit program in release build.
// In debug build, it trigger debug breakpoint instead.
void failexit(const char* file,const char* msg) {
@MikuAuahDark
MikuAuahDark / Makefile
Created March 12, 2016 13:37
Makefile-compatible Lua script/Lua-compatible Makefile/Lua script in Makefile
__unused = #string -- This is a Makefile which is also executable by Lua
__unused = #string --[[
#Your Makefile script starts here
default:
@echo "Hello!"
#Your Makefile script ends here
ifeq (0,1)
__unused = #string ]]--
-- Your lua script starts here
@MikuAuahDark
MikuAuahDark / stringstream.lua
Last active November 5, 2021 06:48
Lua 5.1 stringstream (pure)
local stringstream = {}
stringstream.__index = stringstream
function stringstream.create(str)
local out = setmetatable({}, stringstream)
out.buffer = str or ""
out.pos = 0
out.__index = stringstream
return out
@MikuAuahDark
MikuAuahDark / flsh_dumper.lua
Created October 3, 2016 11:38
Playground Flash file dumper
-- Playground FLSH asset dumper.
-- It does not allow you to make new FLSH file!!!
local arg = {...}
local target_input = arg[1]
if target_input == nil then
print("Usage: lua flsh_dumper.lua <flsh path>")
print("It does not allow you to make new FLSH file!!!")
return 1
@MikuAuahDark
MikuAuahDark / test_asteria.cpp
Created October 30, 2016 09:16
Asteria Decrypter (requires HonokaMiku v4.0.2)
#include <cassert>
#include <cstdlib>
#include <cstdio>
#include <exception>
#include <stdexcept>
#include "HonokaMiku-4.0.2/DecrypterContext.h"
using namespace HonokaMiku;
class asteria_decrypter: public V2_Dctx
@MikuAuahDark
MikuAuahDark / showpl2.txt
Created November 19, 2016 08:45
GTASA Show Playing CLEO Script by Pressing F7
// Show current playing user tracks when F7 is pressed
// Miku AuahDark <[email protected]>
{$CLEO .cs3}
{$VERSION 3.1.0027}
{
Reserved Variables:
0@ = LoadLibrary("msvcrt")
1@ = GetProcAddress(0@,"calloc")