Ejemplo n.º 1
0
int main(int argc, char *argv[]){
   if(argc < 2){
     printf("Usage %s <media_file>", argv[0]);
     return -1;
   }

   struct sigaction action;
   bzero(&action, sizeof(struct sigaction));

   action.sa_handler = sig_handler;
   action.sa_mask = SA_RESTART;

   sigaction(SIGSEGV, &action, NULL);
   sigaction(SIGABRT, &action, NULL);
   sigaction(SIGBUS, &action, NULL);
   sigaction(SIGFPE, &action, NULL);
   sigaction(SIGILL, &action, NULL);
   sigaction(SIGPIPE, &action, NULL);
   sigaction(SIGTRAP, &action, NULL);

   printf("Running stagefright detector!\n");

   char * media_file = argv[1];
   process_media_file(media_file);

   return 0;
}
Ejemplo n.º 2
0
/* Thread: scan */
static void
process_file(char *file, time_t mtime, off_t size, int compilation, int flags)
{
  char *ext;

  ext = strrchr(file, '.');
  if (ext)
    {
      if ((strcmp(ext, ".m3u") == 0)
#ifdef ITUNES
	  || (strcmp(ext, ".xml") == 0)
#endif
	  )
	{
	  if (flags & F_SCAN_BULK)
	    defer_playlist(file);
	  else
	    process_playlist(file);

	  return;
	}
      else if (strcmp(ext, ".remote") == 0)
	{
	  remote_pairing_read_pin(file);

	  return;
	}
    }

  /* Not any kind of special file, so let's see if it's a media file */
  process_media_file(file, mtime, size, compilation);
}
Ejemplo n.º 3
0
JNIEXPORT jint JNICALL Java_com_device_vulnerability_vulnerabilities_framework_media_Stagefright_isVulnerable__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring media_file){
    const char * current_media_file;
    current_media_file = (*env)->GetStringUTFChars( env, media_file, NULL ) ;
   return process_media_file(current_media_file);
}