Commit Graph

9 Commits

Author SHA1 Message Date
Paul Scheduikat
87ebebb520 format testscript files with gofmt 2025-06-15 17:25:20 +01:00
Paul Scheduikat
8d8ba00515 properly handle controlflow obfuscation in code that uses unsafe
Due to unsafe not being a real dependency, type checking during control-flow obfuscation was performed incorrectly.
This is fixed by excluding unsafe from the dependency checks.


Fixes #903
2025-06-12 14:25:09 +02:00
Daniel Martí
30357af923 drop Go 1.22 and require Go 1.23.0 or later (#876)
This lets us start taking advantage of featurs from Go 1.23,
particularly tracking aliases in go/types and iterators.

Note that we need to add code to properly handle or skip over the new
*types.Alias type which go/types produces for Go type aliases.
Also note that we actually turn this mode off entirely for now,
due to the bug reported at https://go.dev/issue/70394.

We don't yet remove our own alias tracking code yet due to the above.
We hope to be able to remove it very soon.
2024-11-17 16:06:57 +01:00
Daniel Martí
ad2ecc7f2f drop Go 1.21 and start using go/version
Needing to awkwardly treat Go versions as if they were semver
is no longer necessary thanks to go/version being in Go 1.22.0 now.
2024-02-12 14:07:57 +03:00
pagran
e8fe80d627 add trash block generator (#825)
add trash block generator

For making static code analysis even more difficult, added feature for
generating trash blocks that will never be executed. In combination
with control flow flattening makes it hard to separate trash code from
the real one, plus it causes a large number of trash references to
different methods.

Trash blocks contain 2 types of statements:
1. Function/method call with writing the results into local variables
and passing them to other calls
2. Shuffling or assigning random values to local variables
2024-01-16 16:01:53 +01:00
Daniel Martí
126618a0d5 drop support for Go 1.20
Go 1.21.0 was released in August 2023, so our upcoming release
will no longer support the Go 1.20 release series.

The first Go 1.22 release candidate is also due in December 2023,
less than a month from now, so dropping 1.20 will simplify 1.22 work.
2023-11-12 16:28:44 +03:00
pagran
5e80f12be7 implement flattening hardening
Without hardening, obfuscation is vulnerable to analysis via symbolic
execution because all keys are opened, and it is easy to trace their
connections. Added extendable (contribution-friendly) hardening
mechanism that makes it harder to determine relationship between key and
execution block through key obfuscation.

There are 2 hardeners implemented and both are compatible with literal
obfuscation, which can make analysis even more difficult.
2023-11-12 10:34:25 +00:00
pagran
260cad2a3f add "max" flag value and limits for control flow obfuscation parameters 2023-07-01 22:10:30 +02:00
pagran
0e2e483472 add control flow obfuscation
Implemented control flow flattening with additional features such as block splitting and junk jumps
2023-06-25 22:57:27 +02:00