Skip to content

Instantly share code, notes, and snippets.

View R077A6r1an's full-sized avatar

R077A6r1an R077A6r1an

View GitHub Profile
@R077A6r1an
R077A6r1an / Makefile
Created October 10, 2023 14:27
This snippet demonstrates, how to hack the return address, where a x86_64 CPU will continue executing after the main() function in this exsample. For understanding this snippet, you should be familiar with basic concepts of x64 assembler and the stack. #hacking #cracking
all:
gcc -o StackOverflow overflow.c -fno-stack-protector
exec: all
./StackOverflow
clean:
rm StackOverflow
.PHONY: all
@R077A6r1an
R077A6r1an / Kernel.c
Last active August 13, 2023 00:13
A tutorial for a minimal x86_32 operating system kernel #kernel #osdev #tutorial
// First, a minimal stdint.h
typedef __UINT32_TYPE__ uint32_t;
typedef __UINT64_TYPE__ uint64_t;
// NOTE: as kernel, we dont have any stdlib, so if you want to use one, implement one your self, and link it static!
// the multiboot info structure ( all we get by the multiboot bootloader )
struct multiboot_info {