Skip to content

Commit 89ddddb

Browse files
committed
Restructure the API + several bug-fixes.
- Removes a number of problematic variables and mechanisms, replacing them with more efficient, logical, well-structured alternatives (this includes the removal of 'WhyFlagged', making #1 now irrelevant/fixed). - The code for scanning zip files was treating directories as files, which wasn't affecting the overall results or performance of the scan process, but was adding some small amount of pointless and unwanted overhead to it; Fixed. - Removed some superfluous/distractng details from CLI (FN/FD) and improved the aesthetic of its indents. - Procedurises a number of methods, including recursor, archiveRecursor, dataHandler, and metaDataScan, to simplify the way that results from these are handled, with reduced emphasis on return values, increased emphasis object data and the instance cache. - Plus a large amount of general refactoring and overall improvement to the quality of the codebase. - Some methods which shouldn't generally be called by the implementation have been made private, and modified accordingly. - A number of useless/redundant parameters have been removed. - The API for scan(); has been modified, and now accepts just two parameters only: The scan target, and an integer, indicating the desired format of the scan results to be returned.
1 parent f3902ed commit 89ddddb

29 files changed

+849
-1154
lines changed

l10n/ar.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Arabic language data (last modified: 2020.07.05).
10+
# This file: Arabic language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "API خطأ طلب"
2121
SafeBrowseLookup_401: "API خطأ ترخيص"
2222
SafeBrowseLookup_503: "API الخدمة غير متوفرة"
2323
SafeBrowseLookup_999: "خطأ API غير معروف"
24-
_exclamation: "%s! "
25-
_exclamation_final: "%s!"
26-
_fullstop: ". "
27-
_fullstop_final: "."
2824
corrupted: "الكشف PE تلف"
2925
data_not_available: "البيانات غير متوفرة."
3026
detected: "الكشف %s"
@@ -42,6 +38,10 @@ filesize_limit_exceeded: "تجاوز حد حجم ملف"
4238
filetype_blacklisted: "نوع الملف في القائمة السوداء"
4339
finished: "انتهى"
4440
generated_by: "الناتج"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "%s!"
43+
grammar_fullstop: "%s."
44+
grammar_spacer: " "
4545
image: "صورة"
4646
invalid_data: "بيانات غير صالحة!"
4747
invalid_file: "ملف غير صالح"
@@ -52,14 +52,13 @@ only_allow_images: "يسمح بملفات الصور فقط"
5252
quarantined_as: "الحجر الصحي بأنه "%s.qfu"."
5353
recursive: "تجاوزت الحد عمق العودية"
5454
scan_chameleon: "الكشف هجوم الحرباء %s"
55-
scan_checking: "فحص"
55+
scan_checking: "فحص "%s"."
5656
scan_command_injection: "الكشف محاولة حقن القيادة"
5757
scan_complete: "تم الانتهاء من"
5858
scan_extensions_missing: "فشل (مفقود ملحقات المطلوبة)!"
5959
scan_filename_manipulation_detected: "الكشف تلاعب اسم الملف"
6060
scan_missing_filename: "مفقود اسم الملف"
6161
scan_no_problems_found: "الكشف لا مشاكل."
62-
scan_not_archive: "فشل (فارغة أو ليس أرشيفا)!"
6362
scan_reading: "قراءة"
6463
scan_signature_file_missing: "مفقود ملف التوقيع"
6564
scan_tampering: "الكشف العبث ملف يحتمل أن تكون خطرة"

l10n/bn.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Bangla language data (last modified: 2020.07.05).
10+
# This file: Bangla language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "API অনুরোধ ত্রুটি"
2121
SafeBrowseLookup_401: "API অনুমোদন ত্রুটি"
2222
SafeBrowseLookup_503: "API পরিষেবা অনুপলব্ধ"
2323
SafeBrowseLookup_999: "অজানা API ত্রুটি"
24-
_exclamation: "%s! "
25-
_exclamation_final: "%s!"
26-
_fullstop: ""
27-
_fullstop_final: ""
2824
corrupted: "দুর্নীতিগ্রস্ত PE সনাক্ত হয়েছে"
2925
data_not_available: "ডেটা উপলব্ধ নেই।"
3026
detected: "%s সনাক্ত হয়েছে"
@@ -42,6 +38,10 @@ filesize_limit_exceeded: "ফাইলের আকার সীমা অতি
4238
filetype_blacklisted: "ফাইলের ধরন কালো তালিকাতে রয়েছে।"
4339
finished: "শেষ হয়েছে"
4440
generated_by: "জেনারেটর:"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "%s!"
43+
grammar_fullstop: "%s।"
44+
grammar_spacer: " "
4545
image: "চিত্র"
4646
invalid_data: "অবৈধ তথ্য!"
4747
invalid_file: "অবৈধ ফাইল"
@@ -52,14 +52,13 @@ only_allow_images: "কেবলমাত্র ইমেজ ফাইলগু
5252
quarantined_as: "সংগ্রাহক মধ্যে "%s.qfu" হিসাবে।"
5353
recursive: "পুনরাবৃত্তি গভীরতা সীমা অতিক্রম করেছে"
5454
scan_chameleon: "%s বহুরুপী(chameleon) আক্রমণ সনাক্ত হয়েছে।"
55-
scan_checking: "পরীক্ষা করা হচ্ছে"
55+
scan_checking: ""%s" পরীক্ষা করা হচ্ছে"
5656
scan_command_injection: "কমান্ড ইনজেকশন প্রচেষ্টা সনাক্ত হয়েছে"
5757
scan_complete: "সম্পূর্ণ"
5858
scan_extensions_missing: "ব্যর্থ (অনুপস্থিত প্রয়োজনীয় এক্সটেনশনগুলি)!"
5959
scan_filename_manipulation_detected: "ফাইলনেম ম্যানিপুলেশন সনাক্ত হয়েছে"
6060
scan_missing_filename: "অনুপস্থিত ফাইলের নাম"
6161
scan_no_problems_found: "কোন সমস্যা খুঁজে পাওয়া যায়নি।"
62-
scan_not_archive: "ব্যর্থ (খালি বা না একটি আর্কাইভ)!"
6362
scan_reading: "পড়ছি"
6463
scan_signature_file_missing: "স্বাক্ষর ফাইলটি অনুপস্থিত"
6564
scan_tampering: "সম্ভাব্য বিপজ্জনক ফাইল টিমপারিং সনাক্ত হয়েছে"

l10n/de.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: German language data (last modified: 2020.07.05).
10+
# This file: German language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "API-Anforderungsfehler"
2121
SafeBrowseLookup_401: "API-Berechtigungsfehler"
2222
SafeBrowseLookup_503: "API-Dienst nicht verfügbar"
2323
SafeBrowseLookup_999: "Unbekannt API-Fehler"
24-
_exclamation: "%s! "
25-
_exclamation_final: "%s!"
26-
_fullstop: ". "
27-
_fullstop_final: "."
2824
corrupted: "Beschädigte PE entdeckt"
2925
data_not_available: "Keine Daten verfügbar."
3026
detected: "Entdeckt %s"
@@ -42,24 +38,27 @@ filesize_limit_exceeded: "Dateigröße überschritten"
4238
filetype_blacklisted: "Dateityp auf Blacklist"
4339
finished: "Fertig"
4440
generated_by: "Generiert von"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "%s!"
43+
grammar_fullstop: "%s."
44+
grammar_spacer: " "
4545
image: "Bild"
4646
invalid_data: "Ungültige Daten!"
4747
invalid_file: "Ungültige Datei"
4848
invalid_url: "Ungültige URL!"
4949
macros_not_permitted: "Makros sind nicht erlaubt"
5050
ok: "OK"
5151
only_allow_images: "Nur Bilddateien erlaubt"
52-
quarantined_as: "Als "%s.qfu" unter Quarantäne gestellt."
52+
quarantined_as: "Als %s.qfu unter Quarantäne gestellt."
5353
recursive: "Rekursionstiefe-Limit überschritten"
5454
scan_chameleon: "%s-Chamäleon-Angriff erkannt"
55-
scan_checking: "Überprüfung"
55+
scan_checking: "Überprüfe „%s“."
5656
scan_command_injection: "CMD-Injektion erkannt"
5757
scan_complete: "Komplett"
5858
scan_extensions_missing: "Gescheitert (fehlende benötigte Erweiterungen)!"
5959
scan_filename_manipulation_detected: "Manipulation des Dateinamens erkannt"
6060
scan_missing_filename: "Fehlender Dateiname"
6161
scan_no_problems_found: "Keine Probleme gefunden."
62-
scan_not_archive: "Gescheitert (leer oder kein Archiv)!"
6362
scan_reading: "Lesen"
6463
scan_signature_file_missing: "Signaturdatei fehlt"
6564
scan_tampering: "Potentiell gefährliche Datei-Manipulation erkannt"

l10n/en.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: English language data (last modified: 2020.07.05).
10+
# This file: English language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "API request error"
2121
SafeBrowseLookup_401: "API authorisation error"
2222
SafeBrowseLookup_503: "API service unavailable"
2323
SafeBrowseLookup_999: "Unknown API error"
24-
_exclamation: "%s! "
25-
_exclamation_final: "%s!"
26-
_fullstop: ". "
27-
_fullstop_final: "."
2824
corrupted: "Detected corrupted PE"
2925
data_not_available: "Data not available."
3026
detected: "Detected %s"
@@ -42,6 +38,10 @@ filesize_limit_exceeded: "Filesize limit exceeded"
4238
filetype_blacklisted: "Filetype blacklisted"
4339
finished: "Finished"
4440
generated_by: "Generated by"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "%s!"
43+
grammar_fullstop: "%s."
44+
grammar_spacer: " "
4545
image: "Image"
4646
invalid_data: "Invalid data!"
4747
invalid_file: "Invalid file"
@@ -52,14 +52,13 @@ only_allow_images: "Only image files are permitted"
5252
quarantined_as: "Quarantined as "%s.qfu"."
5353
recursive: "Recursion depth limit exceeded"
5454
scan_chameleon: "%s chameleon attack detected"
55-
scan_checking: "Checking"
55+
scan_checking: "Checking "%s"."
5656
scan_command_injection: "Command injection attempt detected"
5757
scan_complete: "Complete"
5858
scan_extensions_missing: "Failed (missing required extensions)!"
5959
scan_filename_manipulation_detected: "Filename manipulation detected"
6060
scan_missing_filename: "Missing filename"
6161
scan_no_problems_found: "No problems found."
62-
scan_not_archive: "Failed (empty or not an archive)!"
6362
scan_reading: "Reading"
6463
scan_signature_file_missing: "Signature file missing"
6564
scan_tampering: "Detected potentially dangerous file tampering"

l10n/es.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Spanish language data (last modified: 2020.07.05).
10+
# This file: Spanish language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "Error de solicitud de la API"
2121
SafeBrowseLookup_401: "Error de autorización de la API"
2222
SafeBrowseLookup_503: "Servicio de la API no está disponible"
2323
SafeBrowseLookup_999: "Error da la API desconocido"
24-
_exclamation: "¡%s! "
25-
_exclamation_final: "¡%s!"
26-
_fullstop: ". "
27-
_fullstop_final: "."
2824
corrupted: "PE corrompido detectado"
2925
data_not_available: "Informacion no disponible."
3026
detected: "Detectado %s"
@@ -42,6 +38,10 @@ filesize_limit_exceeded: "Excede el límite del archivo tamaño"
4238
filetype_blacklisted: "Tipo de archivo en la lista negra"
4339
finished: "Terminado"
4440
generated_by: "Generado por"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "¡%s!"
43+
grammar_fullstop: "%s."
44+
grammar_spacer: " "
4545
image: "Imagen"
4646
invalid_data: "¡Datos no válidos!"
4747
invalid_file: "Archivo no válido"
@@ -52,14 +52,13 @@ only_allow_images: "Solo se permiten archivos de imagen"
5252
quarantined_as: "En cuarentena como "%s.qfu"."
5353
recursive: "Recursión profundidad límite excedido"
5454
scan_chameleon: "%s camaleón ataque detectado"
55-
scan_checking: "Comprobando"
55+
scan_checking: "Comprobando "%s"."
5656
scan_command_injection: "Comandos inyección intento detectado"
5757
scan_complete: "Completo"
5858
scan_extensions_missing: "¡Fracasado (desaparecido requeridos extensiones)!"
5959
scan_filename_manipulation_detected: "Manipulación del fichero nombre detectado"
6060
scan_missing_filename: "Nombre del archivo está ausente"
6161
scan_no_problems_found: "No problemas encontrado."
62-
scan_not_archive: "¡Fracasado (vacío o no es un archivo)!"
6362
scan_reading: "Leyendo"
6463
scan_signature_file_missing: "Firma archivo desaparecido"
6564
scan_tampering: "Detectado potencialmente peligrosa archivo manipulación"

l10n/fr.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: French language data (last modified: 2020.07.05).
10+
# This file: French language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "Erreur de requête de l'API"
2121
SafeBrowseLookup_401: "Erreur d'autorisation de l'API"
2222
SafeBrowseLookup_503: "Le service de l'API est indisponible"
2323
SafeBrowseLookup_999: "Erreur API inconnue"
24-
_exclamation: "%s ! "
25-
_exclamation_final: "%s !"
26-
_fullstop: ". "
27-
_fullstop_final: "."
2824
corrupted: "PE corrompu détecté"
2925
data_not_available: "Les données ne sont pas disponibles."
3026
detected: "Détecté %s"
@@ -42,6 +38,10 @@ filesize_limit_exceeded: "Taille limite fichier dépassée"
4238
filetype_blacklisted: "Type de fichier sur liste noire"
4339
finished: "Terminé"
4440
generated_by: "Généré par"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "%s !"
43+
grammar_fullstop: "%s."
44+
grammar_spacer: " "
4545
image: "Image"
4646
invalid_data: "Données non valides !"
4747
invalid_file: "Fichier non valide"
@@ -52,14 +52,13 @@ only_allow_images: "Seuls les fichiers images sont autorisés"
5252
quarantined_as: "Mis en quarantaine comme « %s.qfu »."
5353
recursive: "Profondeur limite de récursion dépassée"
5454
scan_chameleon: "Attaque %s caméléon détectée"
55-
scan_checking: "Vérification"
55+
scan_checking: "Vérifie « %s »."
5656
scan_command_injection: "Tentative d'injection de commande détectée"
5757
scan_complete: "Terminé"
5858
scan_extensions_missing: "Échec (extensions requises manquantes) !"
5959
scan_filename_manipulation_detected: "Manipulation de nom de fichier détectée"
6060
scan_missing_filename: "Nom de fichier manquant"
6161
scan_no_problems_found: "Pas de problème trouvé."
62-
scan_not_archive: "Échec (vide ou pas une archive) !"
6362
scan_reading: "Lecture en cours"
6463
scan_signature_file_missing: "Fichiers des signatures manquant"
6564
scan_tampering: "Altération de fichier potentiellement dangereuse détectée"

l10n/hi.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Hindi language data (last modified: 2020.07.05).
10+
# This file: Hindi language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "API अनुरोध त्रुटि"
2121
SafeBrowseLookup_401: "API प्राधिकरण त्रुटि"
2222
SafeBrowseLookup_503: "API सेवा उप्लब्ध् नहीं है"
2323
SafeBrowseLookup_999: "अज्ञात API त्रुटि"
24-
_exclamation: "%s! "
25-
_exclamation_final: "%s!"
26-
_fullstop: ""
27-
_fullstop_final: ""
2824
corrupted: "भ्रष्ट PE का पता चला"
2925
data_not_available: "डेटा उपलब्ध नहीं।"
3026
detected: "%s का पता चला"
@@ -42,6 +38,10 @@ filesize_limit_exceeded: "फाइल आकार सीमा पार ह
4238
filetype_blacklisted: "काली सूची पर फाइल प्रकार"
4339
finished: "ख़त्म होना"
4440
generated_by: "जनरेटर"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "%s !"
43+
grammar_fullstop: "%s।"
44+
grammar_spacer: " "
4545
image: "छवि"
4646
invalid_data: "अमान्य डेटा!"
4747
invalid_file: "अवैध फाइल"
@@ -52,14 +52,13 @@ only_allow_images: "केवल छवियों की अनुमति
5252
quarantined_as: ""%s.qfu" के रूप में क्वारंटाइन।"
5353
recursive: "पुनरावर्ती गहराई सीमा पार हो गई"
5454
scan_chameleon: "%s गिरगिट के हमले का पता चला"
55-
scan_checking: "जाँच हो रही है"
55+
scan_checking: ""%s" की जाँच हो रही है"
5656
scan_command_injection: "कमान इंजेक्शन प्रयास का पता चला"
5757
scan_complete: "पूर्ण"
5858
scan_extensions_missing: "अनुत्तीर्ण होना (आवश्यक एक्सटेंशन लापता)!"
5959
scan_filename_manipulation_detected: "फाइलनाम हेरफेर का पता चला"
6060
scan_missing_filename: "गुम फाइल नाम"
6161
scan_no_problems_found: "कोई समस्या नहीं मिली।"
62-
scan_not_archive: "अनुत्तीर्ण होना (खाली या नहीं एक संग्रह)!"
6362
scan_reading: "पढ़ना"
6463
scan_signature_file_missing: "हस्ताक्षर फाइल लापता है"
6564
scan_tampering: "संभावित खतरनाक फाइल छेड़छाड़ की गई"

l10n/id.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Indonesian language data (last modified: 2020.07.05).
10+
# This file: Indonesian language data (last modified: 2020.07.11).
1111
##/
1212

1313
# Language settings.
@@ -21,10 +21,6 @@ SafeBrowseLookup_400: "Kesalahan permintaan API"
2121
SafeBrowseLookup_401: "Kesalahan otorisasi API"
2222
SafeBrowseLookup_503: "Layanan API tidak tersedia"
2323
SafeBrowseLookup_999: "Kesalahan API tidak diketahui"
24-
_exclamation: "%s! "
25-
_exclamation_final: "%s!"
26-
_fullstop: ". "
27-
_fullstop_final: "."
2824
corrupted: "Terdeteksi rusak PE"
2925
data_not_available: "Data tidak tersedia."
3026
detected: "Terdeteksi %s"
@@ -42,6 +38,10 @@ filesize_limit_exceeded: "File ukuran batas melebihi"
4238
filetype_blacklisted: "File jenis pada hitam daftar"
4339
finished: "Selesai"
4440
generated_by: "Dihasilkan oleh"
41+
grammar_brackets: "%s (%s)"
42+
grammar_exclamation_mark: "%s!"
43+
grammar_fullstop: "%s."
44+
grammar_spacer: " "
4545
image: "Gambar"
4646
invalid_data: "Data tidak valid!"
4747
invalid_file: "File tidak valid"
@@ -52,14 +52,13 @@ only_allow_images: "Hanya file gambar diizinkan"
5252
quarantined_as: "Dikarantina sebagai "%s.qfu"."
5353
recursive: "Batas kedalaman rekursi melebihi"
5454
scan_chameleon: "Bunglon %s serangan terdeteksi"
55-
scan_checking: "Memeriksa"
55+
scan_checking: "Memeriksa "%s"."
5656
scan_command_injection: "Perintah injeksi terdeteksi"
5757
scan_complete: "Selesai"
5858
scan_extensions_missing: "Gagal (hilang ekstensi yang dibutuhkan)!"
5959
scan_filename_manipulation_detected: "File nama manipulasi terdeteksi"
6060
scan_missing_filename: "Hilang nama file"
6161
scan_no_problems_found: "Tidak ada masalah yang diketahui."
62-
scan_not_archive: "Gagal (kosong atau tidak sebuah arsip)!"
6362
scan_reading: "Bacaan"
6463
scan_signature_file_missing: "Tanda tangan file hilang"
6564
scan_tampering: "Terdeteksi perubahan berpotensi berbahaya dalam file"

0 commit comments

Comments
 (0)