RikaSDK Documentation
Welcome to the official documentation for the Rika .NET Obfuscator SDK.
Using the attributes defined in the RikaSDK namespace,
you can fine-tune the protection process directly from your source code.
Installation
Simply add the provided SDK file to your project solution.
C# Projects
Add RikaSDK.cs to your project root.
├── Program.cs
└── RikaSDK.cs
VB.NET Projects
Add RikaSDK.vb to your project root.
├── Application.myapp
└── RikaSDK.vb
Enum Enumerations
RenameType
Defines available character sets for renaming.
| Value | Description |
|---|---|
| Japanese | Kanji/Kana characters. |
| Chinese | Chinese characters. |
| Tibetian | Tibetan script characters. |
| Guid | Unique GUIDs (e.g., c234-54...). |
RenameMode
Defines the selection mode for renaming. Determines whether all members are renamed by default or only explicitly marked ones.
| Value | Description |
|---|---|
| AllExceptExcluded | Renames everything except explicitly excluded members. This is the default mode. |
| OnlyIncluded | Renames only members explicitly marked with the EnableRenaming attribute. Nothing is renamed by default. |
MemberType
Specifies the type of members to target.
VirtualizationMode
Defines the complexity level of the VM generation.
| Value | Description | Complexity |
|---|---|---|
| Normal | Balanced protection. Recommended for general logic. | Medium |
| Ultra | Maximum protection. Slightly higher performance cost. | High |
ControlFlowMode
Defines the intensity of control flow obfuscation applied to a member or assembly.
| Value | Description | Complexity |
|---|---|---|
| Light | Minimal obfuscation with low overhead. Suitable for hot-paths. | Low |
| Standard | Balanced control flow flattening. Default mode. | Medium |
| Advanced | Aggressive obfuscation with maximum complexity. Higher performance cost. | High |
Attr Assembly Attributes
RenamingType
Single InstanceSets the global renaming mode for the entire assembly.
[assembly: RenamingType(RenameType.Japanese)]
RenamingMode
Single InstanceSets the renaming selection mode for the entire assembly. If not specified, the default mode is AllExceptExcluded.
[assembly: RenamingMode(RenameMode.OnlyIncluded)]
ExcludeMemberFromRenaming
AllowMultipleSpecifies member types to be excluded from renaming globally.
[assembly: ExcludeMemberFromRenaming(MemberType.Properties)]
[assembly: ExcludeMemberFromRenaming(MemberType.Events)]
DisableIntegrityProtection
Disables runtime anti-tamper checks. Useful for self-signing or debugging.
[assembly: DisableIntegrityProtection]
Attr Member Attributes
EnableVirtualization
Converts standard MSIL instructions into a proprietary bytecode format interpreted by a custom VM.
VirtualizationMode.Ultra on methods called inside tight loops (e.g., rendering loops or rigorous math calculations). For high-frequency methods, use Normal or exclude them.
[EnableVirtualization(VirtualizationMode.Ultra)]
public bool ValidateLicense(string key) { ... }
DisableStringEncryption
Disables string encryption for the target member. Use on hot-paths for performance.
[DisableStringEncryption]
public void LogDebug(string msg) { ... }
DisableReferenceProxy
Disables proxying for external method calls. By default, Rika hides external calls (e.g., MessageBox.Show) behind internal proxies to prevent static analysis.
[DisableReferenceProxy]
public void CallNativeApi() { ... }
DisableControlFlow
Prevents control flow flattening (spaghetti code). Use this if obfuscation breaks a specific method's logic or causes excessive slowdowns.
[DisableControlFlow]
public int CalculatePhysics() { ... }
ControlFlowPreset
Sets the control flow obfuscation mode at the assembly, class, struct, method, or constructor level. Overrides the global setting for the targeted scope.
[assembly: ControlFlowPreset(ControlFlowMode.Advanced)]
[ControlFlowPreset(ControlFlowMode.Light)]
public class HotPathService {
[ControlFlowPreset(ControlFlowMode.Advanced)]
public bool ValidateToken(string token) { ... }
}
EnableRenaming
OnlyIncluded mode onlyOpt-in Renaming: Marks a type or member for renaming when using OnlyIncluded mode. This attribute has no effect in AllExceptExcluded mode. When applied to a type, it also enables renaming for all of its members.
[assembly: RenamingMode(RenameMode.OnlyIncluded)]
[EnableRenaming]
public class LicenseManager { // Renamed
public bool Validate() { ... } // Renamed
public string Key { get; set; } // Renamed
}
DisableRenaming
Complete Exclusion: Prevents renaming of the type itself AND all its members (fields, methods, props). Essential for Serialization, Reflection, or Public APIs.
[DisableRenaming]
public class UserSettings { // Not Renamed
public string Username { get; set; } // Not Renamed
}
DisableRenamingTypeName
Partial Exclusion: Preserves the Class/Struct name but allows renaming of its members. Useful for plugins where the class name is looked up by string, but internal logic should remain hidden.
[DisableRenamingTypeName]
public class MyPluginEntry { // Not Renamed
private void SecretLogic() { ... } // Renamed
}
DisableRenamingTypeMembers
Members-Only Exclusion: Prevents renaming of all members within a type (methods, fields, properties, events) while allowing the type name itself to be renamed. In OnlyIncluded mode, a member-level EnableRenaming attribute can override this block for that specific member.
[DisableRenamingTypeMembers]
public class NetworkHandler { // Renamed
public void Connect() { ... } // Not Renamed
public string Host { get; set; } // Not Renamed
}