finds.dev← search

// the find

CoderMJLee/MJCodeObfuscation

★ 599 · C · MIT · updated Jan 2020

一个用于代码混淆和字符串加密的Mac小Demo

A Mac desktop tool that uses libclang to parse Objective-C source trees and generate `#define` macros that rename classes and methods to random strings, plus a XOR-based string encryptor. It's aimed at iOS/macOS developers who want basic symbol obfuscation before App Store submission or to frustrate casual reverse engineering. The author is explicit that this is a demo, not a production tool.

Uses libclang's AST rather than regex-based text substitution, so it actually understands the code structure instead of blindly replacing tokens. The macro-based approach is clever: the renamed symbols live entirely in a header file imported via PCH, so the original source is untouched and you can revert by removing the import. String encryption works on both NSString literals and C string literals, which most simple tools miss. The code is small enough (~500 lines of real logic) that you can actually read and adapt it rather than treating it as a black box.

Last commit is January 2020 — six years of Xcode, SDK, and compiler changes have gone by untouched, and there's no indication it still builds. The XOR encryption is trivially reversible: the factor and length are stored in plaintext next to the ciphertext in the same struct, so a five-minute Frida session recovers all strings. It only handles class and method names; protocols, properties, ivars, and category methods are explicitly left as an exercise, meaning a real app would still leak a lot of surface area. No collision detection on the random identifiers, so on a large codebase you could silently get two symbols mapped to the same random name.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →