ftp.nice.ch/peanuts/GeneralData/Documents/faq/NeXTFAQ-html/NeXTFAQ.d.tar.gz#/NeXT-FAQ/examples/loginwindow_patch.c

This is loginwindow_patch.c in view mode; [Download] [Up]

/*
 * Patches the loginwindow.app to eradicate the restart and power
 * buttons from the login window.
 *
 * Christopher J. Kane (kane@cs.purdue.edu)
 * Released into public domain; August 13, 1993.
 */
	
#include <libc.h>
#include <errno.h>
	
void main(int argc, char *argv[])
{
  unsigned char patch[8] = {0x0, 0x0, 0x42, 0x80, 0x4e, 0x5e, 0x4e,
  0x75};
  int file = open("/usr/lib/NextStep/loginwindow.app/loginwindow", 
O_WRONLY);
  if (-1==file)
    goto error;
  if (-1==lseek(file, 21170, SEEK_SET))
    goto error;
  if (-1==write(file, patch, 8))
    goto error;
  if (-1==close(file))
    goto error;
  exit(0);

error:
  fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
  exit(1);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.