Skip to content

Instantly share code, notes, and snippets.

Avatar
📖
Learning new things every day!

Nicolas Hollmann NHollmann

📖
Learning new things every day!
View GitHub Profile
@NHollmann
NHollmann / dynamicCodeUnix.c
Created Apr 3, 2021
Run dynamic code on Unix (x86)
View dynamicCodeUnix.c
// Run dynamic code on Unix (x86)
// Compile with: gcc -o dynamicCodeUnix dynamicCodeUnix.c
// Tutorial: https://nicolashollmann.de/blog/run-dynamic-code-unix/
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
#include <sys/mman.h>
@NHollmann
NHollmann / dynamicCodeWin.c
Last active Apr 3, 2021
Run dynamic code on Windows (x86)
View dynamicCodeWin.c
// Run dynamic code on Windows (x86)
// Compile with: gcc -o dynamicCodeWin dynamicCodeWin.c
// Tutorial: https://nicolashollmann.de/blog/run-dynamic-code-windows/
#include <stdio.h>
#include <stdbool.h>
#include <Windows.h>
/**
* Helper function to execute dynamic code.
@NHollmann
NHollmann / bmp.c
Created Apr 1, 2021
Windows Bitmap
View bmp.c
// Windows Bitmap in C example.
// Compile with: gcc bmp.c -o bmp
// Tutorial: https://nicolashollmann.de/blog/writing-bmp-files/
#include <stdio.h>
#include <stdint.h>
#define WIDTH 300
#define HEIGHT 200
@NHollmann
NHollmann / anymap.c
Created Aug 27, 2019
Portable Anymap
View anymap.c
// Portable Pixmap in C example.
// Compile with: gcc anymap.c -o anymap
// Tutorial: https://nicolashollmann.de/blog/writing-portable-anymap/
#include <stdio.h>
#define WIDTH 300
#define HEIGHT 200
// Uncomment to write binary instead of ASCII