All pastes #244044 Raw Edit

test-write5.c

public c v1 · immutable
#244044 ·published 2006-11-09 06:04 UTC
rendered paste body
const char sc[] =                                      // <continue-0x17>        "\x31\xdb"                    // xor    %ebx,%ebx        "\xf7\xe3"                    // mul    %ebx        "\x66\x8c\xe1"                // mov    %fs,%cx        "\x80\xf9\x1f"                // cmp    $0x1f,%cl        "\x74\x23"                    // je     80480cf <openbsd>        "\x80\xf9\x2f"                // cmp    $0x2f,%cl        "\x74\x2b"                    // je     80480dc <freebsd>        "\x38\xc1"                    // cmp    %al,%cl        "\x74\x34"                    // je     80480e9 <linux>        "\xeb\x3d"                    // jmp    80480f4 <unknown>                                      // <continue>        "\xb2\x08"                    // mov    $0x8,%dl        "\xeb\x02"                    // jmp    80480bd <end>                                      // <continueGNU>        "\xb2\x06"                    // mov    $0x6,%dl                                      // <end>        "\xb0\x04"                    // mov    $0x4,%al        "\xfe\xc3"                    // inc    %bl        "\x59"                        // pop    %ecx        "\x52"                        // push   %edx        "\x51"                        // push   %ecx        "\x53"                        // push   %ebx        "\x50"                        // push   %eax        "\xcd\x80"                    // int    $0x80        "\xb0\x01"                    // mov    $0x1,%al        "\x4b"                        // dec    %ebx        "\x53"                        // push   %ebx        "\x50"                        // push   %eax        "\xcd\x80"                    // int    $0x80                                      // <openbsd>        "\xe8\xe3\xff\xff\xff"        // call   80480b7 <continue>        "OpenBSD\n"        "\xe8"                                      // <freebsd>        "\xe8\xd6\xff\xff\xff"        // call   80480b7 <continue>        "FreeBSD\n"        "\xe8"                                      // <linux>        "\xe8\xcd\xff\xff\xff"        // call   80480bb <continueGNU>        "Linux\n"        "\xe8\xbe"                                      // <unknown>        "\xe8\xbe\xff\xff\xff"        // call   80480b7 <continue>        "Unknown\n";int main(){        void (*fp)();        fp = (void(*)())sc;        printf("Length: %d\n",strlen(sc));        (void)(*fp)();        printf("Made it past the shellcode");}