Skip to content

Instantly share code, notes, and snippets.

@arget13
Last active September 29, 2023 13:09
Show Gist options
  • Save arget13/d9fb20b99c4a775ccf459151c6705050 to your computer and use it in GitHub Desktop.
Save arget13/d9fb20b99c4a775ccf459151c6705050 to your computer and use it in GitHub Desktop.
A small dumb challenge
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int _, char** argv)
{
FILE* f;
munmap((void*) ((long)argv[0] & ~0xfff), 1);
if(f = fopen("flag", "rb"))
{
fgets(argv[0], 32, f);
fclose(f);
}
pause();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment