Create .tiny.exe with -tiny for garble, upx obfuscate, upx ultra compress

This commit is contained in:
2024-08-01 07:26:18 +02:00
parent 6f72252f35
commit b222aa8e8e
3 changed files with 19 additions and 17 deletions

View File

@ -4,6 +4,7 @@ import (
"os"
"bytes"
"log"
"fmt"
)
func bytesReplace(data, old, new []byte) []byte {
@ -13,7 +14,6 @@ func bytesReplace(data, old, new []byte) []byte {
log.Println("Found identifier at offset", foundIndex)
} else {
return data
log.Fatalln("Error file is not UPX packed")
}
return bytes.Replace(data, old, new, 1)
@ -31,9 +31,11 @@ func main() {
data, _ := os.ReadFile(filename)
data = bytesReplace(data, []byte("UPX0"), []byte("GSP7"))
data = bytesReplace(data, []byte("UPX1"), []byte("GSP1"))
data = bytesReplace(data, []byte("UPX2"), []byte("GSP2"))
for i := range(10) {
upxIdentifier := fmt.Sprintf("UPX%d", i)
efbIdentifier := fmt.Sprintf("EFB%d", i)
data = bytesReplace(data, []byte(upxIdentifier), []byte(efbIdentifier))
}
_ = os.WriteFile(filename, data, 0666)