Commit Graph

12 Commits

Author SHA1 Message Date
Daniel Martí
c3bee46a26 testdata: use the debugdir flag less often
In tiny.txt, we already check line numbers via stderr, so there's no
need to do that via -debugdir.

In syntax.txt, we only really care about what names remain in the
binary, not the names which remain in the source but don't affect the
binary.

These changes are important because -debugdir adds a non-trivial amount
of work, which will impede build caching once that feature lands. We
will likely make -debugdir support build caching eventually, but for
now, this preliminary change will make 'go test' much faster with build
caching.

And of course, the tests get simpler, which is nice.
2020-09-22 14:56:21 +01:00
lu4p
388ff7d1a4 remove buggy number literal obfuscation
Also remove boolean literal obfuscation.
2020-08-23 19:33:54 +02:00
Daniel Martí
511779d8ff testdata: set GOPRIVATE in all but two tests (#104)
basic.txt just builds main.go without a module. Similarly, we leave
imports.txt without a GOPRIVATE, to test the 'go list -m' fallback.

For all other tests, explicitly set GOPRIVATE, to avoid two exec calls -
both 'go env GOPRIVATE' as well as 'go list -m'. Each of those calls
takes in the order of 10ms, so saving ~26 exec calls should easily add
to 200-300ms saved from 'go test -short'.
2020-08-20 11:51:55 +02:00
pagran
2735555ab2 Update filename and add line number obfuscation (#94)
Fixes  #2.

Line numbers are now obfuscated, via `//line` comments.
Filenames are now obfuscated via `//line` comments, instead of changing the actual filename.
New flag `-tiny` to reduce the binary size, at the cost of reversibility.
2020-08-14 20:47:15 +02:00
pagran
28adbaa73b Randomize operator (xor, add, subtract) on all obfuscators (#90)
Co-authored-by: lu4p <lu4p@pm.me>
2020-08-12 03:23:43 +02:00
pagran
2eba744530 Add XorSeed obfuscator (#86)
Co-authored-by: lu4p <lu4p@pm.me>
2020-08-11 00:46:08 +02:00
pagran
9c25f4c2b2 Add xorShuffle obfuscator (#85)
* Refactoring

* Rename Xor2 to XorShuffle
2020-08-09 12:05:47 +02:00
pagran
c51e08ef37 Add split obfuscator (#81) 2020-08-03 22:08:33 +02:00
pagran
c2079ac0a1 Add test for literal obfuscators (#80)
* Combine literals-all-obfuscators.txt nad literals.txt
Rewrite literals.txt logic

* Remove unused \s

* Refactoring and add float ast helpers
2020-07-31 20:23:51 +02:00
lu4p
50d24cdf51 Add float, int, and boolean literal obfuscation.
Add ast helper functions to reduce ast footprint.

Add binsubfloat and binsubint functions for testing.

Fixes #55.
2020-07-19 17:17:34 +01:00
lu4p
705f9d3a28 Fix byte array and untyped constant obfuscation.
Byte arrays were previously,
obfuscated as byte slices.

Untyped constants are now skipped,
because they cannot be replaced with typed variables.
2020-07-17 14:39:05 +01:00
lu4p
d48bdbadae Use XOR instead of AES for literal obfuscation.
Implement a literal obfuscator interface,
to allow the easy addition of new encodings.

Add literal obfuscation for byte literals.

Choose a random obfuscator on literal obfuscation,
useful when multiple obfuscators are implemented.

Fixes #62
2020-07-16 20:19:22 +01:00