h dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZddlmZGd d e ZGd d e ZGd de ZGddZGddeZGddeZdS)u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N)suppress)IntEnum)Path)Optional)Core) snake_casec*eZdZdZdZdZdZdZdZdZ dS) DeletionTyper N) __name__ __module__ __qualname__INJECTION_REMOVEDREMOVED_BY_INJECTION_SIGNATUREREMOVED_BY_SA_DELF_SIGNATUREREMOVED_BY_SA_ODFL_SIGNATUREREMOVED_BY_CAS_SIGNATURE REMOVED_ELF PATCH_APPLIEDS/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/utils/revisium.pyr r $s6%&"#$ #$  KMMMrr c*eZdZdZdZdZdZdZdZdZ dS) ErrorTyperr r r rN) rrrNO_ERROR FILE_TOO_BIGFILE_READING_ERRORFILE_NONE_WRITE NOT_CLEANEDUPFILE_NOT_EXISTSFILE_MATCHED_NOT_CLEANEDrrrrr.s5HLOMO rrceZdZdZdZdZdS)RescanResultTyperr r N)rrrCLEANDETECTEDREQUIRED_ADVANCED_SIGNATURESrrrr*r*8s EH#$   rr*cReZdZdZddZdZdZedZedZ dS) RevisiumTempFiletxtNcr|ttjnt||_||_dSN)rrTMPDIRtempdirmode)selfr4r5s r__init__zRevisiumTempFile.__init__As-,3OtDK(((g  rc$d|jttjdz|jfz}|j|z |_|jrF|jtj t|j|j|S)Nz%s_%d.%sgcA)r5) nameinttimeextr4_pathr5touchoschmodstr)r6filenames r __enter__zRevisiumTempFile.__enter__EszC d0B,C,CTX NN\H, 9 6 J      HS__49 5 5 5 5 rctt5|jddddS#1swxYwYdSr2)rFileNotFoundErrorr=unlink)r6_s r__exit__zRevisiumTempFile.__exit__Ms ' ( (  J                       s<AAc*t|jSr2)rAr=r6s rrBzRevisiumTempFile.filenameQs4:rc4t|jjSr2)r __class__rrJs rr9zRevisiumTempFile.nameUs$.1222r)NN) rrrr<r7rCrHpropertyrBr9rrrr/r/>s C   X33X333rr/ceZdZdZdZdS)RevisiumJsonFilejsonc|j5}tj|cdddS#1swxYwYdSr2)r=openrPload)r6fs rreadzRevisiumJsonFile.read]s Z__   !9Q<<                  s ;??N)rrrr<rUrrrrOrOZs( C     rrOc@eZdZdZedeefdZdZdS)RevisiumCSVFilecsvvaluecP|r|}|dvr|dkSn|dS|S)N)truefalser[)lower)rY low_values r_convert_booleanz RevisiumCSVFile._convert_booleanesB   I--- F**. ]2 rcjd5}d|D}tj|gd}fd|DcdddS#1swxYwYdS)z Reads a CSV file and returns its contents as a list of dictionaries. The file must be read in binary mode and decoded manually to preserve the original line ending and carriage return characters. rbcg|];}|tjtjz(RevisiumCSVFile.read..wsU   -//8::r) rTedstrmbmahbha) fieldnamescPg|]"}fd|D#S)cFi|]\}}|||Sr2)r`)rifieldrYr6s r z3RevisiumCSVFile.read...s=$u(40077(((r)items)rirowr6s rrkz(RevisiumCSVFile.read..sT  (+ rN)r=rRrX DictReader)r6rTcontentsreaders` rrUzRevisiumCSVFile.readosZ__T " " a  H^   F " /                  s2AA"AN) rrrr< staticmethodrrAr`rUrrrrWrWbsQ C \%%%%%rrW)__doc__rXrPr?rfr; contextlibrenumrpathlibrtypingr defence360agent.contracts.configrdefence360agent.utilsrr rr*r/rOrWrrrrs* 111111,,,,,,7!!!!!!!!%%%%%w%%% 333333338     '   22222&22222r