Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <signal.h>
- #include <string.h>
- char * eax= 0;
- void term_handler(int i);
- int test();
- int main(int argc, char const *argv[])
- {
- struct sigaction sa;
- sigset_t newset;
- sigemptyset(&newset);
- sigaddset(&newset, SIGHUP);
- sigprocmask(SIG_BLOCK, &newset, 0);
- sa.sa_handler = term_handler;
- sigaction(SIGSEGV, &sa, 0);
- sigaction(SIGBUS, &sa, 0);
- test();
- return 0;
- }
- void term_handler(int i)
- {
- eax++;
- test();
- }
- int test(){
- int iteration = 0;
- char string[] = "#include";
- int size = strlen((const char *)string);
- while(1){
- if(*eax = string[iteration]){
- iteration++;
- eax++;
- } else {
- iteration = 0;
- }
- if(iteration == size)
- printf("%s", (char *)eax);
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement