func QuarantineFile(path, quarantinePath string) (err error) {
	fileContent, err := os.ReadFile(path)
	if err != nil {
		return err
	}
	err = quarantineContent(fileContent, filepath.Base(path), quarantinePath)
	if err != nil {
		return err
	}
	return nil
}
QuarantineFile dump specified file and cipher them in quarantine folder
package main
import (
	"crypto/md5"
	"crypto/rc4"
	b64 "encoding/base64"
	"fmt"
	"os"
	"path/filepath"
	"runtime/debug"
	"time"
	"github.com/h2non/filetype"
	"github.com/hillu/go-yara/v4"
)
type FileDescriptor struct {
	FilePath     string
	FileSize     int64
	LastModified time.Time
}
func FileAnalysis(path string, pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules, sourceIndex string) {
	var f os.FileInfo
	var err error
	var content []byte
	var result yara.MatchRules
	if f, err = os.Stat(path); err != nil {
		if pVerbose {
			logMessage(LOG_ERROR, "[ERROR]", path, err)
		}
	} else {
		if RegisterFileInHistory(f, path, &filescanHistory, pVerbose) {
			content, err = os.ReadFile(path)
			if err != nil && pVerbose {
				logMessage(LOG_ERROR, "[ERROR]", path, err)
			}
			filetype, err := filetype.Match(content)
			if err != nil && pVerbose {
				logMessage(LOG_ERROR, "[ERROR]", path, err)
			}
			if pVerbose {
				logMessage(LOG_INFO, "[INFO] ["+sourceIndex+"] Analyzing", path, fmt.Sprintf("%x", md5.Sum(content)))
			}
			if len(content) > 1024*1024*cleanIfFileSizeGreaterThan {
				defer debug.FreeOSMemory()
			}
			if StringInSlice(filetype.MIME.Value, archivesFormats) {
				result = PerformArchiveYaraScan(path, rules, pVerbose)
			} else {
				result = PerformYaraScan(&content, rules, pVerbose)
			}
			if len(result) > 0 {
				if pNotifications {
					NotifyUser("YARA match", path+" match "+fmt.Sprint(len(result))+" rules")
				}
				for _, match := range result {
					logMessage(LOG_INFO, "[ALERT]", "["+sourceIndex+"] YARA match", path, match.Namespace, match.Rule)
				}
				if pKill {
					killQueue = append(killQueue, path)
				}
				if len(pQuarantine) > 0 {
					logMessage(LOG_INFO, "[INFO]", "Dumping file", path)
					err := QuarantineFile(path, pQuarantine)
					if err != nil {
						logMessage(LOG_ERROR, "[ERROR]", "Cannot quarantine file", path, err)
					}
				}
			}
		}
	}
}
func MemoryAnalysis(proc *ProcessInformation, pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, rules *yara.Rules) {
	if pVerbose {
		logMessage(LOG_INFO, "[INFO] [MEMORY] Analyzing", proc.ProcessName, "PID:", proc.PID)
	}
	result := PerformYaraScan(&proc.MemoryDump, rules, pVerbose)
	if len(result) > 0 {
		if pNotifications {
			NotifyUser("YARA match", proc.ProcessName+" - PID:"+fmt.Sprint(proc.PID)+" match "+fmt.Sprint(len(result))+" rules")
		}
		for _, match := range result {
			logMessage(LOG_INFO, "[ALERT]", "[MEMORY] YARA match", proc.ProcessName, "PID:", fmt.Sprint(proc.PID), match.Namespace, match.Rule)
		}
		if len(pQuarantine) > 0 {
			logMessage(LOG_INFO, "[INFO]", "DUMPING PID", proc.PID)
			err := QuarantineProcess(proc, pQuarantine)
			if err != nil {
				logMessage(LOG_ERROR, "[ERROR]", "Cannot quarantine PID", proc.PID, err)
			}
		}
		if pKill {
			logMessage(LOG_INFO, "[INFO]", "KILLING PID", proc.PID)
			KillProcessByID(proc.PID, pVerbose)
		}
	}
}
func QuarantineProcess(proc *ProcessInformation, quarantinePath string) (err error) {
	err = quarantineContent(proc.MemoryDump, proc.ProcessName+fmt.Sprint(proc.PID)+".mem", quarantinePath)
	if err != nil {
		return err
	}
	err = QuarantineFile(proc.ProcessPath, quarantinePath)
	if err != nil {
		return err
	}
	return nil
}