Commit Graph

10 Commits (master)

Author SHA1 Message Date
Daniel Martí cb83c50b13 all: run gopls's modernize -fix
Except on reflect_abi_code.go, as that needs to be compatible
with older versions of Go given that we inject its code.
1 month ago
Daniel Martí 275737aabd start using go/types.Func.Signature
Guaranteed to return a *types.Signature, so no need to type assert.
1 month ago
Daniel Martí b0d3563fef all: use quicktest more consistently 4 months ago
Daniel Martí 4963af3311 all: drop x/exp in favor of std
x/exp/rand was being used for no apparent reason; use math/rand.

x/exp/maps and x/exp/slices can be replaced with maps and slices
respectively now that we require Go 1.23 or later.
Note that the APIs are slightly different due to iterators.
5 months ago
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.
5 months ago
Daniel Martí 324c1d5d7e internal/ssa2ast: satisfy staticcheck with an ignore directive 7 months ago
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
1 year ago
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.
1 year ago
pagran 9612b29423
add generic function support for control flow obfuscation 2 years ago
pagran 0e2e483472
add control flow obfuscation
Implemented control flow flattening with additional features such as block splitting and junk jumps
2 years ago