Beispiel #1
0
static int tracing_init(void)
{
  // Setup signal handler to stop tracing
  signal(SIGUSR1, stoptracing);

  // SIGUSR2 is used by QEMU

  // Setup signal handler to exit emulator
  signal(SIGTERM, killqemu);

  // Clear trace start condition buffers
  procname_clear(); 
  modname_clear(); 

  // No Sleuthkit for now
  // bzero(disk_info, sizeof(disk_info_t) * IF_COUNT * MAX_DISKS);
  // qemu_pread = (qemu_pread_t)DECAF_bdrv_pread;

  // Parse configuration file
  int err = check_ini(ini_main_default_filename);
  if (err) {
    monitor_printf (default_mon, "Could not find INI file: %s\n"
                 "Use the command 'load_config <filename> to provide it.\n", 
                 ini_main_default_filename);
  }

  return 0;
}
Beispiel #2
0
int match(const char * pload,int len,char ** source_path)
{
	const char* method;
  	size_t method_len;
  	const char* path;
  	size_t path_len;
  	int minor_version;
  	struct phr_header headers[HEADER_NUM];
    size_t num_headers = sizeof(headers) / sizeof(headers[0]);

    int re =phr_parse_request(pload,len, &method, &method_len, &path,&path_len, &minor_version, headers,&num_headers,0);  
    printf("~~~~%d~~~\n",re );
    if(re<=0)
    	return FALSE;

    // find_host
    int i;
    for(i=0;i<num_headers;i++)
    {
    	if (memcmp(headers[i].name,"Host",headers[i].name_len)==0)
    	{
    		int index = check_ini(headers[i].value,headers[i].value_len,path,path_len);
    		if(index!=-1)
    		{
    			*source_path = soft_array[index].source;
    			return TRUE;
    		}

    	}
    }
    return FALSE;


}
Beispiel #3
0
static int tracing_init(void) {
	int err = 0;

	procname_clear();
	// Parse configuration file
	err = check_ini(ini_main_default_filename);
	if (err) {
		DECAF_printf( "Could not find INI file: %s\n"
				"Use the command 'load_config <filename> to provide it.\n",
				ini_main_default_filename);
	}
	return 0;
}
Beispiel #4
0
void do_load_config(Monitor *mon, const QDict *qdict)
{
  int err = 0;
  const char *config_filepath = 
    qdict_get_str(qdict, "configuration_filepath");

  // Parse configuration file
  err = check_ini(config_filepath);
  if (err) {
    monitor_printf (mon, "Could not find INI file: %s\nTry again.\n", 
      config_filepath);
  }
}