All Projects → chenxiancai → Stcobfuscator

chenxiancai / Stcobfuscator

Licence: mit
iOS全局自动化 代码混淆 工具!支持cocoapod组件代码一并 混淆,完美避开hardcode方法、静态库方法和系统库方法!

Projects that are alternatives of or similar to Stcobfuscator

SharpLoader
🔮 [C#] Source code randomizer and compiler
Stars: ✭ 36 (-95.14%)
Mutual labels:  runtime, obfuscator
Furikuri
(In dev)furikuri is framework for code protection
Stars: ✭ 103 (-86.08%)
Mutual labels:  obfuscator, reverse-engineering
Avscript
Avast JavaScript Interactive Shell
Stars: ✭ 643 (-13.11%)
Mutual labels:  reverse-engineering
Raftlib
The RaftLib C++ library, streaming/dataflow concurrency via C++ iostream-like operators
Stars: ✭ 717 (-3.11%)
Mutual labels:  runtime
Whaler
Program to reverse Docker images into Dockerfiles
Stars: ✭ 670 (-9.46%)
Mutual labels:  reverse-engineering
Die Engine
DIE engine
Stars: ✭ 648 (-12.43%)
Mutual labels:  reverse-engineering
Orogene
A next-generation platform and package manager for Node.js-compatible and frontend JavaScript projects!
Stars: ✭ 695 (-6.08%)
Mutual labels:  runtime
Runq
run regular Docker images in KVM/Qemu
Stars: ✭ 616 (-16.76%)
Mutual labels:  runtime
Galaxybudsclient
Unofficial Galaxy Buds Client for Windows
Stars: ✭ 733 (-0.95%)
Mutual labels:  reverse-engineering
Rizin
UNIX-like reverse engineering framework and command-line toolset.
Stars: ✭ 673 (-9.05%)
Mutual labels:  reverse-engineering
Messagethrottle
A lightweight Objective-C message throttle and debounce library.
Stars: ✭ 710 (-4.05%)
Mutual labels:  runtime
Ksm
A fast, hackable and simple x64 VT-x hypervisor for Windows and Linux. Builtin userspace sandbox and introspection engine.
Stars: ✭ 673 (-9.05%)
Mutual labels:  reverse-engineering
Textractor
Extracts text from video games and visual novels. Highly extensible.
Stars: ✭ 656 (-11.35%)
Mutual labels:  reverse-engineering
Ghidra
Ghidra is a software reverse engineering (SRE) framework
Stars: ✭ 30,371 (+4004.19%)
Mutual labels:  reverse-engineering
Makin
makin - reveal anti-debugging and anti-VM tricks [This project is not maintained anymore]
Stars: ✭ 645 (-12.84%)
Mutual labels:  reverse-engineering
Spirit
🙌 Play Spirit animations on the web
Stars: ✭ 719 (-2.84%)
Mutual labels:  runtime
Andromeda
Andromeda - Interactive Reverse Engineering Tool for Android Applications
Stars: ✭ 627 (-15.27%)
Mutual labels:  reverse-engineering
Vivisect
Stars: ✭ 672 (-9.19%)
Mutual labels:  reverse-engineering
Yakpro Po
YAK Pro - Php Obfuscator
Stars: ✭ 678 (-8.38%)
Mutual labels:  obfuscator
Runtime
A Swift Runtime library for viewing type info, and the dynamic getting and setting of properties.
Stars: ✭ 736 (-0.54%)
Mutual labels:  runtime

STCObfuscator

STCObfuscator 是用来进行object-c代码混淆的工具,在模拟器DEBUG环境下运行生成混淆宏,
混淆的宏可以在其他环境下进行编译,支持Cocoapod代码混淆.

怎么使用!

相关博客:https://blog.csdn.net/cating1314/article/details/80189295

如果你的工程支持cocoapod,你可以直接添加!
pod "STCObfuscator"(注:请用最新版本,最好更新下master repo)

把下面的代码加入到Appdelegate didFinishLaunchingWithOptions方法里,

#import "STCObfuscator.h"

#if (DEBUG == 1)
    [[STCObfuscator obfuscatorManager] confuseWithRootPath:[NSString stringWithFormat:@"%s", STRING(ROOT_PATH)] resultFilePath:[NSString stringWithFormat:@"%@/STCDefination.h", [NSString stringWithFormat:@"%s", STRING(ROOT_PATH)]] linkmapPath:[NSString stringWithFormat:@"%s", STRING(LINKMAP_FILE)]];
#endif

然后完成下面步骤的设置

image

步骤1、

在 Build Settings->Preprocessor Macros->DEBUG 中添加环境变量
LINKMAP_FILE=$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt 
和
ROOT_PATH="${SRCROOT}" 
(注:工程尽量不要放在中文路径下)

image

步骤2、

在 Build Settings 开启Write Link Map File, 设置成 YES

image

步骤3、

将下面的脚本添加到 Build Phases
dir=${SRCROOT}
file_count=0
file_list=`ls -R $dir 2> /dev/null | grep -v '^$'`
for file_name in $file_list
do
temp=`echo $file_name | sed 's/:.*$//g'`
if [ "$file_name" != "$temp" ]; then
cur_dir=$temp
else
if [ ${file_name##*.} = a ]; then
    find -P $dir -name $file_name > tmp.txt
    var=$(cat tmp.txt)
    nm $var > ${file_name}.txt
    rm tmp.txt
fi
if [ ${file_name##*.} = framework ]; then
    find -P $dir -name ${file_name%%.*} > tmp.txt
    var=$(cat tmp.txt)
    nm $var > ${file_name}.txt
    rm tmp.txt
    fi
fi
done

image

步骤4、

在预编译文件最前面中添加以下代码
#if (DEBUG != 1)
#import "STCDefination.h"
#endif

image

步骤5、

在DEBUG环境下用模拟器运行工程,在STCDefination.h头文件中生成混淆的宏。
所有的混淆符号会保留在工程目录下的confuse.json。 

image

可用于bug上报后反混淆的文件

image

步骤6、

把工程目录下STCDefination.h头文件加入工程。
混淆后,如果工程增加代码,需要再次混淆,先清空STCDefination.h里面的内容,不能留任何空格和换行,然后pod update,再次在模拟器DEBUG环境下运行。

image

步骤7、

在 RELEASE 环境下运行工程,实现代码混淆。 
混淆前逆向。 

image

混淆后逆向。 

image

English steps ⬇︎

STCObfuscator is an Objective-C obfuscator for Mach-O executables, 
a runtime utility for obfuscating Objective-C class,it also support cocoapod file confusing!

How to use it!

You can use STCObfuscator with cocoapod!
pod "STCObfuscator"
after you add under code to your project

#import "STCObfuscator.h"

#define STRING(str) _STRING(str)
#define _STRING(str) #str

#if (DEBUG == 1)
    [[STCObfuscator obfuscatorManager] confuseWithRootPath:[NSString stringWithFormat:@"%s", STRING(ROOT_PATH)] resultFilePath:[NSString stringWithFormat:@"%@/STCDefination.h", [NSString stringWithFormat:@"%s", STRING(ROOT_PATH)]] linkmapPath:[NSString stringWithFormat:@"%s", STRING(LINKMAP_FILE)]];
#endif

you should finish steps:

step 1、

add 
LINKMAP_FILE=$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt 
and 
ROOT_PATH="${SRCROOT}" 
to Build Settings Preprocessor Macros 

step 2、

enable Write Link Map File in Build Settings, set YES

step 3、

add shell script to Build Phases
dir=${SRCROOT}
file_count=0
file_list=`ls -R $dir 2> /dev/null | grep -v '^$'`
for file_name in $file_list
do
temp=`echo $file_name | sed 's/:.*$//g'`
if [ "$file_name" != "$temp" ]; then
cur_dir=$temp
else
if [ ${file_name##*.} = a ]; then
    find -P $dir -name $file_name > tmp.txt
    var=$(cat tmp.txt)
    nm $var > ${file_name}.txt
    rm tmp.txt
fi
if [ ${file_name##*.} = framework ]; then
    find -P $dir -name ${file_name%%.*} > tmp.txt
    var=$(cat tmp.txt)
    nm $var > ${file_name}.txt
    rm tmp.txt
    fi
fi
done

step 4、

import STCDefination.h to PrefixHeader File like this:
#if (DEBUG != 1)
#import "STCDefination.h"
#endif

step 5、

run project in DEBUG environment with iPhone simulator to generate confuse macros in STCDefination.h.
all confused symbols will save to confuse.json in project catalog. 

step 6、

add STCDefination.h.

step 7、

run project in RELEASE environment that class confused. 

技术交流或合作讨论请加QQ群

image

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].