de4dot FAQ

How to deobfuscate but make sure metadata tokens stay the same?

--preserve-tokens will preserve all important metadata tokens, the #US and #Blob heaps, and keep junk data in signatures.

--keep-types should normally also be used. If used, no obfuscator types or methods will be removed.

Most of the time you don‘t need to preserve the method parameters‘ metadata tokens. You can use--preserve-table all,-pd which will preserve all important tokens except the parameter tokens.

--dont-rename or --keep-names can also sometimes be necessary. For example, if you‘re deobfuscating Confuser obfuscated assemblies, then --keep-names d will rename everything except fields in delegate types.

If the file has been obfuscated by an unsupported obfuscator, then all tokens are preserved by default.

Examples:

Preserve all important tokens, #US heap, #Blob heap, junk sig data, and don‘t remove any obfuscator types/methods:

de4dot --preserve-tokens --keep-types file.dll

Preserve all tokens except parameter tokens, and don‘t rename fields in delegate types:

de4dot --keep-names d --preserve-table all,-pd file.dll

An assembly has been obfuscated by two or more supported obfuscators. How do I deobfuscate the assembly?

If two or more obfuscators are detected, de4dot will print that and a description on how to force detection of one of them.

You need to figure out in which order the obfuscators were used and deobfuscate it in reverse order. You should also use --preserve-tokens to preserve metadata tokens in case the next obfuscator uses hard coded metadata tokens to decrypt eg. strings.

The -p XX option can be used to force detection of an obfuscator, where XX is the type of the obfuscator. de4dot -h will show all types.

Assume filename.dll has been obfuscated by sa followed by ef, then you should use these commands:

de4dot --preserve-tokens --dont-rename filename.dll -p ef -o tmp.dll
de4dot tmp.dll -p sa -o cleaned-file.dll
del tmp.dll

The output will be in cleaned-file.dll.

How do I decrypt strings in an assembly obfuscated by an unsupported obfuscator?

First you must figure out the metadata token of the string decrypter. You can use Simple Assembly Explorer (SAE). Locate the string decrypter and hover the mouse over the method name and you should see something like 06001234. That‘s the method‘s metadata token. The following command will dynamically decrypt the strings:

de4dot filename.dll --strtyp delegate --strtok 06001234

If it has more than one string decrypter, just append more --strtok 06xxxxxx like so:

de4dot filename.dll --strtyp delegate --strtok 06001234 --strtok 06001235 --strtok 06001236

--strtyp delegate will create a dynamic method and simply call the string decrypter and let it decrypt the string for us. --strtype emulate needs to be used if the string decrypter detects dynamic methods. If you suspect the assembly to be malware, you should only do this in a sandbox since unknown code is executed.

What could be the reason for an assembly to crash if it‘s been renamed?

If it‘s a supported obfuscator, renaming should always work, except in a few cases.

It could happen when a resource isn‘t renamed when the class that uses it has been renamed.

It could also happen if you deobfuscate an assembly, A.dll, but there‘s another assembly, B.dll, that has a reference to A, and that reference has been renamed in A.dll but not in B.dll. In this case, you must deobfuscate both A.dll and B.dll to make sure all references to A.dll in B.dll also are renamed.

de4dot A.dll B.dll

After deobfuscating a .NET Reactor obfuscated assembly, I see methods with only a throw (uint)-559038242 statement.

That throw is actually throw 0xDEADCODE. Those methods are encrypted native (x86 code) methods and the throw won‘t execute at run time. The method body will be replaced with the real method at run time by the obfuscator‘s methods decryptor. You‘ll know when there are native methods left in the image if you see something like this after deobfuscation:

Re-encrypted 10/73 native methods

In this example, there are 10 methods left that are still native methods. The remaining 63 methods were converted back to CIL code or deleted from the image. A future version of de4dot may convert the remaining native methods back to CIL code.

时间: 2024-10-13 14:11:10

de4dot FAQ的相关文章

官方问答--微信小程序常见FAQ (17.8.21-17.8.27)

