MCPcopy Create free account
hub / github.com/Tylous/ZipExec / Zipit

Function Zipit

Loader/Loader.go:29–56  ·  view source on GitHub ↗
(source, target string, password string)

Source from the content-addressed store, hash-verified

27}
28
29func Zipit(source, target string, password string) {
30 var input string
31 base := filepath.Base(source)
32 f, _ := os.Open(source)
33 reader := bufio.NewReader(f)
34 content, _ := ioutil.ReadAll(reader)
35 contents := []byte(content)
36 fzip, err := os.Create(target)
37 if err != nil {
38 log.Fatalln(err)
39 }
40 zipw := zip.NewWriter(fzip)
41 defer zipw.Close()
42 if strings.Contains(source, "\\") || strings.Contains(source, "/") {
43 input = base
44 } else {
45 input = base
46 }
47 w, err := zipw.Encrypt(input, password, zip.StandardEncryption)
48 if err != nil {
49 log.Fatal(err)
50 }
51 _, err = io.Copy(w, bytes.NewReader(contents))
52 if err != nil {
53 log.Fatal(err)
54 }
55 zipw.Flush()
56}
57
58func JScriptLoader_Buff(name string, outFile string, sandbox bool) string {
59 var buffer bytes.Buffer

Callers 1

JScriptLoader_BuffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected