Compare commits
No commits in common. "a1708563be7b70b191ac8775efdf497f36dfdbd7" and "12afb64c2a17c1b1efb7e55cfc5f934f7cc69644" have entirely different histories.
a1708563be
...
12afb64c2a
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
/wordifier.iml
|
|
||||||
/.idea/
|
|
||||||
2
go.mod
2
go.mod
@ -1,3 +1,3 @@
|
|||||||
module geniuscartel.xyz/wordifier
|
module Wordifier
|
||||||
|
|
||||||
go 1.18
|
go 1.18
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user