All Projects → danleechina → Mixplaintext

danleechina / Mixplaintext

可对 Xcode 项目工程所有的 objective-c 文件内包含的明文进行加密混淆,提高逆向分析难度。

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Mixplaintext

Androidlibrary
Android library to reveal or obfuscate strings and assets at runtime
Stars: ✭ 162 (+6.58%)
Mutual labels:  encryption, reverse-engineering
Whatsapp Web Reveng
Reverse engineering WhatsApp Web.
Stars: ✭ 5,320 (+3400%)
Mutual labels:  encryption, reverse-engineering
Simple Polymorphic Engine Spe32
Simple Polymorphic Engine (SPE32) is a simple polymorphic engine for encrypting code and data. It is an amateur project that can be used to demonstrate what polymorphic engines are.
Stars: ✭ 59 (-61.18%)
Mutual labels:  encryption, reverse-engineering
Nauz File Detector
Linker/Compiler/Tool detector for Windows, Linux and MacOS.
Stars: ✭ 146 (-3.95%)
Mutual labels:  reverse-engineering
Native Shim
A "shim" for loading native jni files for Android active debugging
Stars: ✭ 145 (-4.61%)
Mutual labels:  reverse-engineering
Droidreverse
reverse engineering tools for android(android 逆向工程工具集)
Stars: ✭ 1,839 (+1109.87%)
Mutual labels:  reverse-engineering
Discordcrypt
End-To-End File & Message Encryption For Discord
Stars: ✭ 150 (-1.32%)
Mutual labels:  encryption
Xpeviewer
PE file viewer/editor for Windows, Linux and MacOS.
Stars: ✭ 144 (-5.26%)
Mutual labels:  reverse-engineering
Legu unpacker 2019
Scripts to unpack APK protected by Legu
Stars: ✭ 150 (-1.32%)
Mutual labels:  reverse-engineering
Apiscout
This project aims at simplifying Windows API import recovery on arbitrary memory dumps
Stars: ✭ 146 (-3.95%)
Mutual labels:  reverse-engineering
Ghidra Switch Loader
Nintendo Switch loader for Ghidra
Stars: ✭ 146 (-3.95%)
Mutual labels:  reverse-engineering
Triton
Triton is a Dynamic Binary Analysis (DBA) framework. It provides internal components like a Dynamic Symbolic Execution (DSE) engine, a dynamic taint engine, AST representations of the x86, x86-64, ARM32 and AArch64 Instructions Set Architecture (ISA), SMT simplification passes, an SMT solver interface and, the last but not least, Python bindings.
Stars: ✭ 1,934 (+1172.37%)
Mutual labels:  reverse-engineering
Mviewer
Reverse Engineer MView 3D File Format
Stars: ✭ 148 (-2.63%)
Mutual labels:  reverse-engineering
Mega.py
Python library for the https://mega.nz/ API.
Stars: ✭ 145 (-4.61%)
Mutual labels:  encryption
Panda
Platform for Architecture-Neutral Dynamic Analysis
Stars: ✭ 1,993 (+1211.18%)
Mutual labels:  reverse-engineering
Magisk Frida
🔐 Run frida-server on boot with Magisk, always up-to-date
Stars: ✭ 144 (-5.26%)
Mutual labels:  reverse-engineering
Validity90
Reverse engineering of Validity/Synaptics 138a:0090, 138a:0094, 138a:0097, 06cb:0081, 06cb:009a fingerprint readers protocol
Stars: ✭ 1,807 (+1088.82%)
Mutual labels:  reverse-engineering
Android Analysis
Getting Genymotion & Burpsuite setup for Android Mobile App Analysis
Stars: ✭ 146 (-3.95%)
Mutual labels:  reverse-engineering
Steamkit
SteamKit2 is a .NET library designed to interoperate with Valve's Steam network. It aims to provide a simple, yet extensible, interface to perform various actions on the network.
Stars: ✭ 1,926 (+1167.11%)
Mutual labels:  reverse-engineering
Stuff
Unsorted, raw, ugly & probably poorly usable tools for reversing, exploit and pentest
Stars: ✭ 146 (-3.95%)
Mutual labels:  reverse-engineering

