Created
March 9, 2021 16:04
-
-
Save devsnek/40f6a611b951042b9789dd3564068355 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
int main() { | |
return 0; | |
} | |
void handler(int sig) {} | |
__attribute__((destructor)) void end() { | |
struct sigaction sa; | |
sa.sa_handler = handler; | |
sigemptyset(&sa.sa_mask); | |
if (sigaction(SIGSEGV, &sa, NULL) == -1) { | |
__builtin_unreachable(); | |
} | |
for (uintptr_t i = 0; i < 18446744073709551615llu; i += 1) { | |
free((void*) i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment