-
Notifications
You must be signed in to change notification settings - Fork 3
Add mention for Swift projects via -load-pass-plugin option
#13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
sevilS marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,19 +8,24 @@ weight = 10 | |
|
|
||
| O-MVLL is a code obfuscator based on LLVM and designed to work with Android and iOS toolchains. | ||
| It supports AArch64 and AArch32 as target architectures. Theoretically, it could be run as | ||
| simply as using the compiler flag `-fpass-plugin=`, as follows: | ||
| simply as using the Clang compiler flag `-fpass-plugin=`, or, starting with Xcode 26, on Swift | ||
| projects via the Swift compiler's `-load-pass-plugin=` option, as follows: | ||
|
||
|
|
||
| ```cpp | ||
| # Create/edit './omvll_config.py' to configure the obfuscator and run: | ||
| # Create/edit './omvll_config.py' to configure the obfuscator and | ||
| # run Clang for C/C++/Objective-C projects: | ||
|
||
| $ clang -fpass-plugin=OMVLL.{so, dylib} main.c -o main | ||
|
|
||
| # For Swift projects: | ||
| $ swiftc -load-pass-plugin=OMVLL.{dylib} main.swift -o main | ||
|
||
| ``` | ||
|
|
||
| **Practically, there are additional configuration steps.** | ||
|
|
||
|
|
||
| ### O-MVLL Configuration File | ||
|
|
||
| Firstly, the O-MVLL Python configuration file is not always located next to the clang binary and we might want | ||
| We refer to the Clang compiler (`-fpass-plugin` option) for the configuration, though the same applies to Swift. | ||
| Firstly, the O-MVLL Python configuration file is not always located next to the compiler binary and we might want | ||
|
||
| to change the name of the file. | ||
|
|
||
| By default, O-MVLL tries to import `omvll_config.py` from **the current directory** in which **clang is called**. | ||
|
|
@@ -522,14 +527,21 @@ Finally: | |
|
|
||
| ## iOS | ||
|
|
||
| Using O-MVLL with Xcode is a bit easier than Android since we don't need to deal with different `libstdc++/libc++`. | ||
| To enable O-MVLL, one needs to set the following in Xcode: | ||
| Using O-MVLL with Xcode is a bit easier than Android since we don't need to deal | ||
| with different `libstdc++/libc++`. When targeting C/C++/Objective-C projects, O-MVLL | ||
| can be invoked by adding `-fpass-plugin=/path/to/omvll.dylib` under the following | ||
| Xcode setting: | ||
|
|
||
| `Build Settings > Apple Clang - Custom Compiler Flags > Other C/C++ Flags` | ||
|
|
||
| and add `-fpass-plugin=<path>/omvll_xcode_15_2.dylib`. For versions targeting Xcode 14.5 and lower, the legacy pass manager | ||
| For versions targeting Xcode 14.5 and lower, the legacy pass manager | ||
| needs to be disabled as well via `-fno-legacy-pass-manager`. | ||
|
|
||
| Likewise, when targeting Swift projects, O-MVLL can be enabled by specifying | ||
| `-load-pass-plugin=/path/to/omvll.dylib` under the setting: | ||
|
|
||
| `Build Settings > Swift Compiler - Custom Flags > Other Swift Flags` | ||
|
|
||
| Finally, we can create an `omvll.yml` file next to the `*.xcodeproj` file which defines `OMVLL_PYTHONPATH` and `OMVLL_CONFIG`. | ||
|
|
||
| Et voila :) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds a bit convoluted to me. What about
O-MVLL is an LLVM-based obfuscator that leverages the new LLVM pass manager. It integrates via -fpass-plugin in Clang or -load-pass-plugin in the Swift compiler (starting with Xcode 26) to perform native code obfuscation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I'd add a note saying something like "throughout this docu, whenever we refer to Clang we mean the host compiler being used, which can be Clang or the Swift compiler"