### Install O-MVLL Type Stubs Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Install the `omvll` PyPI package to enable IDE autocompletion and type checking for configuration scripts. This package contains only type stubs and does not include the obfuscation engine. ```bash # Install type stubs for IDE support (does NOT include obfuscation engine) pip install omvll # Use in your editor for full type hints on all omvll.* classes and methods ``` -------------------------------- ### Install omvll Package Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/code-completion.rst Install the omvll package using pip to enable code completion. The --user flag can be used for user-specific installations. ```console $ python -m pip install [--user] omvll ``` -------------------------------- ### Python Configuration with Type Stubs Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Use the installed `omvll` type stubs in your Python code for full autocompletion and type hints on O-MVLL classes and methods. This example shows subclassing `ObfuscationConfig` to customize string obfuscation. ```python # With the stub package installed, IDEs provide full autocompletion for: # omvll.ObfuscationConfig subclassing # omvll.Module / omvll.Function / omvll.Struct / omvll.GlobalVariable properties # All *Opt return types (StringEncOptLocal, ArithmeticOpt, etc.) # omvll.config attributes and omvll.Pass / omvll.Phase enums import omvll # type stubs from PyPI class MyConfig(omvll.ObfuscationConfig): def obfuscate_string(self, mod: omvll.Module, func: omvll.Function, string: bytes) -> omvll.StringEncOptSkip | omvll.StringEncOptLocal: if b"secret" in string: return omvll.StringEncOptLocal() return omvll.StringEncOptSkip() ``` -------------------------------- ### Custom O-MVLL Obfuscation Configuration Source: https://github.com/open-obfuscator/o-mvll/blob/main/README.md Define custom obfuscation rules by subclassing omvll.ObfuscationConfig. This example shows how to conditionally enable CFG flattening for specific functions. ```python import omvll class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def flatten_cfg(self, mod: omvll.Module, func: omvll.Function): if func.name == "check_password": return True return False ``` -------------------------------- ### Compile C++ with O-MVLL Plugin Source: https://github.com/open-obfuscator/o-mvll/blob/main/README.md Use this command to compile your C++ code with the O-MVLL obfuscation plugin enabled. Ensure libOMVLL.dylib is in the correct path. ```bash clang++ -fpass-plugin=libOMVLL.dylib main.cpp -o main ``` -------------------------------- ### Invoke O-MVLL via Clang for Android NDK Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Use this command to integrate O-MVLL into an Android NDK build. Ensure `libOMVLL.so` is available and the configuration path is correctly set. ```bash clang++ \ -target aarch64-linux-android21 \ -fpass-plugin=libOMVLL.so \ -DOMVLL_CONFIG=/path/to/omvll_config.py \ -O2 \ main.cpp -o main ``` -------------------------------- ### omvll.OMVLL_VERSION_FULL Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/versioning.rst Returns the full version string of O-MVLL, which includes the O-MVLL version, LLVM version, and a commit hash. ```APIDOC ## omvll.OMVLL_VERSION_FULL ### Description The current O-MVLL full version including the LLVM commit. ### Example `OMVLL Version: 1.0.0- / 14.0.6git (4c603efb0cca074e9238af8b4106c30add4418f6)` ``` -------------------------------- ### Configure Basic Block Duplication with Probability Source: https://context7.com/open-obfuscator/o-mvll/llms.txt This configuration duplicates basic blocks and inserts opaque predicates. Adjust the probability to control the fraction of duplicated blocks, increasing code size and reverse engineering cost. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def basic_block_duplicate(self, mod: omvll.Module, func: omvll.Function): # Duplicate all blocks in critical functions if "verify" in func.demangled_name or "check" in func.demangled_name: return omvll.BasicBlockDuplicateWithProbability(100) # 40% chance of duplication for general security functions if "security" in mod.name: return omvll.BasicBlockDuplicateWithProbability(40) return omvll.BasicBlockDuplicateSkip() @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Custom Obfuscation Configuration Template Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/obfuscation.rst Implement a custom configuration by subclassing ObfuscationConfig and overriding methods like obfuscate_string. Use @lru_cache for efficient config retrieval. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def obfuscate_string(self, module: omvll.Module, func: omvll.Function, string: bytes): if func.demangled_name == "Hello::say_hi()": return True if "debug.cpp" in module.name: return "" return False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure LLVM Tools Directory Source: https://github.com/open-obfuscator/o-mvll/blob/main/src/test/CMakeLists.txt Sets the `LLVM_TOOLS_DIR` if it's not already defined. This is typically used to locate LLVM binaries. ```cmake if(NOT LLVM_TOOLS_DIR) set(LLVM_TOOLS_DIR ${LLVM_BINARY_DIR}) endif() ``` -------------------------------- ### Invoke O-MVLL via Clang for iOS/Xcode Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Integrate O-MVLL into an iOS/Xcode build using this command. The O-MVLL shared library should be named `libOMVLL.dylib`. ```bash clang++ \ -fpass-plugin=libOMVLL.dylib \ main.cpp -o main ``` -------------------------------- ### Filter Obfuscation with `default_config` Helper Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Use the `default_config` helper method within your `ObfuscationConfig` subclass to implement common filtering logic. This allows excluding modules/functions, including specific ones, and applying a probability threshold. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def obfuscate_arithmetic(self, mod: omvll.Module, fun: omvll.Function): # Exclude test modules, exclude debug_ functions, # only include secure_ functions, 80% probability should_obf = self.default_config( mod, fun, ["test_module.cpp"], # module_excludes ["debug_", "log_"], # func_excludes (prefix match) ["secure_", "check_"], # func_includes (empty = include all) 80 # probability (0 = always, 100 = never) ) return omvll.ArithmeticOpt(3) if should_obf else False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Implement Obfuscation Diff Reporting Source: https://context7.com/open-obfuscator/o-mvll/llms.txt This callback is invoked after each obfuscation pass. It receives the pass name, original LLVM IR, and obfuscated LLVM IR to log differences, aiding in auditing and debugging. ```python import omvll from difflib import unified_diff from functools import lru_cache from pathlib import Path class MyConfig(omvll.ObfuscationConfig): log_dir = Path("/tmp/omvll-diffs") def __init__(self): super().__init__() self.log_dir.mkdir(exist_ok=True) def obfuscate_arithmetic(self, mod, func): return omvll.ArithmeticOpt(3) def report_diff(self, pass_name: str, original: str, obfuscated: str): diff = list(unified_diff( original.splitlines(), obfuscated.splitlines(), fromfile="original", tofile="obfuscated", lineterm="" )) if diff: out_file = self.log_dir / f"{pass_name}.diff" out_file.write_text("\n".join(diff)) print(f"[O-MVLL] {pass_name}: {len(diff)} diff lines written to {out_file}") @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure String Encoding Options in O-MVLL Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Customize string encoding behavior by returning specific StringEncOpt values. Use StringEncOptReplace to substitute strings, StringEncOptLocal for lazy decoding, StringEncOptGlobal for global decoding, or StringEncOptDefault to let O-MVLL decide. Plain string or bytes return values also replace the original string. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def obfuscate_string(self, mod: omvll.Module, func: omvll.Function, string: bytes): # Replace source file paths to hide project structure if string.endswith(b".cpp") or string.endswith(b".hpp"): return omvll.StringEncOptReplace("REDACTED") # Locally decode secrets (decoded each time, higher overhead) if b"api_key" in string or b"token" in string: return omvll.StringEncOptLocal() # Globally decode UI strings (decoded once at startup, efficient) if string.startswith(b"Error:") or string.startswith(b"Warning:"): return omvll.StringEncOptGlobal() # Let O-MVLL decide for all other strings return omvll.StringEncOptDefault() @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure Lit Testsuite Source: https://github.com/open-obfuscator/o-mvll/blob/main/src/test/CMakeLists.txt Configures the O-MVLL regression testsuite using `add_lit_testsuite`. This command sets up the test environment, specifies dependencies, and defines arguments for `lit`. ```cmake list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR}) include(AddLLVM) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in" "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py" @ONLY) set(LLVM_LIT_ARGS "-vv --no-progress-bar --show-xfail --show-unsupported") add_lit_testsuite(check "Running O-MVLL regression tests" ${CMAKE_CURRENT_BINARY_DIR} DEPENDS OMVLL ${LLVM_TEST_DEPENDS} ) ``` -------------------------------- ### Invoke O-MVLL with Explicit Config Path via Environment Source: https://context7.com/open-obfuscator/o-mvll/llms.txt This command shows how to specify the O-MVLL configuration path using the `OMVLL_CONFIG` environment variable for iOS/Xcode builds. ```bash OMVLL_CONFIG=/path/to/omvll_config.py \ clang++ -fpass-plugin=libOMVLL.dylib -O2 main.cpp -o main ``` -------------------------------- ### Access O-MVLL Version and Set Logging Level Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Utilize version constants for LLVM and O-MVLL builds and control the verbosity of O-MVLL's internal diagnostic output using `set_log_level`. ```python import omvll from functools import lru_cache # Version introspection print(omvll.OMVLL_VERSION) # e.g. "1.0.0" print(omvll.LLVM_VERSION) # e.g. "17.0.6" print(omvll.OMVLL_VERSION_FULL) # e.g. "1.0.0 (LLVM 17.0.6 abc1234)" # Set logging verbosity (DEBUG, TRACE, INFO, WARN, ERR) omvll.set_log_level(omvll.LogLevel.DEBUG) class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() # Guard against running on unexpected LLVM versions if not omvll.LLVM_VERSION.startswith("17"): raise RuntimeError(f"Unexpected LLVM version: {omvll.LLVM_VERSION}") def flatten_cfg(self, mod, func): return True @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure Function Outlining with Probability Source: https://context7.com/open-obfuscator/o-mvll/llms.txt This pass extracts basic blocks into separate outlined functions, fragmenting the call graph. The probability parameter controls the fraction of basic blocks to be outlined. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def function_outline(self, mod: omvll.Module, func: omvll.Function): # Fully outline all blocks in the most sensitive functions if func.nb_instructions > 50 and "auth" in func.demangled_name: return omvll.FunctionOutlineWithProbability(100) # 60% outline probability for crypto module functions if "crypto" in mod.name: return omvll.FunctionOutlineWithProbability(60) return omvll.FunctionOutlineSkip() @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure O-MVLL Obfuscation Passes with `ObfuscationConfig` Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Subclass `omvll.ObfuscationConfig` to define custom obfuscation logic. Override methods like `flatten_cfg`, `obfuscate_string`, and `obfuscate_arithmetic` to control transformations per function or module. Returning `False` or `None` skips a pass. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def flatten_cfg(self, mod: omvll.Module, func: omvll.Function): # Enable control flow flattening for all functions return True def obfuscate_string(self, mod: omvll.Module, func: omvll.Function, string: bytes): # Encode strings that look like passwords/keys if b"password" in string or b"secret" in string: return omvll.StringEncOptLocal() return False def obfuscate_arithmetic(self, mod: omvll.Module, func: omvll.Function): # Apply MBA arithmetic obfuscation with 3 rounds to crypto functions if "crypto" in func.demangled_name.lower(): return omvll.ArithmeticOpt(3) return False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure Opaque Constants Obfuscation Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Implement `obfuscate_constants` to control which integer constants are replaced with opaque expressions. Supports global obfuscation, lower bounds, or specific sets of values. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def obfuscate_constants(self, mod: omvll.Module, func: omvll.Function): # Obfuscate all constants in crypto functions if "crypto" in func.demangled_name: return omvll.OpaqueConstantsBool(True) # Only obfuscate magic values / specific constants (e.g., AES S-box values) if "aes" in func.name.lower(): return omvll.OpaqueConstantsSet([0x63, 0x7C, 0x77, 0x7B, 0x1B, 0x0E]) # Obfuscate any constant with value >= 256 in security modules if "auth" in mod.name: return omvll.OpaqueConstantsLowerLimit(256) return omvll.OpaqueConstantsSkip() @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### omvll.LLVM_VERSION Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/versioning.rst Provides the version of LLVM used to compile O-MVLL. This is useful for understanding compatibility and build environment details. ```APIDOC ## omvll.LLVM_VERSION ### Description The version of LLVM used to compile O-MVLL. ### Example `14.0.6git` ``` -------------------------------- ### Strip Binary on Apple Release Builds Source: https://github.com/open-obfuscator/o-mvll/blob/main/src/CMakeLists.txt Adds a custom command to strip the OMVLL target binary on Apple platforms when building in Release mode and OMVLL_FORCE_LOG_DEBUG is not set. This reduces the binary size by removing symbols. ```cmake if(CMAKE_BUILD_TYPE MATCHES Release AND NOT OMVLL_FORCE_LOG_DEBUG) if(APPLE) add_custom_command( TARGET OMVLL COMMENT "Strip O-MVLL" POST_BUILD COMMAND ${CMAKE_STRIP} -x -S $ ) endif() endif() ``` -------------------------------- ### omvll.Module Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/llvm.rst Represents an LLVM module. This class provides methods for interacting with the LLVM module. ```APIDOC ## omvll.Module ### Description Represents an LLVM module. This class provides methods for interacting with the LLVM module. ### Methods (Members are inherited and undocumented) ``` -------------------------------- ### Configure Break Control Flow Pass in O-MVLL Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Apply the break control flow pass by returning True or BreakControlFlowOpt(True). This pass inserts opaque predicates and bogus branches to confuse static analysis. Configuration can be based on module names or the number of instructions in a function. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def break_control_flow(self, mod: omvll.Module, func: omvll.Function): # Apply to all functions in security-related modules if "auth" in mod.name or "crypto" in mod.name: return omvll.BreakControlFlowOpt(True) # Apply only to large functions elsewhere (more instructions = more impact) return func.nb_instructions > 20 @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### omvll.config_t Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/config.rst The configuration class for Open Obfuscator. It exposes various members for managing global settings. ```APIDOC ## omvll.config_t Class ### Description Represents the configuration object for the Open Obfuscator, providing methods and attributes to manage global settings. ### Members This class includes members inherited from its parent classes, as well as its own documented and undocumented members. Refer to the source code for a complete list of available methods and attributes. ``` -------------------------------- ### Configure Anti-Hooking Protection Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Implement `anti_hooking` to insert runtime integrity checks in function prologues. This detects and can abort/crash if the function has been tampered with by hooks. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def anti_hooking(self, mod: omvll.Module, func: omvll.Function): # Protect JNI entry points and payment/auth functions from hooking jni_prefix = ("Java_", "_JNIEnv") sensitive = ("verify", "authenticate", "purchase", "decrypt") name = func.demangled_name if func.name.startswith(jni_prefix) or any(s in name for s in sensitive): return omvll.AntiHookOpt(True) return False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure Global O-MVLL Obfuscation Behavior Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Set global obfuscation attributes in your `ObfuscationConfig` subclass. These settings control behavior across all modules and functions unless overridden by specific callbacks. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): # Force inline all JNI C++ wrapper methods (default: True) omvll.config.inline_jni_wrappers = True # Randomize function ordering in each module (default: True) # NOTE: must be False when using indirect_branch omvll.config.shuffle_functions = True # Globally exclude modules from ALL obfuscation passes omvll.config.global_mod_exclude = ["test_", "debug_module"] # Globally exclude functions from ALL obfuscation passes omvll.config.global_func_exclude = ["log_event", "dump_state"] # Seed for deterministic obfuscation (reproducible builds) omvll.config.probability_seed = 42 # Directory for O-MVLL output files (logs, IR dumps, etc.) omvll.config.output_folder = "/tmp/omvll-output/" # Control which pipeline phase each pass runs in: # Phase.Early = before LLVM optimizer, Phase.Last = after optimizer omvll.config.pass_phases = { omvll.Pass.StringEncoding: {omvll.Phase.Early}, omvll.Pass.Arithmetic: {omvll.Phase.Early}, omvll.Pass.BreakControlFlow: {omvll.Phase.Last}, omvll.Pass.ControlFlowFlattening:{omvll.Phase.Last}, omvll.Pass.OpaqueConstants: {omvll.Phase.Early, omvll.Phase.Last}, } def __init__(self): super().__init__() @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure Control Flow Flattening in O-MVLL Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Control control flow flattening by returning True or ControlFlowFlatteningOpt(True) to flatten. This pass transforms control flow graphs into dispatcher-based switch loops to hinder reverse engineering. It can be applied based on the number of instructions or specific function names. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def flatten_cfg(self, mod: omvll.Module, func: omvll.Function): # Flatten all functions with more than 5 instructions if func.nb_instructions > 5: return True # Or target specific functions by name sensitive = ["verify_license", "check_signature", "decrypt_payload"] if any(name in func.demangled_name for name in sensitive): return omvll.ControlFlowFlatteningOpt(True) return False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure Opaque Struct and Variable Access Obfuscation Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Implement `obfuscate_struct_access` and `obfuscate_variable_access` to obfuscate memory accesses. This prevents static analysis by introducing opaque pointer arithmetic. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def obfuscate_struct_access(self, mod: omvll.Module, func: omvll.Function, struct: omvll.Struct): # Obfuscate access to internal structs (not std lib types) if struct.name.startswith("struct.std::") or struct.name.startswith("class.std::"): return omvll.StructAccessOpt(False) return omvll.StructAccessOpt(True) def obfuscate_variable_access(self, mod: omvll.Module, func: omvll.Function, variable: omvll.GlobalVariable): # Obfuscate access to variables in security-sensitive functions if "auth" in func.demangled_name or "key" in variable.demangled_name.lower(): return omvll.VarAccessOpt(True) return omvll.VarAccessOpt(False) @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Find LLVM External Lit Tool Source: https://github.com/open-obfuscator/o-mvll/blob/main/src/test/CMakeLists.txt Locates the `llvm-lit` executable, prioritizing a pre-defined path or searching within the LLVM tools directory. It sets `LLVM_EXTERNAL_LIT` and prints a status message if found. ```cmake if(NOT LLVM_EXTERNAL_LIT OR NOT EXISTS ${LLVM_EXTERNAL_LIT}) if(EXISTS ${LLVM_TOOLS_DIR}/bin/llvm-lit) set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_DIR}/bin/llvm-lit) message(STATUS "Found llvm-lit: ${LLVM_EXTERNAL_LIT}") endif() endif() ``` -------------------------------- ### omvll.config Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/config.rst Access to the global configuration object. This attribute is associated with the omvll.config_t object, providing access to various configuration settings. ```APIDOC ## Global Configuration ### Description Provides access to the global configuration settings of the Open Obfuscator. ### Attribute `omvll.config` ### Type Associated with `omvll.config_t` ``` -------------------------------- ### Add Subdirectories in CMake Source: https://github.com/open-obfuscator/o-mvll/blob/main/src/CMakeLists.txt Includes subdirectories 'core', 'passes', and 'test' into the current CMake build. This is used to organize the project into modular components. ```cmake add_subdirectory("core") add_subdirectory("passes") add_subdirectory("test") ``` -------------------------------- ### Introspect LLVM IR Objects with Python Wrappers Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Use read-only Python wrappers around LLVM IR objects to inspect compilation units within obfuscation callbacks. This allows for targeted decisions on which obfuscation passes to apply. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def flatten_cfg(self, mod: omvll.Module, func: omvll.Function): # omvll.Module properties: # mod.identifier → full module path, e.g. "/src/auth/login.cpp" # mod.name → short name, e.g. "login.cpp" # mod.source_filename → original source filename # mod.data_layout → target data layout string # mod.instruction_count → total non-debug instructions # mod.dump("/tmp/ir.ll") → write IR to file # omvll.Function properties: # func.name → mangled name, e.g. "_ZN4Auth5LoginEv" # func.demangled_name → e.g. "Auth::Login()" # func.nb_instructions → instruction count in function print(f"Module: {mod.name} ({mod.instruction_count} instrs)") print(f"Function: {func.demangled_name} ({func.nb_instructions} instrs)") return func.nb_instructions > 10 def obfuscate_struct_access(self, mod: omvll.Module, func: omvll.Function, struct: omvll.Struct): # omvll.Struct properties: # struct.name → e.g. "struct.MyClass" or "class.std::string" return "std::" not in struct.name def obfuscate_variable_access(self, mod: omvll.Module, func: omvll.Function, var: omvll.GlobalVariable): # omvll.GlobalVariable properties: # var.name → mangled global name # var.demangled_name → demangled name return "g_secret" in var.demangled_name @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### omvll.Function Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/llvm.rst Represents an LLVM function. This class provides methods for interacting with LLVM functions. ```APIDOC ## omvll.Function ### Description Represents an LLVM function. This class provides methods for interacting with LLVM functions. ### Methods (Members are inherited and undocumented) ``` -------------------------------- ### omvll.Struct Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/llvm.rst Represents an LLVM structure type. This class provides methods for interacting with LLVM structure types. ```APIDOC ## omvll.Struct ### Description Represents an LLVM structure type. This class provides methods for interacting with LLVM structure types. ### Methods (Members are inherited and undocumented) ``` -------------------------------- ### Configure Indirect Calls for Specific Modules Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Use this to replace direct function calls with indirect ones for modules like 'crypto' or 'license'. This helps prevent static call graph reconstruction. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def indirect_call(self, mod: omvll.Module, func: omvll.Function): # Apply indirect calls to security-sensitive modules if "crypto" in mod.name or "license" in mod.name: return omvll.IndirectCallOpt(True) return False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Configure Arithmetic Obfuscation Rounds in O-MVLL Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Control arithmetic obfuscation by returning ArithmeticOpt with the desired number of rounds. Higher rounds increase obfuscation but may impact performance. This pass replaces standard operations with Mixed Boolean-Arithmetic (MBA) expressions. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): def __init__(self): super().__init__() def obfuscate_arithmetic(self, mod: omvll.Module, func: omvll.Function): # High-security functions: use 5 rounds for maximum obfuscation if "hash" in func.name or "encrypt" in func.name: return omvll.ArithmeticOpt(5) # Standard security functions: use default 3 rounds if "security" in mod.name: return omvll.ArithmeticOpt(True) # True → default 3 rounds # Skip arithmetic obfuscation elsewhere return False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### Link LLVM Libraries in CMake Source: https://github.com/open-obfuscator/o-mvll/blob/main/src/CMakeLists.txt Links the LLVM library to the OMVLL target. The specific library linked depends on the OMVLL_ABI setting, defaulting to ${llvm_libs} for non-Android builds. ```cmake if(OMVLL_ABI STREQUAL "Android") target_link_libraries(OMVLL PRIVATE LLVM) else() target_link_libraries(OMVLL PRIVATE ${llvm_libs} ) endif() ``` -------------------------------- ### Configure Indirect Branch Obfuscation Source: https://context7.com/open-obfuscator/o-mvll/llms.txt Implement `indirect_branch` to replace direct branches with indirect ones through computed addresses. This defeats basic static control flow analysis. Note: Function shuffling is disabled for compatibility. ```python import omvll from functools import lru_cache class MyConfig(omvll.ObfuscationConfig): # Disable function shuffling when using indirect branches (compatibility) omvll.config.shuffle_functions = False def __init__(self): super().__init__() def indirect_branch(self, mod: omvll.Module, func: omvll.Function): # Apply to all non-trivial functions if func.nb_instructions > 3: return omvll.IndirectBranchOpt(True) return False @lru_cache(maxsize=1) def omvll_get_config() -> omvll.ObfuscationConfig: return MyConfig() ``` -------------------------------- ### omvll.OMVLL_VERSION Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/versioning.rst Retrieves the current version of the O-MVLL library. This is the primary version identifier for the library. ```APIDOC ## omvll.OMVLL_VERSION ### Description The current O-MVLL version. ### Example `1.0.0` ``` -------------------------------- ### omvll.GlobalVariable Source: https://github.com/open-obfuscator/o-mvll/blob/main/doc/src/llvm.rst Represents an LLVM global variable. This class provides methods for interacting with LLVM global variables. ```APIDOC ## omvll.GlobalVariable ### Description Represents an LLVM global variable. This class provides methods for interacting with LLVM global variables. ### Methods (Members are inherited and undocumented) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.