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
This commit is contained in:
pagran
2024-01-16 18:01:53 +03:00
committed by GitHub
parent c43cf74195
commit e8fe80d627
9 changed files with 816 additions and 16 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ func multiHardeningTest(i int) int {
return multiply(i);
}
//garble:controlflow flatten_passes=1 junk_jumps=10 block_splits=10
//garble:controlflow flatten_passes=1 junk_jumps=10 block_splits=10 trash_blocks=32
func main() {
// Reference to the unexported interface triggers creation of a new interface
// with a list of all functions of the private interface