Skip to content

Instantly share code, notes, and snippets.

@19h
Created February 6, 2014 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 19h/8845427 to your computer and use it in GitHub Desktop.
Save 19h/8845427 to your computer and use it in GitHub Desktop.
0x787061 — apx — Signal test.
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
static void _(int signo) {
long __ = 0x0;
__ += 45; __ <<= 1;
__ *= ((0x8D << 1) * 0x137) - 1;
__ -= 0x2 >> 1;
for (int i = 0; i < 3; ++i) {
char c = (__ >> (i * 8)) & 0xFF;
write(1, &c, 1);
}
raise(SIGINT);
}
int main(void) {
if (signal(SIGINT, _) == SIG_ERR)
return EXIT_FAILURE;
if (raise(SIGINT) != 0)
return EXIT_FAILURE;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment