Skip to content

Instantly share code, notes, and snippets.

View Applebois's full-sized avatar
🏠
Working from home

applebois Applebois

🏠
Working from home
View GitHub Profile
@Applebois
Applebois / inject.c
Created November 12, 2021 11:42 — forked from knightsc/inject.c
An example of how to inject code to call dlopen and load a dylib into a remote mach task. Tested on 10.13.6 and 10.14.3
#include <dlfcn.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <mach/mach.h>
#include <mach/error.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/sysctl.h>
#include <sys/mman.h>