Skip to content

Instantly share code, notes, and snippets.

View Jacajack's full-sized avatar
🦄

Jacek Wieczorek Jacajack

🦄
View GitHub Profile
@Jacajack
Jacajack / vgack.asm
Last active July 22, 2017 00:55
qemu - Weird text behavior in mode 13h
[org 0x7c00]
[bits 16]
;Stack setup
mov bp, 0xfffe
mov sp, bp
;Switch into mode 13h
mov ah, 0x00
mov al, 0x13
@Jacajack
Jacajack / intthief.asm
Last active September 23, 2022 19:14
Example of overriding BIOS interrupts in i386 assembly.
[org 0x7c00]
[bits 16]
[map all thief.map]
;Stack init
mov bp, 0xffff
mov sp, bp
;Display initial interrupt address
mov bx, [intnum*4+2]
@Jacajack
Jacajack / romsearch.c
Last active June 18, 2017 16:39
Development version of DS18B20 ROM search algorithm
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define ROMCNT 20
unsigned char roms[ROMCNT] = {0};
unsigned char active[ROMCNT] = {1, 1, 1, 1};
int bitcnt = 0;
char getbit( )
@Jacajack
Jacajack / nodemaze.c
Last active June 16, 2017 18:25
Fast maze generator
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#define VERSION "v0.5"
typedef struct
{
int x, y;
@Jacajack
Jacajack / msolve2.c
Created June 16, 2017 12:34
Messy and experimental ASCII maze solver
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
typedef struct
{
int x, y;
void *parent;
char c;
@Jacajack
Jacajack / makefile
Last active June 14, 2017 00:20
A demonstration of how plagues spread
all:
gcc -o plague plague.c -lSDL -lpthread -lm -Wall
@Jacajack
Jacajack / modhelp.c
Last active March 24, 2017 19:48
To make manual building of Modbus frames easier...
#include <stdio.h>
#include <signal.h>
#include <inttypes.h>
#include <string.h>
#include <lightmodbus/master.h>
#include <pthread.h>
ModbusMaster master;
pthread_t pt;
@Jacajack
Jacajack / ppmtovga.py
Created January 16, 2017 00:44
PPM to raw VGA (or whatever, 320x200) data in assembly format. Never tested
#!/usr/bin/python
width = 320
height = 200
with open( "splash.ppm", "r" ) as fin:
ppm = fin.read( ).splitlines( True )
#print( ppm[4] );
@Jacajack
Jacajack / cipher.c
Created January 16, 2017 00:41
Super simple LFSR cipher in C
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
uint64_t sr;
uint8_t shift( )
{
//Taps at 64, 63, 61, 60
uint8_t shiftin = 0;
@Jacajack
Jacajack / combat.js
Created January 12, 2017 20:26
Simple, old combat simulator
function Buffs( )
{
this.Bleeding = 0;
this.Death = false;
this.Blinded = false;
this.Suffocating = 0;
this.Fallen = false;
this.Pain = 0;
}