Add operator randomizer for xor_seed obfuscator

pull/90/head
Pagran 5 years ago
parent b52e55e574
commit bc0bd853dd

@ -19,9 +19,11 @@ func (x xorSeed) obfuscate(data []byte) *ast.BlockStmt {
seed := preSeed[0]
originalSeed := seed
op := genRandOperator()
var callExpr *ast.CallExpr
for i, b := range data {
encB := b ^ seed
encB := evalOperator(op, b, seed)
seed += encB
if i == 0 {
@ -95,11 +97,7 @@ func (x xorSeed) obfuscate(data []byte) *ast.BlockStmt {
Lhs: []ast.Expr{ah.Ident("data")},
Tok: token.ASSIGN,
Rhs: []ast.Expr{
ah.CallExpr(ah.Ident("append"), ah.Ident("data"), &ast.BinaryExpr{
X: ah.Ident("x"),
Op: token.XOR,
Y: ah.Ident("seed"),
}),
ah.CallExpr(ah.Ident("append"), ah.Ident("data"), getReversedOperator(op, ah.Ident("x"), ah.Ident("seed"))),
},
},
&ast.AssignStmt{

Loading…
Cancel
Save