Пример #1
0
//lancement de l'analyse ring 0
void analysis::ring0analysis()
{
	manager=NULL;
	service=NULL;
	int error=0;
	int status = 0;

	status= driverStatus();
	
	if(status==0)
	{
		printf(" [-] Impossible to query the driver status.\n");
		return;
	}

	//si pas déjà installé, installation
	if(status == DRIVER_NOT_INSTALLED)
	{
		//installation
		if(!install_driver())
		{
			printf(" [-] Impossible to install the driver.\n");
			error=2;
		}
	}

	//si pas démarré, démarrage
	if((status == DRIVER_STOPPED || status == DRIVER_NOT_INSTALLED) && !error)
	{
		if(!start_service())
		{
			printf(" [-] Impossible to start the service.\n");
			error=1;
		}
	}
	
	//si pas d'erreurs (et service lancé, donc), analyse
	if(!error)
	{
		ssdt();
		//stop, puisque lancé
		if(!stop_service())
			printf(" [-] Impossible to stop the service.\n");
	}
	
	if(error<1)
	{
		//si installé, désinstallation
		if(!remove_driver())
			printf(" [-] Impossible to delete the driver.\n");
	}

	sCCleanHandles();
}
Пример #2
0
Файл: dev.c Проект: HarryR/sanos
static void bind_units()
{
  struct unit *unit = units;

  while (unit) {
    if (unit->dev == NULL) {
      struct binding *bind = find_binding(unit);
      if (bind) install_driver(unit, bind);
    }
    unit = unit->next;
  }
}
Пример #3
0
int device_func_init (int flags)
{
    static int initialized;
    int support_scsi = 0, support_ioctl = 0;
    int oflags = (flags & DEVICE_TYPE_SCSI) ? 0 : (1 << INQ_ROMD);

    if (initialized)
	return initialized;
    install_driver (flags);
    if (device_func[DF_IOCTL])
	have_ioctl = 1;
    else
	have_ioctl = 0;
    support_scsi = device_func[DF_SCSI]->openbus (oflags) ? 1 : 0;
    if (have_ioctl)
	support_ioctl = device_func[DF_IOCTL]->openbus (1 << INQ_ROMD) ? 1 : 0;
    initialized = 1;
    write_log ("support_scsi = %d support_ioctl = %d\n", support_scsi, support_ioctl);
    return (support_scsi ? (1 << DF_SCSI) : 0) | (support_ioctl ? (1 << DF_IOCTL) : 0);
}