Skip to content

Instantly share code, notes, and snippets.

View Jacajack's full-sized avatar
🦄

Jacek Wieczorek Jacajack

🦄
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / fontthief.asm
Created July 22, 2017 01:21
Display all characters from BIOS font
[org 0x7c00]
[bits 16]
;Stack setup
mov bp, 0xfffe
mov sp, bp
;Switch into mode 13h
mov ah, 0x00
mov al, 0x13
@Jacajack
Jacajack / fload1.c
Created October 2, 2017 19:31
File queuing service (rev. 1)
#include <stdio.h>
#include <stdlib.h>
#include "fload.h"
#define MAX_FILE_COUNT 256
static FILE *files[MAX_FILE_COUNT] = {0};
static int fcount = 0;
//Queues specific file for loading
@Jacajack
Jacajack / namegen.c
Created October 8, 2017 12:06
Random name generator
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <ctype.h>
const char *vowels = "euioay";
const char *consonants = "wrtpsdfghjklzxcvbnm";
int main( int argc, char **argv )