Inline methods
This obfuscation erases the encapsulation boundary between various layers of abstraction used in a program, merging independent components into one heavily-interlinked chunk.
Before | After |
---|---|
static void Core() { |
static void Core() { |
Rummage thoroughly analyzes the program and takes into account accessibility modifiers, inheritance, type nesting, and code that uses reflection. This way inlining is guaranteed to work properly, even in the face of circumstances in which members cannot just be made public. In such cases, Rummage uses a technique called redirect methods which are methods that simply read out a field or call another method. These methods do not impact run-time performance because they are tiny and will therefore be inlined by the JIT compiler.
Why use inlining as an obfuscation?
Inlining is arguably the most powerful obfuscation in Rummage as it irreversibly removes the separation of internal and external logic, code encapsulation and modularity. Furthermore, inlining sometimes changes the code into something that is genuinely impossible to translate directly back to a source language such as C# or Visual Basic.NET. Finally, this optimization additionally results in a run-time performance gain because fewer method calls are required.