Created
September 11, 2020 13:14
-
-
Save pyperanger/54c6a60a7b1f5f3294c543c2b08b0d6c to your computer and use it in GitHub Desktop.
F4ck ofuscation shells
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"regexp" | |
"strconv" | |
"strings" | |
"flag" | |
) | |
var ( | |
fname = flag.String("f", "", "File Name") | |
) | |
func replace(text string, chr string ) string { | |
c, _ := strconv.Atoi(chr) | |
tochg := "chr("+chr+")" | |
torpl := `"`+string(c)+`"` | |
txt := strings.Replace(text, tochg, torpl, -1) | |
return txt | |
} | |
func main() { | |
flag.Parse() | |
if *fname == "" { | |
flag.Usage() | |
return | |
} | |
obfusfile, err := ioutil.ReadFile(*fname) | |
if err != nil { | |
fmt.Println(err) | |
return | |
} | |
obfustext := string(obfusfile) | |
//var deofus string | |
var re = regexp.MustCompile(`(?m)chr\((\d+)\)`) | |
res := re.FindAllStringSubmatch(obfustext, -1) | |
for i := range res { | |
obfustext = replace(obfustext, res[i][1]) | |
} | |
obfustext = strings.Replace(obfustext, "\"", "" , -1) | |
obfustext = strings.Replace(obfustext, ".", "" , -1) | |
fmt.Println(obfustext) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment