Skip to content

Instantly share code, notes, and snippets.

@7etsuo
7etsuo / PagedMemoryManagementSimulator.c
Created March 6, 2024 00:21
This code simulates a Memory Management Unit (MMU) for understanding the logical-to-physical address translation in a paged memory system. It features a simulation environment that includes 4K page sizes, 15-bit logical, and 24-bit physical addresses for two processes, each with their own page table. The implementation uses bitwise operations to…
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX_PAGES_PER_PROC 8
#define MAX_PROCS 2
#define PHYSICAL_ADDRESS_MASK 0xFFFFFF
#define LOGICAL_ADDRESS_MASK 0x00007fff
#define VALID_BIT_MASK 0x80000000 /* bit 32 */
#define OFFSET_MASK 0x0FFF
@7etsuo
7etsuo / remote_exploit_template.c
Created March 4, 2024 04:49
Template for a remote exploit written in C. Disables nagles algorithm
/*
@snowcra5h
This is a template for a remote exploit.
It is a skeleton that you can use to build your own exploit.
+------------------+ <- Higher Memory Addresses
| ... |
+------------------+
| Return Address | <- Overwritten with "\x04\x03\x02\x01"