Compare commits

..

No commits in common. "a1708563be7b70b191ac8775efdf497f36dfdbd7" and "12afb64c2a17c1b1efb7e55cfc5f934f7cc69644" have entirely different histories.

4 changed files with 8 additions and 9 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
/wordifier.iml
/.idea/

4
entry.go Normal file
View File

@ -0,0 +1,4 @@
package main
func main() {
}

2
go.mod
View File

@ -1,3 +1,3 @@
module geniuscartel.xyz/wordifier module Wordifier
go 1.18 go 1.18

View File

@ -3,8 +3,6 @@ package word
import ( import (
zip2 "archive/zip" zip2 "archive/zip"
"bytes" "bytes"
"errors"
"fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
@ -18,12 +16,11 @@ type (
} }
) )
func NewMacroInjectTarget(name string, marker []byte, replacement []byte) (*MacroInjectTarget, error) { func NewMacroInjectTarget(name string, marker []byte, replacement []byte) MacroInjectTarget {
if len(replacement) != len(marker) { if len(replacement) != len(marker) {
err := errors.New(fmt.Sprintf("Payload[%d] and target[%d] are not the same size. Make sure replacement is the same length as marker", len(replacement), len(marker))) panic("Payload and target are not the same size. Make sure replacement is the same length as marker")
return nil, err
} }
return &MacroInjectTarget{name, marker, replacement}, nil return MacroInjectTarget{name, marker, replacement}
} }
func CopyZipWithReplacements(src string, dest io.Writer, replacements []MacroInjectTarget) { func CopyZipWithReplacements(src string, dest io.Writer, replacements []MacroInjectTarget) {