Skip to content

Instantly share code, notes, and snippets.

@comex
Created February 5, 2022 02:43
Show Gist options
  • Select an option

  • Save comex/fcd2c329be12f656929b80c4ab15b1dd to your computer and use it in GitHub Desktop.

Select an option

Save comex/fcd2c329be12f656929b80c4ab15b1dd to your computer and use it in GitHub Desktop.
// To build: gcc -o argc0 argc0.c
// To use: ./argc0 /bin/whatever
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
int main(int argc, char **argv) {
assert(argc == 2);
execl(argv[1], NULL);
perror("execl");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment