//------------------------------------------------ //--- 010 Editor v12.0beta1 Script File // // File: VTContentSearch.1sc // Authors: Tobias Michalski // E-mail: Tobias.Michalski@nextron-systems.com // Version: 1.0 // Purpose: Searches the current selection in a Virus Total Content search with the default WEB-Browser. // Category: Utility // History: // 1.0 2021-10-01 Tobias Michalski: Initial version. //------------------------------------------------ int size = GetSelSize(); int readsize = size; string s = ""; string vturl; string vtend; // Try to read as normal string first s = ReadString( GetSelStart(), readsize ); // Check if size of string doesnt match selection and that String contains only URL Safe chars if(( size == 0 || readsize == Strlen(s)) && RegExMatch(s,"^[\\w_\\-\\s=:\\$\\(\\);]+$") == true ) { vturl = "https://www.virustotal.com/gui/search/content%253A\""; vtend = "\""; } // Else, just encode as hex else{ vturl ="https://www.virustotal.com/gui/search/content%253A%257B"; vtend= "%257D"; if (size == 0){ readsize = Strlen(s); } s = ""; string tmp_s; uchar tmp[readsize]; ReadBytes(tmp, GetSelStart(), readsize ); int32 i; for (i = 0; i < readsize; i++) { // Printf("%02x - %c\n", tmp[i],tmp[i]); //Debug Output SPrintf(tmp_s, "%02x", tmp[i]); s += tmp_s; } } //s = ""Test asdasd"; // Finish the URL string args = "-mwebbrowser "+ vturl + s + vtend ; // Debug Output //Printf("args: %s\n", args); //Printf("STRING: %s\n", s); // Open the link int t = Exec("python",args, false); if (t < 0){ t = Exec("python3",args, false); if (t < 0){ Printf("Couldn't open with python. You need \"python -mwebbrowser\" to open links"); } }