Skip to content

Instantly share code, notes, and snippets.

View Killaship's full-sized avatar

William Killaship

View GitHub Profile
@Killaship
Killaship / phrases.py
Created February 26, 2023 16:13
HTTP Codes and Phrases
httplist = []
for i in range(511):
httplist.append("Web Server Returned an Unknown Error")
httplist[100] = "Continue"
httplist[101] = "Switching Protocols"
httplist[102] = "Processing"
httplist[103] = "Early Hints"
httplist[200] = "OK"
httplist[201] = "Created"
@Killaship
Killaship / main.c
Created November 14, 2022 03:31
mac-vm
/*
Killaship
2022
November 13th, ~10:30 PM EST
This took like an hour or two to make, WITH a tutorial and previous experience!
A VM following the specifications of the 'mac' architecture, as outlined in this blog:
https://felix.engineer/blogs/virtual-machine-in-c/
I was pretty tired while writing this, so the code might suck.
Hell, I typed & instead of % twice and was wondering for minutes about it!
I started work on this at ~ 9:15, I recorded the progress.
@Killaship
Killaship / brainfuck.c
Created October 2, 2022 15:22
I have no idea why it's broken
// Copyright Killaship (C) 2022
// Informally, this is under the MIT licence, where basically you can do whatever, just give me credit.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PROG_SIZE 30000
unsigned char dcells[30000];
unsigned char program[PROG_SIZE];
int data = 0;
int instr = 0;
@Killaship
Killaship / dump.asm
Last active September 5, 2021 14:34
Dump Registers in A boot sector
; https://github.com/appusajeev/os-dev-16/blob/master/reg.asm
; This code is a slightly modified version of the above.
; This code dumps the registers in a single boot sector.
; Compile and run with the 2 following commands:
; nasm -f bin dump.asm -o dump
; qemu-system-i386 -fda dump
; You can also do it without -fda if you hate floppy disks for some reason.
@Killaship
Killaship / handlers.c
Last active August 23, 2021 21:38
err handler copy-paste
/*This is just some code to copy-paste, to make exception handler coding easier. By: me, Killaship.
Probably going to be obsolete by the time I make a function to semi-automate the IDTentry-making.*/
div0_address = (unsigned long)div0_handler;
IDT[0x00].offset_lowerbits = div0_address & 0xffff;
IDT[0x00].selector = KERNEL_CODE_SEGMENT_OFFSET;
IDT[0x00].zero = 0;
IDT[0x00].type_attr = INTERRUPT_GATE;
IDT[0x00].offset_higherbits = (div0_address & 0xffff0000) >> 16;