给提问的开发者的建议:提问之前先查询 文档.通过社区右上角搜索搜索已经存在的问题. 写一个简明扼要的标题,并且正文描述清楚你的问题. 提交 BUG:需要带上基础库版本号,设备信息(iOS, Android,开发工具等等),操作系统信息(系统版本),以及可以让他人重现的信息,最好能够提供重现 demo. 对于提供信息过少的问题,会直接关闭,请提供完整信息以后重新打开问题.另外,对于如何做某某功能,可否做某某功能的问题,会直接关闭. 微信小程序常见FAQ(17.8.21-17.8.27) Q:1.5

.Net脱壳工具 de4dot参数说明/简易教程

de4dot  /? 帮助原文 使用方法 de4dot "d:\xx.exe" -p xc -p xc 指定壳类型 , 这里是xc,表示Xenocode壳.这样会在exe的相同目录生成一个 xx_cleaned.exe 的文件, 拖进ILSpy什么的去看代码吧.要指定输出路径请使用 -o "d:\output\xx.exe" 一般选对壳了大部分都可以脱掉,脱不掉的首先尝试使用最新版的de4dot, 脱完之后一部分类/方法名会恢复, 另一部分会变成Class123,.

Discuz 7.2 faq.php漏洞分析

漏洞发生在页面faq.php中,源码如下: elseif($action == 'grouppermission') {ksort($gids); $groupids = array(); foreach($gids as $row) { $groupids[] = $row[0]; } $query = $db->query("SELECT * FROM {$tablepre}usergroups u LEFT JOIN {$tablepre}admingroups a ON u.gro

工作笔记20170315-------关于FAQ(Frequently Asked Questions)列表的代码

源自于:http://www.17sucai.com/pins/3288.html (1)FAQ问答列表点击展开收缩文字列表 <ul>   <li class="clearfix">   <h5><b class="UI-ask"></b>什么是享赢棋牌联盟?</h5>   <div class="foldContent">   <p>享赢棋牌联盟是杭

FAQ: Automatic Statistics Collection (文档 ID 1233203.1)

In this Document   Purpose   Questions and Answers   What kind of statistics do the Automated tasks collect   How do I revert to a previous set of statistics?   Does the automatic statistic collection jobs populate CHAIN_CNT?   11g+ Automatic Mainten

FAQ: Python中if __name__ == &#39;__main__&#39;:作用

#hello.pydef sayHello(): str="hello" print(str); if __name__ == "__main__": print ('This is main of module "hello.py"') sayHello() python作为一种脚本语言,我们用python写的各个module都可以包含以上那么一个类似c中的main函数,只不过python中的这种__main__与c中有一些区别,主要体现在:

高手问答精选:Go 语言 —— 云计算时代的 C 语言(类似于一个FAQ)

Go 语言被称为云计算时代的 C 语言,它在软件开发效率和运行效率之间做出了绝佳的权衡.这使得它既适应于互联网应用的极速开发,又能在高并发.高性能的开发场景中如鱼得水.正因如此,许多互联网公司,尤其是云计算领域的创业公司都选择 Go 语言作为其技术栈的重要组成部分.因此,对于广大的开发者而言,关注和学习 Go 语言就十分有必要了. 在高手问答第 149 期中,我们围绕 Go 进行了提问,并邀请了 @hyper0x(郝林)作为高手嘉宾. 本文整理了此次高手问答中一些精彩的问答. Go 语言使用场景

python 学习之FAQ:find 与 find_all 使用

FAQ记录 1. 错误源码 错误源码如下 def fillUnivList(_html,_ulist): soup =BeautifulSoup(_html,'html.parser') for tr in soup.find_all('tbody').children: if isinstance(tr,bs4.element.Tag): tds = tr.find_all('td') _ulist.append((tds[0].string,tds[1].string,tds[3].stri

de4dot - Deobfuscator for .NET

Features Here's a pseudo random list of the things it will do depending on what obfuscator was used to obfuscate an assembly: Inline methods. Some obfuscators move small parts of a method to another static method and calls it. Decrypt strings statica