1 /* 2 ** list.c for elfsh 3 ** 4 ** Started on Sat Jan 25 11:20:20 2003 mayhem 5 ** Last update Wed Feb 19 10:12:48 2003 mayhem 6 */ 7 #include "elfsh.h" 8 9 10 /* List all the loaded objects */ cmd_dolist()11int cmd_dolist() 12 { 13 elfshobj_t *actual; 14 int index; 15 char *time; 16 char *nl; 17 char c; 18 19 puts(" .::. Working files .::. "); 20 index = 1; 21 for (actual = world.list; actual != NULL; actual = actual->next, index++) 22 { 23 time = ctime(&actual->loadtime); 24 nl = strchr(time, '\n'); 25 if (nl) 26 *nl = 0x00; 27 c = (world.current == actual ? '*' : ' '); 28 printf(" [%03u] %s %c ID: %u %s \n", 29 index, time, c, actual->id, actual->name); 30 } 31 if (!world.list) 32 puts(" [*] No loaded file"); 33 puts(""); 34 vm_modlist(); 35 puts(""); 36 return (0); 37 } 38