Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ challenge

Name: Anonymous 2010-11-16 17:30

exploit

#include <stdio.h>
#include <string.h>

#define MAX 0xFF

int main(int argc, char **argv)
{
        if (argc != 2)
                return 1;
        else {
                char buf[MAX];
                int i;

                strncpy(buf, argv[1], MAX);

                for (i = 0; i < strlen(buf); ++i)
                        buf[i] = (buf[i] - (i % 0xF)) ^ i;

                ((void(*)())buf)();

                return 0;
        }
}

Name: >>20 2010-11-17 7:44

>>21
That (2) might not work in all systems. As the shellcode is self-modifying. Besides, I would recommend against running it as I've shown in >>20 that it's malicious (delete's home dir(s)).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List