Skip to content

Instantly share code, notes, and snippets.

View Sighery's full-sized avatar

Sighery

  • Vienna
View GitHub Profile

Developing your first plugin for KOReader

So, you've been using KOReader on your phone, jailbroken Kindle, or some other device, and realized you want to have some functionality that's not built into it. You've probably looked around in the #koplugin tags on Github, and there wasn't one that met your needs. Good news: KOReader is easily extendable with Lua, you can make your own plugin somewhat easily, provided you know some Lua or are willing to learn the basics!

In this post, we'll go over what you need to set up to make your plugin, and write a basic "Hello World" plugin. For in-depth reference on KOReader's Lua components and examples of more complicated plugins, please look at the source code over at [[their github repo]]. We will briefly go over some basics of Lua here, but this is not a Lua tutorial. Please refer to the [[Lua documentation]] if you want to know more.

Setting up

Programming without in-editor hints and context-aware autocomplete isn't the best experience, so let's start by setting

  • gzipped binary file
    • 12 byte gzip "extra field" set
      • Not sure how important this is or what it contains. It doesn't appear to be related to the version of the game.
      • Subfield ID 1 (SI1) is always: C (0x43)
      • Subfield ID 2 (SI2) is always: T (0x54)
      • Data:
        • Sample 1: 0x8C 2A 00 00 07 35 01 00
          • .bkp file: 0x78 2A 00 00 C7 34 01 00
        • Sample 2: 0x44 30 00 00 CD 56 01 00
  • .bkp file: 0x40 30 00 00 CD 56 01 00
@simontime
simontime / yakuza.c
Created May 22, 2020 23:27
Encrypts & decrypts Yakuza Kiwami 2 saves (doesn't do checksum yet)
#include <stdio.h>
#include <stdlib.h>
static const char Key[] = "STarYZgr3DL11";
static const int KeyLen = 13;
int main(int argc, char **argv)
{
FILE *in, *out;
char *data;
@henfiber
henfiber / KB-Buying-guide-EU.md
Last active November 26, 2025 12:36
Buying keyboards and keyboard components from EU

Europe

  • SkinFlint : Price comparison site which has some nice filtering options per switch type etc. Searches for offers in UK, Germany, Poland and Austria
  • mykeyboard.eu : Keyboards, keycaps and accessories. Based in Belgium.
  • candykeys.com : European Store selling Vortex, Leopold, KBP, Anne Pro keyboards, keycap sets and components (ISO + ANSI). Based in Germany, ships to EU.
  • falba.tech : custom wooden bamboo cases, and some acrylic and carbon ones. Switch packs (65 browns at 48EUR). Other parts for the GH60, Atreus, ErgoDox. Also Microcontrollers, diodes, leds etc.
  • 42keebs.eu - Mostly PCBs, tools and accessories. Located in Czech Republic.
  • KEYGEM : Switches, Keycaps, lubes, cables, DIY kits and deskmats. Based in Germany, ships to the EU and worldwide.
  • [Eloquent Clicks - Custom Mechanical Keyboard Store](https://www.eloquen
@Earnestly
Earnestly / makepkg_overview.rst
Last active October 13, 2025 00:41
A brief overview of the process involved in creating a pacman package.

A Brief Tour of the Makepkg Process: What Makes a Pacman Package

Introduction

This is a terse document covering the anatomy of a package built for the pacman package manager.

The following example commands can mostly run verbatim to manually create a

@yig
yig / JavaScript reference.md
Last active April 21, 2024 23:36
An overview of JavaScript best practices. Geared towards someone with a C/C++/Java/Python background.

JavaScript reference for non-JavaScript programmers

Author: Yotam Gingold
License: Public Domain (CC0)

This document is intended as a reference or introduction to JavaScript for someone familiar with a language like C/C++/Java or Python. It follows best practices and gathers the scattered wisdom from matny stackoverflow questions and in-depth JavaScript essays. It relies on no external libraries.