💾 Archived View for thrig.me › software › assembly › slab-of-code › jump.c captured on 2024-03-21 at 16:00:52.

View Raw

More Information

-=-=-=-=-=-=-

#include <err.h>
#include <stdio.h>
#include <stdlib.h>

typedef void (*fn)(void);

#define SLABSIZE 4096

int
main(int argc, char *argv[])
{
	int value = 41;

	void *slab = malloc(SLABSIZE);
	if (!slab) err(1, "malloc");

	fn call = slab;
	call();

	printf("%d\n", value);
}