If you need English document for this project, MixPlainText English document

重要

目前想到一个更好的方案,就是使用 Lex (最新的实现叫做 Flex,这个工具在 macOS 上自带) (这个工具也叫做词法分析器的生成器)。后面有时间再更新。

MixPlainText

该项目的作用是可以将 iOS 工程所有 Objective C 实现文件(后缀名为 m 的文件)中的明文进行加密混淆,如此一来,您的 app 的二进制文件中所有的明文都是经过混淆的。之前我总结了一点如何确保 iOS app 在越狱环境下的安全性,或许值得一看:对 iOS app 进行安全加固

特点

  1. 简单,开发人员可以硬编码明文字符串,所有的加密会在编译开始时自动处理
  2. 可自定义加密或者混淆方式,(为了不影响 app 运行效率,需要提供一个简单快速的加密或混淆方式)提高逆向难度

局限

  1. 不能加密这样的 OC string,比如:@"a""b",因为默认的正则表达式无法识别这种情况,确保将其改成 @"ab",否则无法通过编译。
  2. Mix 处理过程中如果遇到 "@",这种字符串,会编译出错,需要改一下写法,使用下面的 cs 变量
NSString *s = @"@";
char *cs = s.UTF8String;
  1. 不能加密含 \nnn, \xnn, \unnnn 和 \Unnnnnnnn 这样的转义字符串,确保您的转义字符串不含这些转义,否则无法通过编译。
  2. 不能加密静态类型的 string。

使用场景

  1. 使用私有 API,将加密操作交给 MixPlainText,只要不在审核期间调用,一般能够通过审核
  2. 提高逆向分析难度,因为所有明文都是经过加密混淆的,逆向分析需要先解密

使用方式

  1. 打开您自己的工程,在 Build Phases 中添加 Run Script,内容为

    # 默认是 Debug 情况下运行,可根据需要自定义,比如 Release
    if [ "${CONFIGURATION}" = "Debug" ]; then
    # 注意由于你的工程目录可能包含 Pods 这类第三方代码,所以你需要切换到你自己代码所在的目录比如 MixIosDemo 目录
    cd MixIosDemo
    chmod +x ../mix.swift
    ../mix.swift
    fi
    

    确保该 Run Script 在 Compile Souces 之前。

  2. 添加 MixIosDemo/MixOC/MixDecrypt.h 到您的工程中

  3. 在您的 pch 头文件中引入 MixDecrypt.h

  4. 如果遇到代码编译不过的问题,请到编译出错的地方比较原先的代码和经过 mix.swift 脚本加密过后的区别,然后对原始代码进行一些相应修改。当然你可以给我提 issue。

您可以参考 MixIosDemo 这个 iOS Demo 工程来了解具体配置方式。在运行这个工程的时候,你会发现代码中的 NSLog(@"Hello world!"); 变成了 NSLog(dl_getRealText(@"t5qTk5DfiJCNk5ve/wE=")); ,但是 app 运行的时候打印的仍然是 Hello world!

自定义加密混淆

目前默认的加密方式是异或加密(可能也算不上加密,顶多算是混淆),如果需要自定义加密混淆方式,两个步骤:

  1. 修改 MixIosDemo/mix.swift 中的加密方法
  2. 修改 MixDecrypt.h 中 dl_getRealText 函数体的解密方法

注意,不要使用复杂的加解密方法,同时解密方法要和加密方法配套,否则运行时会出错。

Warning

由于该程序会改变您原来程序代码的内容,所以您在使用的时候一定要谨慎,最好是在版本控制系统(比如 Git,SVN)下使用,同时当前工作目录没有未 commit 的内容。

TODO

  1. 支持 C 类型的字符串
  2. 增加支持更多的文件类型,比如 mm 文件, h 文件,pch 文件, c 文件, cpp 文件等

贡献者

作者: @粉碎音箱的音乐(weibo)

Blog: Blog

需要 Star!

如果你觉得 MixPlainText 有用的话,请点个 star 呗!谢谢啦。😄

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].