Skip to content

Instantly share code, notes, and snippets.

@Fighter19
Fighter19 / rsa_keygen.c
Last active January 21, 2021 15:00
Simple RSA implementation for encrypting 16-bit values
// Copyright 2021 Patrick Zacharias
// Do what you want with it, no guarantees given.
// Provided under MIT or BSD-2 license, if required by law.
#include <time.h>
#include <stdio.h>
#include <stdint.h>
#include <math.h>
// This doesn't implement real RSA, rather a simpler version with a much smaller keysize
// Only really used for very simple signings. Easily bruteforced. Do NOT use for sensitive information or similar.
@Fighter19
Fighter19 / usr.local.JediAcademy.openjkded.aarch64
Last active June 20, 2023 14:08
AppArmor rules for OpenJK / Jedi Knight: Jedi Academy on ARM64 (adjustments might be required)
# Last Modified: Fri Dec 13 20:41:06 2019
#include <tunables/global>
/usr/local/JediAcademy/openjkded.aarch64 {
#include <abstractions/base>
#include <abstractions/nameservice>
/lib/aarch64-linux-gnu/ld-*.so mr,
/usr/local/JediAcademy/base/ r,
/usr/local/JediAcademy/base/jampgameaarch64.so mr,
@Fighter19
Fighter19 / x86_print_short.s
Created October 6, 2020 15:43
Prints 16-bit register to COM1
.macro put_hex shift_by
sar $\shift_by, %ax
and $0xf, %ax
cmp $0x9, %ax
jg 1f
/* If smaller or equal to 9 add 0x30 ('1' to '9', else 0x37 (small 'a')*/
add $0x30, %ax
jmp 2f
1:
add $0x37, %ax
@Fighter19
Fighter19 / bioshello.s
Created October 6, 2020 12:27
This is a simple "Hello World" application for BIOS development.
.code16
.text
/*
This is a simple "Hello World" application for BIOS development.
This code prints the ASCII character 'A' on the serial interface at 0x3f8
Compile with:
i386-elf-as -o bioshello.o bioshello.s
i386-elf-ld -o bios-256k.elf -T ldscript.ld bioshello.o
objcopy -O binary bios-256k.elf bios-256k.bin
@Fighter19
Fighter19 / main.cpp
Created February 15, 2017 03:05
Simple SDL window
#include <SDL2/SDL.h>
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
SDL_Renderer * renderer = NULL;
int init()
{
SDL_Window* gWindow = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
@Fighter19
Fighter19 / steamcon.c
Last active October 23, 2016 04:19
Accessing the Steam Controller through libusb; Attempt of reversing the protocol.
//Do what you want with this example
//Author: Fighter19
//Comment: I used Wireshark to get most of the values
#include <sys/ioctl.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>