MCPcopy Index your code
hub / github.com/MultSec/MultCheck / scanSlice

Function scanSlice

src/scan.go:37–60  ·  view source on GitHub ↗
(fileData []byte, conf map[string]string)

Source from the content-addressed store, hash-verified

35}
36
37func scanSlice(fileData []byte, conf map[string]string) (bool, error) {
38 // Create a temp file to scan
39 tempFile, err := os.CreateTemp("", "slice_scan_")
40 if err != nil {
41 return false, fmt.Errorf("failed to create temp file: %v", err)
42 }
43
44 // Defer cleanup
45 defer os.Remove(tempFile.Name())
46 defer tempFile.Close()
47
48 _, err = tempFile.Write(fileData)
49 if err != nil {
50 return false, fmt.Errorf("failed to write to temp file: %v", err)
51 }
52
53 // Scan the file slice
54 scanResult, err := scanFile(tempFile.Name(), conf)
55 if err != nil {
56 return false, fmt.Errorf("failed to scan temp file: %v", err)
57 }
58
59 return scanResult, nil
60}
61
62func checkStatic(binaryPath string, conf map[string]string) (string, error) {
63 // Read the files content

Callers 1

checkStaticFunction · 0.85

Calls 1

scanFileFunction · 0.85

Tested by

no test coverage detected