惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog
W
WeLiveSecurity
P
Proofpoint News Feed
月光博客
月光博客
NISL@THU
NISL@THU
L
LINUX DO - 最新话题
Webroot Blog
Webroot Blog
T
Threatpost
Y
Y Combinator Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threat Research - Cisco Blogs
Vercel News
Vercel News
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
S
Schneier on Security
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
小众软件
小众软件
MyScale Blog
MyScale Blog
N
News and Events Feed by Topic
Stack Overflow Blog
Stack Overflow Blog
有赞技术团队
有赞技术团队
The Hacker News
The Hacker News
Schneier on Security
Schneier on Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
Recent Announcements
Recent Announcements
S
Security @ Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Securelist
T
The Exploit Database - CXSecurity.com
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
雷峰网
雷峰网
量子位
Google DeepMind News
Google DeepMind News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy
L
Lohrmann on Cybersecurity
I
Intezer
T
The Blog of Author Tim Ferriss
G
GRAHAM CLULEY
D
DataBreaches.Net
V
Vulnerabilities – Threatpost
P
Privacy & Cybersecurity Law Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
罗磊的独立博客

博客园 - 至尊王者

使用 Android Lua Helper 在VSCODE中调试安卓Lua应用 lua语言特性及用途 Ollvm混淆与反混淆: goron框架字符串加密的实现原理 Ollvm混淆与反混淆: Goron框架编译与使用 reinterpret_cast和其它cast的区别 雷电9中使用Fiddler抓包 ubuntu 22.04离线安装cuda 11.7.1、cudnn 8.9.3.28、nccl 2.18.3、tensorrt 8.6.1 C/C++程序隐藏符号 配置ETH 2.0 同步节点 Nethermind & Prysm rust在windows上编译openssl mac 远程桌面 the user account did not work的解决办法 MacOS静态编译ffmpeg 4.4.1、x264、x265等编解码库的脚本 Linux、Windows静态编译ffmpeg 4.4.1、x264、x265等编解码库的脚本 Visual Studio 2022 Key 在Docker中安装宝塔面板 idea/clion行注释位置(不在首列,注释就靠近代码块) linux手动编译llvm/clang linux与windows双系统保持时间同步 Puppeteer: 等待打开一个新页面
安卓使用OLLVM混淆.so
至尊王者 · 2024-04-02 · via 博客园 - 至尊王者

编译OLLVM

git clone https://github.com/heroims/obfuscator.git -b llvm-9.0.1 --depth 1
cd obfuscator
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4

编译好后从build/bin/目录把下面几个文件拷贝到/toolchains/llvm/prebuilt/linux-x86_64/bin/
clangclang++clang-9.0clang-format
把以下几个文件从build/include/拷贝到/sysroot/usr/include/
Stdarg.hStddef.h__stddef_max_align_t.hfloat.hstdbool.h

命令和编译选项简介

  • fla:控制流扁平化;该选项使用函数级别的混淆来隐藏程序的结构。这通过随机重命名函数、添加不必要的控制流和删除调用的函数来实现。
    这个模式主要是把一些if-else语句,嵌套成do-while语句,增加了反编译和分析代码的难度。

    -mllvm -fla:激活控制流扁平化

  • split:该选项使用控制流混淆来增加程序的复杂性。这通过将函数分成几个基本块、添加随机的跳转指令和在运行时随机重组这些基本块来实现。这使得代码的流程更难以跟踪,从而增加了破解和反编译的难度。

    -mllvm -split:激活基本块分割。在一起使用时改善展平。
    -mllvm -split_num=3:如果激活了传递,则在每个基本块上应用3次。默认值:1

  • sub:指令替换;该选项使用字符串混淆来隐藏代码中的常量字符串。这通过将字符串分成几个小块、将其存储在数组中并在运行时重新组合来实现。
    这个模式主要用功能上等效但更复杂的指令序列替换标准二元运算符(+ , – , & , | 和 ^),使得分析代码和查找敏感信息更加困难。

    -mllvm -sub:激活指令替换
    -mllvm -sub_loop=3:如果激活了传递,则在函数上应用3次。默认值:1

  • bcf:虚假控制流程;该选项使用基本块级别的混淆来隐藏代码的结构。这通过改变基本块之间的控制流、添加不必要的基本块和移除基本块之间的条件分支来实现。这个模式主要嵌套几层判断逻辑,一个简单的运算都会在外面包几层if-else,所以这个模式加上编译速度会慢很多因为要做几层假的逻辑包裹真正有用的代码。

    另外说一下这个模式编译的时候要浪费相当长时间包哪几层不是闹得!

    -mllvm -bcf:激活虚假控制流程
    -mllvm -bcf_loop=3:如果激活了传递,则在函数上应用3次。默认值:1
    -mllvm -bcf_prob=40:如果激活了传递,基本块将以40%的概率进行模糊处理。默认值:30

  • sobf:源代码混淆;该选项使用源代码混淆技术来隐藏代码的逻辑和结构。这通过使用类似加密的方式对代码进行变换,使其难以理解和分析。这可以通过运行时解密来执行,从而隐藏代码的真实功能。
    变量名混淆:将变量名更改为随机字符串,使其难以理解。
    控制流混淆:改变代码的控制流程,增加条件分支和跳转,使代码更难以分析。
    字符串加密:将字符串加密,以防止明文字符串在二进制文件中可见。
    函数名混淆:将函数名更改为随机名称,增加代码的复杂性。

    -mllvm -sobf:激活源代码混淆
    -mllvm -aesSeed=0xada46ab5da824b96a18409c49dc91dc3:用于为 AES 加密提供一个种子值,从而生成随机数以增加混淆的难度。这有助于保护软件免受逆向工程的攻击,因为它会使得分析混淆后的代码更加困难。

单个函数混淆:

__attribute((__annotate__("bcf")))
__attribute((__annotate__("fla")))
__attribute((__annotate__("sub")))
__attribute((__annotate__("split")))
__attribute((__annotate__("sobf")))