(yaraPath string, rc4key string, config Configuration, outputSfxExe string)
| 18 | var sfxBinary []byte |
| 19 | |
| 20 | func BuildSFX(yaraPath string, rc4key string, config Configuration, outputSfxExe string) error { |
| 21 | // compress inputDirectory into archive |
| 22 | archive := recursiveCompressFolder(yaraPath, rc4key, config) |
| 23 | |
| 24 | file, err := os.Create(outputSfxExe) |
| 25 | if err != nil { |
| 26 | return err |
| 27 | } |
| 28 | |
| 29 | defer file.Close() |
| 30 | |
| 31 | // pack sfx binary and customized archive together |
| 32 | file.Write(sfxBinary) |
| 33 | file.Write(archive.Bytes()) |
| 34 | |
| 35 | return nil |
| 36 | } |
| 37 | |
| 38 | func recursiveCompressFolder(yaraPath string, rc4key string, config Configuration) bytes.Buffer { |
| 39 | var buffer bytes.Buffer |
no test coverage detected