<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Trace Flight</title>
		<description>追寻飞翔的痕迹</description>
		<link>/</link>
		<atom:link href="/" rel="self" type="application/rss+xml" />
		
			<item>
				<title>Android Malware Datasets</title>
				<description>&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;新搭建了个人博客，文章全部转到&lt;a href=&quot;http://blog.datarepo.cn&quot;&gt;http://blog.datarepo.cn&lt;/a&gt;上更新。&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Android malware datasets.&lt;/p&gt;

&lt;/blockquote&gt;

&lt;h2 id=&quot;1-android-malware-genome-project&quot;&gt;1. &lt;a href=&quot;http://www.malgenomeproject.org/&quot;&gt;Android Malware Genome Project&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;In this project, we focus on the Android platform and aim to systematize or characterize existing Android malware. Particularly, with more than one year effort, we have managed to collect more than 1,200 malware samples that cover the majority of existing Android malware families, ranging from their debut in August 2010 to recent ones in October 2011.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt;
&lt;a href=&quot;http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6234407&amp;amp;tag=1&quot;&gt;Dissecting Android Malware: Characterization and Evolution.&lt;/a&gt;
Yajin Zhou, Xuxian Jiang.
Proceedings of the 33rd IEEE Symposium on Security and Privacy (Oakland 2012). 
San Francisco, CA, May 2012&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt; (No longer supported)
&lt;a href=&quot;http://www.malgenomeproject.org&quot;&gt;http://www.malgenomeproject.org&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;2-m0droid-dataset&quot;&gt;2. &lt;a href=&quot;http://m0droid.netai.net/modroid/&quot;&gt;M0Droid Dataset&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;M0Droid basically is android application behavioral pattern recognition tool which is used to identify android malwares and categorize them according to their behavior. It utilized a kernel level hook to capture all system call requests of the application and then generate a signature for the behavior of the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt;
Damshenas M, Dehghantanha A, Choo K K R, et al. M0droid: An android behavioral-based malware detection model[J]. Journal of Information Privacy and Security, 2015, 11(3): 141-157.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://m0droid.netai.net/modroid/&quot;&gt;http://m0droid.netai.net/modroid/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blog&lt;/strong&gt;
&lt;a href=&quot;http://www.alid.info/blog/2015/2/4/android-malware-research-dataset&quot;&gt;http://www.alid.info/blog/2015/2/4/android-malware-research-dataset&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;3-the-drebin-dataset-&quot;&gt;3. &lt;a href=&quot;http://user.informatik.uni-goettingen.de/~darp/drebin/&quot;&gt;The Drebin Dataset &lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;The dataset contains 5,560 applications from 179 different malware families. The samples have been collected in the period of August 2010 to October 2012 and were made available to us by the MobileSandbox project. You can find more details on the dataset in the &lt;a href=&quot;http://filepool.informatik.uni-goettingen.de/publication/sec//2014-ndss.pdf&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt; 
Arp D, Spreitzenbarth M, Hubner M, et al. &lt;a href=&quot;http://filepool.informatik.uni-goettingen.de/publication/sec//2014-ndss.pdf&quot;&gt;Drebin: Efficient and explainable detection of android malware in your pocket[C]&lt;/a&gt;//Proc. of 17th Network and Distributed System Security Symposium, NDSS. 14.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://user.informatik.uni-goettingen.de/~darp/drebin/&quot;&gt;http://user.informatik.uni-goettingen.de/~darp/drebin/&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;4-a-dataset-based-on-contagiodump&quot;&gt;4. &lt;a href=&quot;http://cgi.cs.indiana.edu/~nhusted/dokuwiki/doku.php?id=datasets&quot;&gt;A Dataset based on ContagioDump&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;*The dataset is a collection of Android based malware seen in the wild. The malware pieces were downloaded on October 26th, 2011. The total number of malware included in the sample is 189. I have qualitatively split them into categories based on their primary behaviours where available. I obtained their primary behaviours from malware reports from the various AV companies.If the malware would download a separate payload as its primary function, it was put in the Trojan category. If the malware executed an escalation of privilege attack, it was in the escalation of privilege category. If the malware primarily stole data from the phone, it was classified as information stealing. If the malware sent premium SMS messages, it was a premium SMS transmitting malware. *&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://cgi.cs.indiana.edu/~nhusted/dokuwiki/doku.php?id=datasets&quot;&gt;http://cgi.cs.indiana.edu/~nhusted/dokuwiki/doku.php?id=datasets&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;5-andromalshare&quot;&gt;5. &lt;a href=&quot;http://sanddroid.xjtu.edu.cn:8080/#home&quot;&gt;AndroMalShare&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;AndroMalShare is a project focused on sharing Android malware samples. It’s only for research, no commercial use. We present statistical information of the samples, a detail report of each malware sample scanned by &lt;a href=&quot;http://sanddroid.xjtu.edu.cn&quot;&gt;SandDroid&lt;/a&gt; and the detection results by the anti-virus productions. You can upload malware samples to share with others and each malware sample can be downloaded(only by registered users)!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://sanddroid.xjtu.edu.cn:8080/#home&quot;&gt;http://sanddroid.xjtu.edu.cn:8080/#home&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;6-kharon-malware-dataset&quot;&gt;6. &lt;a href=&quot;http://kharon.gforge.inria.fr/dataset/&quot;&gt;Kharon Malware Dataset&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;The Kharon dataset is a collection of malware totally reversed and documented. This dataset has been constructed to help us to evaluate our research experiments. Its construction has required a huge amount of work to understand the malicous code, trigger it and then construct the documentation. This dataset is now available for research purpose, we hope it will help you to lead your own experiments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt;
CIDRE, EPI. &lt;a href=&quot;https://www.usenix.org/system/files/conference/laser2016/laser2016-paper-kiss.pdf&quot;&gt;Kharon dataset: Android malware under a microscope.&lt;/a&gt; Learning from Authoritative Security Experiment Results (2016): 1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://kharon.gforge.inria.fr/dataset/&quot;&gt;http://kharon.gforge.inria.fr/dataset/&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;7-amd-project&quot;&gt;7. &lt;a href=&quot;http://amd.arguslab.org&quot;&gt;AMD Project&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;AMD contains 24,553 samples, categorized in 135 varieties among 71 malware families ranging from 2010 to 2016. The dataset provides an up-to-date picture of the current landscape of Android malware, and is publicly shared with the community.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt;
Li Y, Jang J, Hu X, et al. &lt;a href=&quot;https://arxiv.org/pdf/1707.04795.pdf&quot;&gt;Android malware clustering through malicious payload mining&lt;/a&gt;[C]//International Symposium on Research in Attacks, Intrusions, and Defenses. Springer, Cham, 2017: 192-214.&lt;/p&gt;

&lt;p&gt;Wei F, Li Y, Roy S, et al. &lt;a href=&quot;http://www.fengguow.com/resources/papers/AMD-DIMVA17.pdf&quot;&gt;Deep Ground Truth Analysis of Current Android Malware&lt;/a&gt;[C]//International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment. Springer, Cham, 2017: 252-276.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://amd.arguslab.org&quot;&gt;http://amd.arguslab.org&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;8-aagm-dataset&quot;&gt;8. &lt;a href=&quot;http://www.unb.ca/cic/datasets/android-adware.html&quot;&gt;AAGM Dataset&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;AAGM dataset is captured by installing the Android apps on the real smartphones semi-automated. The dataset is generated from 1900 applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt;
Arash Habibi Lashkari, Andi Fitriah A.Kadir, Hugo Gonzalez, Kenneth Fon Mbah and Ali A. Ghorbani, &lt;a href=&quot;https://www.ucalgary.ca/pst2017/files/pst2017/paper-3.pdf&quot;&gt;Towards a Network-Based Framework for Android Malware Detection and Characterization&lt;/a&gt;, In the proceeding of the 15th International Conference on Privacy, Security and Trust, PST, Calgary, Canada, 2017.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://www.unb.ca/cic/datasets/android-adware.html&quot;&gt;http://www.unb.ca/cic/datasets/android-adware.html&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;9-android-praguard-dataset&quot;&gt;9. &lt;a href=&quot;http://pralab.diee.unica.it/en/AndroidPRAGuardDataset&quot;&gt;Android PRAGuard Dataset&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;As retrieving malware for research purposes is a difficult task, we decided to release our dataset of obfuscated malware.&lt;/p&gt;

&lt;p&gt;The dataset contains 10479 samples, obtained by obfuscating the MalGenome and the Contagio Minidump datasets with seven different obfuscation techniques.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt;
Davide Maiorca, Davide Ariu, Igino Corona, Marco Aresu and Giorgio Giacinto. &lt;a href=&quot;http://pralab.diee.unica.it/sites/default/files/MaiorcaCoSe2015Final.pdf&quot;&gt;Stealth attacks: an extended insight into the obfuscation effects on Android malware&lt;/a&gt;. In Computers and Security, vol. 51, pp. 16-31, 2015.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;http://pralab.diee.unica.it/en/AndroidPRAGuardDataset&quot;&gt;http://pralab.diee.unica.it/en/AndroidPRAGuardDataset&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;10-androzoo&quot;&gt;10. &lt;a href=&quot;https://androzoo.uni.lu/&quot;&gt;AndroZoo&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;AndroZoo is a growing collection of Android Applications collected from several sources, including the official Google Play app market.It currently contains 5,781,781 different APKs, each of which has been (or will soon be) analysed by tens of different AntiVirus products to know which applications are detected as Malware.
We provide this dataset to contribute to ongoing research efforts, as well as to enable new potential research topics on Android Apps.By releasing our dataset to the research community, we also aim at encouraging our fellow researchers to engage in reproducible experiments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publication&lt;/strong&gt;
K. Allix, T. F. Bissyandé, J. Klein, and Y. Le Traon. &lt;a href=&quot;https://androzoo.uni.lu/static/papers/androzoo-msr.pdf&quot;&gt;AndroZoo: Collecting Millions of Android Apps for the Research Community&lt;/a&gt;. Mining Software Repositories (MSR) 2016.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Homepage&lt;/strong&gt;
&lt;a href=&quot;https://androzoo.uni.lu/&quot;&gt;https://androzoo.uni.lu/&lt;/a&gt;&lt;/p&gt;
</description>
				<pubDate>Wed, 24 Jan 2018 00:00:00 +0800</pubDate>
				<link>/resource/andoird-malware-datasets.html</link>
				<guid isPermaLink="true">/resource/andoird-malware-datasets.html</guid>
			</item>
		
			<item>
				<title>Android模拟器中构建TaintDroid</title>
				<description>&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;新搭建了个人博客，文章全部转到&lt;a href=&quot;http://blog.datarepo.cn&quot;&gt;http://blog.datarepo.cn&lt;/a&gt;上更新。&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;下载编译运行TaintDroid&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;1-taintdroid项目介绍&quot;&gt;1. TaintDroid项目介绍&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://www.appanalysis.org/index.html&quot;&gt;TaintDroid&lt;/a&gt;是由William Enck等人开发并实现的Android系统的实时隐私监控系统，常被用于Android软件动态分析。论文&lt;a href=&quot;http://www.appanalysis.org/tdroid10.pdf&quot;&gt;TaintDroid: an information flow tracking system for real-time privacy monitoring on smartphones&lt;/a&gt;发表在国际会议Usenix Conference on Operating Systems Design &amp;amp; Implementation。&lt;/p&gt;

&lt;p&gt;TaintDroid通过修改Android源代码实现相关功能，其支持的最新系统版本为Android 4.3。&lt;/p&gt;

&lt;h2 id=&quot;2-构建taintdroid&quot;&gt;2. 构建TaintDroid&lt;/h2&gt;

&lt;h3 id=&quot;step-0-安装相关软件&quot;&gt;Step 0: 安装相关软件&lt;/h3&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get install curl git libswitch-perl gperf flex
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;上述软件为必须软件，若在实践过程中出现问题，自行Google即可。&lt;/p&gt;

&lt;h3 id=&quot;step-1-获取android源代码&quot;&gt;Step 1: 获取Android源代码&lt;/h3&gt;

&lt;h4 id=&quot;安装repo&quot;&gt;安装Repo&lt;/h4&gt;

&lt;p&gt;Repo是谷歌用Python脚本写的调用git的一个脚本。主要是用来下载、管理Android项目的软件仓库。 更多关于Repo的信息，参见Google&lt;a href=&quot;https://source.android.com/source/developing.html&quot;&gt;开发&lt;/a&gt;网页。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;下载repo工具&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkdir ~/bin
&lt;span class=&quot;nv&quot;&gt;$ PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/bin:&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;curl https://storage.googleapis.com/git-repo-downloads/repo &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; ~/bin/repo
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;chmod a+x ~/bin/repo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;修改repo文件&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gedit ~/bin/repo
//将 REPO_URL 一行替换成为：REPO_URL &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;前面两步也可简化为&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkdir ~/bin
&lt;span class=&quot;nv&quot;&gt;$ PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/bin:&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; ~/bin https://raw.githubusercontent.com/traceflight/Android-related-repo/master/Repo-Script/repo
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;chmod a+x ~/bin/repo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;配置Git&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; user.name &lt;span class=&quot;s2&quot;&gt;&quot;Your Name&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; user.email &lt;span class=&quot;s2&quot;&gt;&quot;you@example.com&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;获得android源代码&quot;&gt;获得Android源代码&lt;/h4&gt;

&lt;p&gt;Android源代码托管的官方网站为：https://android.googlesource.com/platform/manifest。由于众所周知的原因，大陆无法访问，可使用清华大学开源软件镜像站代替使用。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;建立工作目录：&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkdir &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/tdroid/tdroid-4.3_r1
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/tdroid/tdroid-4.3_r1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;初始化仓库，使用android 4.3&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;repo init &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; https://aosp.tuna.tsinghua.edu.cn/platform/manifest &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; android-4.3_r1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;同步源码树（所需时间较长）&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;repo sync
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;编译源代码&quot;&gt;编译源代码&lt;/h4&gt;

&lt;p&gt;源代码编译过程中可能出现各种问题，请Google相关问题。&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; build/envsetup.sh
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;lunch 1
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make &lt;span class=&quot;nt&quot;&gt;-j4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;运行模拟器&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;emulator
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-2-获取taintdroid源代码&quot;&gt;Step 2: 获取TaintDroid源代码&lt;/h3&gt;

&lt;h4 id=&quot;创建local_manifestxml文件&quot;&gt;创建local_manifest.xml文件&lt;/h4&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkdir ~/tdroid/tdroid-4.3_r1/.repo/local_manifests/
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/tdroid/tdroid-4.3_r1/.repo/local_manifests/
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;touch local_manifest.xml
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gedit local_manifest.xml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;复制下列内容到文件local_manifest.xml中&lt;/p&gt;

&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;manifest&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remote&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;fetch=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;git://github.com&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;platform/dalvik&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;dalvik&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_dalvik&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;platform/libcore&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;libcore&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_libcore&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;platform/frameworks/base&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;frameworks/base&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_frameworks_base&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;platform/frameworks/native&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;frameworks/native&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_frameworks_native&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;platform/frameworks/opt/telephony&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;frameworks/opt/telephony&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_frameworks_opt_telephony&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;platform/system/vold&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;system/vold&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_system_vold&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;platform/system/core&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;system/core&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_system_core&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;device/samsung/manta&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;device/samsung/manta&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/device_samsung_manta&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;remove-project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;device/samsung/tuna&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;device/samsung/tuna&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_device_samsung_tuna&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;packages/apps/TaintDroidNotify&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;remote=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;TaintDroid/android_platform_packages_apps_TaintDroidNotify&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;taintdroid-4.3_r1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;获取源代码&quot;&gt;获取源代码&lt;/h4&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/tdroid/tdroid-4.3_r1
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;repo sync
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;repo forall dalvik libcore frameworks/base frameworks/native frameworks/opt/telephony system/vold system/core device/samsung/manta device/samsung/tuna &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 packages/apps/TaintDroidNotify &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'git checkout -b taintdroid-4.3_r1 --track github/taintdroid-4.3_r1 &amp;amp;&amp;amp; git pull'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-3-构建taintdroid&quot;&gt;Step 3: 构建TaintDroid&lt;/h3&gt;

&lt;h4 id=&quot;创建buildspecmk文件并设置&quot;&gt;创建buildspec.mk文件，并设置&lt;/h4&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/tdroid/tdroid-4.3_r1
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;touch buildspec.mk
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gedit buildspec.mk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;复制如下内容到buildspec.mk中&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Enable core taint tracking logic (always add this)
WITH_TAINT_TRACKING := true

# Enable taint tracking for ODEX files (always add this)
WITH_TAINT_ODEX := true

# Enable taint tracking in the &quot;fast&quot; (aka ASM) interpreter (recommended)
WITH_TAINT_FAST := true

# Enable additional output for tracking JNI usage (not recommended)
#TAINT_JNI_LOG := true

# Enable byte-granularity tracking for IPC parcels
WITH_TAINT_BYTE_PARCEL := true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;修改coremk文件&quot;&gt;修改core.mk文件&lt;/h4&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gedit ~/tdroid/tdroid-4.3_r1/build/target/product/core.mk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;在第一个&lt;code class=&quot;highlighter-rouge&quot;&gt;PRODUCT_PACKAGES&lt;/code&gt;字段最后添加&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;\
TaintDroidNotify
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;最后得到的&lt;code class=&quot;highlighter-rouge&quot;&gt;PRODUCT_PACKAGES&lt;/code&gt;形如：&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PRODUCT_PACKAGES += \
                    BasicDreams \
                    ...
                    voip-common \
                    TaintDroidNotify
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;构建taintdroidandroid模拟器中&quot;&gt;构建TaintDroid（Android模拟器中）&lt;/h4&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/tdroid/tdroid-4.3_r1
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; bulid/envsetup.sh
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;lunch full-eng      //Android emulator
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make clean
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make &lt;span class=&quot;nt&quot;&gt;-j4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-4-获得yaffs2-xattr内核支持&quot;&gt;Step 4: 获得YAFFS2 XATTR内核支持&lt;/h3&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/tdroid
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget http://www.appanalysis.org/files/kernel-goldfish-xattr-2.6.29.zip //此处官方有误
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;unzip kernel-goldfish-xattr-2.6.29.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-5-生成sdcardimg可选&quot;&gt;Step 5: 生成sdcard.img（可选）&lt;/h3&gt;

&lt;p&gt;很多应用安装时需要有SD卡支持，按照官方教程没有给出sdcard.img的生成方法。需要说明的是，不执行本步操作，正常情况下不影响系统和应用的执行。&lt;/p&gt;

&lt;p&gt;生成sdcard.img需要使用Android的SDK中的工具&lt;code class=&quot;highlighter-rouge&quot;&gt;mksdcard&lt;/code&gt;，该工具位于sdk根目录的tools文件夹中。创建方法如下&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;path_to_android_sdk/tools
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./mksdcard 1024M sdcard.img
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;将sdcard.img文件放置在指定文件夹下&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;cp path_to_android_sdk/tools/sdcard.img ~/tdroid/tdroid_4.3_r1/out/target/product/generic/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-6-运行并测试taintdroid&quot;&gt;Step 6: 运行并测试TaintDroid&lt;/h3&gt;

&lt;p&gt;在运行TaintDroid之前，强烈建议先将构建的生成结果备份一下，这样可以快速的将TaintDroid恢复到刚刚构建的状态。需要备份的文件在~/tdroid/tdroid_4.3_r1/out/target/product/generic文件夹中，建议将其中除obj文件夹和symbols文件夹外的其他文件备份，并放置在其他文件夹中（如~/tdroid文件夹）。&lt;/p&gt;

&lt;h4 id=&quot;运行taintdroid&quot;&gt;运行TaintDroid&lt;/h4&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/tdroid
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;emulator &lt;span class=&quot;nt&quot;&gt;-kernel&lt;/span&gt; kernel-goldfish-xattr-2.6.29
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;运行结果如下图&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-taintdroid-after-build.png&quot; alt=&quot;taintdroid-after-build&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;测试&quot;&gt;测试&lt;/h4&gt;

&lt;p&gt;向Android模拟器中安装软件，本文安装百度手机助手。使用Android的SDK中的adb工具：&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;path_to_android_sdk/platform-tools
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./adb install path/to/apk/file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;启动TaintDroid&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-taintdroid-start.png&quot; alt=&quot;taintdroid-start&quot; /&gt;&lt;/p&gt;

&lt;p&gt;启动百度手机助手&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-taintdroid-openbaidu.png&quot; alt=&quot;taintdroid-openbaidu&quot; /&gt;&lt;/p&gt;

&lt;p&gt;可以看到TaintDroid的通知&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-taintdroid-notify.png&quot; alt=&quot;taintdroid-notify&quot; /&gt;&lt;/p&gt;

&lt;p&gt;点击其中的一个通知，可以看到详细内容&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-taintdroid-notify-detail.png&quot; alt=&quot;taintdroid-notify-detail&quot; /&gt;&lt;/p&gt;

</description>
				<pubDate>Tue, 18 Oct 2016 00:00:00 +0800</pubDate>
				<link>/tech/build-taintdroid-in-android-emulator.html</link>
				<guid isPermaLink="true">/tech/build-taintdroid-in-android-emulator.html</guid>
			</item>
		
			<item>
				<title>通过源码构建运行FlowDroid</title>
				<description>&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;新搭建了个人博客，文章全部转到&lt;a href=&quot;http://blog.datarepo.cn&quot;&gt;http://blog.datarepo.cn&lt;/a&gt;上更新。&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;最近在研究Android软件的静态分析，&lt;a href=&quot;https://blogs.uni-paderborn.de/sse/tools/flowdroid/&quot;&gt;FlowDroid&lt;/a&gt;是一个高精度的Android程序污点分析工具，能够分析apk文件，生成软件调用图。下面给出了FlowDroid通过源码进行构建和运行的过程。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;1-安装相关软件&quot;&gt;1. 安装相关软件&lt;/h2&gt;

&lt;h4 id=&quot;安装jdk-17并移除jdk-16flowdroid不能在jdk-16下运行&quot;&gt;安装JDK 1.7，并移除JDK 1.6（FlowDroid不能在JDK 1.6下运行）&lt;/h4&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get install openjdk-7-jdk openjdk-7-jre-headless 
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get remove openjdk-6-jre openjdk-6-jre-headless  &lt;span class=&quot;c&quot;&gt;#（如果有的话）&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;安装eclipsegit和相关插件&quot;&gt;安装Eclipse、Git和相关插件&lt;/h4&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get install eclipse git eclipse-egit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;2-导入eclipse&quot;&gt;2. 导入Eclipse&lt;/h2&gt;

&lt;p&gt;下面介绍两种将FlowDroid导入Eclipse的方法。&lt;/p&gt;

&lt;h4 id=&quot;手动下载项目&quot;&gt;手动下载项目&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;创建文件夹&lt;/strong&gt;&lt;br /&gt;
本地创建文件夹，用于存放项目代码。&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/workspace/flowdroid
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/workspace/flowdroid
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;在GitHub中clone项目到本地&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/Sable/heros.git
git clone https://github.com/Sable/jasmin.git
git clone https://github.com/Sable/soot.git
git clone https://github.com/secure-software-engineering/soot-infoflow.git
git clone https://github.com/secure-software-engineering/soot-infoflow-android.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;导入Eclipse&lt;/strong&gt;&lt;br /&gt;
打开Eclipse选择 File -&amp;gt; Import -&amp;gt; General -&amp;gt; Existing Projects into Workspace，分别导入5个项目即可。&lt;/p&gt;

&lt;h4 id=&quot;通过psf项目集导入&quot;&gt;通过psf项目集导入&lt;/h4&gt;

&lt;p&gt;在Eclipse中使用URI导入团队项目集，能够一次性将5个项目同时导入到Eclipse中。5个项目包括：&lt;a href=&quot;https://github.com/Sable/heros.git&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;heros&lt;/code&gt;&lt;/a&gt;、&lt;a href=&quot;https://github.com/Sable/jasmin.git&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;jasmin&lt;/code&gt;&lt;/a&gt;、&lt;a href=&quot;https://github.com/Sable/soot.git&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;soot&lt;/code&gt;&lt;/a&gt;、&lt;a href=&quot;https://github.com/secure-software-engineering/soot-infoflow.git&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow&lt;/code&gt;&lt;/a&gt;、&lt;a href=&quot;https://github.com/secure-software-engineering/soot-infoflow-android.git&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow-android&lt;/code&gt;&lt;/a&gt;。具体导入方法见下面截图：&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;URI： &lt;a href=&quot;https://raw.githubusercontent.com/traceflight/Droidetect/master/develop/flowdroid.psf&quot;&gt;https://raw.githubusercontent.com/traceflight/Droidetect/master/develop/flowdroid.psf&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;打开 File -&amp;gt; Import -&amp;gt; Team -&amp;gt; Team Project Set&lt;/strong&gt;
&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-flowdroid-import.png&quot; alt=&quot;flowdroid-import&quot; /&gt;
&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-flowdroid-team-project-set.png&quot; alt=&quot;flowdroid-team-project-set&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;输入上面的URI -&amp;gt; 点击Finish&lt;/strong&gt;
&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-flowdroid-input-URI.png&quot; alt=&quot;flowdroid-input-uri&quot; /&gt;
&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-flowdroid-cloning.png&quot; alt=&quot;flowdroid-cloning&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;3-下载依赖文件&quot;&gt;3. 下载依赖文件&lt;/h2&gt;

&lt;h4 id=&quot;androidjar-文件&quot;&gt;android.jar 文件&lt;/h4&gt;
&lt;p&gt;对于Android开发人员来说，该文件很熟悉，在android sdk文件夹下，文件结构通常为sdk/platforms/android-22/android.jar。如果本地没有，可在官方下载&lt;a href=&quot;https://developer.android.com/sdk/index.html&quot;&gt;Android SDK&lt;/a&gt;，或者移步在我的项目中&lt;a href=&quot;https://github.com/traceflight/Android-related-repo/tree/master/Android%20Jars&quot;&gt;下载&lt;/a&gt;。&lt;/p&gt;

&lt;h4 id=&quot;droidbench数据集&quot;&gt;DroidBench数据集&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/secure-software-engineering/DroidBench&quot;&gt;DroidBench&lt;/a&gt;是用于评估Android软件污点分析工具有效性的开源测试集，由&lt;a href=&quot;http://sse.ec-spride.de/&quot;&gt;EC SPRIDE Secure Software Engineering Group&lt;/a&gt;创建并维护。FlowDroid中的测试代码部分使用到了DROIDBENCH环境变量，在分析自定义软件时不需要该变量。因此，该数据集不是运行FlowDroid的必须文件。如果需要，可在其Github项目&lt;a href=&quot;https://github.com/secure-software-engineering/DroidBench&quot;&gt;DroidBench&lt;/a&gt;中下载。&lt;/p&gt;

&lt;h2 id=&quot;4-配置项目&quot;&gt;4. 配置项目&lt;/h2&gt;

&lt;h4 id=&quot;环境变量&quot;&gt;环境变量&lt;/h4&gt;
&lt;p&gt;FlowDroid在运行其测试程序时，需要用到两个环境变量：&lt;code class=&quot;highlighter-rouge&quot;&gt;ANDROID_JARS&lt;/code&gt;和&lt;code class=&quot;highlighter-rouge&quot;&gt;DROIDBENCH&lt;/code&gt;。
Ubuntu中可在~/.profile中设置相应的环境变量。使用&lt;code class=&quot;highlighter-rouge&quot;&gt;gedit ~/.profile&lt;/code&gt;命令编辑，添加如下内容：&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ANDROID_JARS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;path/to/android.jar
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DROIDBENCH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;path/to/droidbench
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;ANDROID_JARS&lt;/code&gt;指向Android SDK中某一版本的android.jar文件。
&lt;code class=&quot;highlighter-rouge&quot;&gt;DROIDBENCH&lt;/code&gt;指向数据集所在的位置，本地中可在&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow-android/test/soot/jimple/infoflow/android/test/droidBench&lt;/code&gt;中找到，但其中的数据集不完整，无法完成所有的测试用例。完整的数据集在其官方项目&lt;a href=&quot;https://github.com/secure-software-engineering/DroidBench&quot;&gt;DroidBench&lt;/a&gt;中下载。&lt;/p&gt;

&lt;h4 id=&quot;其他配置&quot;&gt;其他配置&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;SLF4J文件重复问题&lt;/strong&gt;
  在项目&lt;code class=&quot;highlighter-rouge&quot;&gt;heros&lt;/code&gt;和&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow&lt;/code&gt;两个项目中的classpath文件中均有&lt;code class=&quot;highlighter-rouge&quot;&gt;slf4j-simple-1.7.5.jar&lt;/code&gt;。因此在项目编译时会提示SLF4J文件重复，解决方法是在&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow&lt;/code&gt;项目的&lt;code class=&quot;highlighter-rouge&quot;&gt;.classpath&lt;/code&gt;文件中删除对应行&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;classpathentry kind=&quot;lib&quot; path=&quot;lib/slf4j-simple-1.7.5.jar&quot;/&amp;gt;&lt;/code&gt;。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;无法找到&lt;code class=&quot;highlighter-rouge&quot;&gt;EasyTaintWrapperSource.txt&lt;/code&gt;&lt;/strong&gt;
  &lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow-anadroid&lt;/code&gt;项目编译时提示找不到文件&lt;code class=&quot;highlighter-rouge&quot;&gt;EasyTaintWrapperSource.txt&lt;/code&gt;。该文件可在项目&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow&lt;/code&gt;根目录下找到，复制到&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow-anadroid&lt;/code&gt;的根目录下即可。&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;5-运行flowdroid分析软件&quot;&gt;5. 运行FlowDroid分析软件&lt;/h2&gt;

&lt;h4 id=&quot;使用代码中的测试用例&quot;&gt;使用代码中的测试用例&lt;/h4&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;soot-infoflow-anadroid&lt;/code&gt;项目提供了多个测试集，位于项目&lt;code class=&quot;highlighter-rouge&quot;&gt;test&lt;/code&gt;文件夹下，分别为:droidBench数据集测试、insecureBank.apk测试、otherAPKs测试、sourceToSinks测试和xmlParser测试。使用方法为，右击对应的java文件，选择Run As -&amp;gt; JUnit Test。&lt;/p&gt;

&lt;h4 id=&quot;分析自定义文件&quot;&gt;分析自定义文件&lt;/h4&gt;
&lt;p&gt;分析自定义文件使用&lt;code class=&quot;highlighter-rouge&quot;&gt;soot.jimple.infoflow.android.TestApps&lt;/code&gt;中的&lt;code class=&quot;highlighter-rouge&quot;&gt;Test.java&lt;/code&gt;文件。该文件的输入包括两个参数：apk-file和android-jar-directory。配置方法如下：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;右击Test.java文件，选择Run As -&amp;gt; Run Configurations…
  &lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-flowdroid-test-config.png&quot; alt=&quot;flowdroid-test-config&quot; /&gt;&lt;/li&gt;
  &lt;li&gt;左侧选择Java Application里面的Test（如果打开Configurations后，左侧没有Test，可先执行Run As -&amp;gt; Java Application），右侧选择Arguments标签，里面写入两个参数，点击Apply、Run，即可得到分析结果。
  &lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-flowdroid-test-run.png&quot; alt=&quot;flowdroid-test-run&quot; /&gt;
  &lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-flowdroid-test-result.png&quot; alt=&quot;flowdroid-test-result&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
				<pubDate>Sat, 04 Jun 2016 00:00:00 +0800</pubDate>
				<link>/tech/build-and-run-flowdroid-in-eclipse.html</link>
				<guid isPermaLink="true">/tech/build-and-run-flowdroid-in-eclipse.html</guid>
			</item>
		
			<item>
				<title>Ubuntu中将Caps Lock键替换为Ctrl键</title>
				<description>&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;新搭建了个人博客，文章全部转到&lt;a href=&quot;http://blog.datarepo.cn&quot;&gt;http://blog.datarepo.cn&lt;/a&gt;上更新。&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;对于一些用户（如Emacs党）来说，Ctrl键是一个经常需要使用的键，但是由于其位于键盘的两个角落，使用起来不是十分顺手。大小写锁定键Caps Lock在实际使用中并不是十分常用，大小写切换的功能可以通过配合Shift键完成，下面给出将Caps Lock键替换为Ctrl键的方法。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;废话不多说直接给出简单的方法&quot;&gt;废话不多说，直接给出简单的方法&lt;/h3&gt;

&lt;p&gt;在&lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/default/keyboard&lt;/code&gt;文件中添加&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;XKBOPTIONS=&quot;ctrl:nocaps&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;重启后，就可以实现将Caps Lock键替换为Ctrl键。
有兴趣的话，可以看下面的内容。&lt;/p&gt;

&lt;h3 id=&quot;其他方法&quot;&gt;其他方法&lt;/h3&gt;

&lt;h4 id=&quot;查看当前键盘布局&quot;&gt;查看当前键盘布局&lt;/h4&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$xmodmap -pke
----
...
keycode  59 = comma less comma less
keycode  60 = period greater period greater
keycode  61 = slash question slash question
keycode  62 = Shift_R NoSymbol Shift_R
keycode  63 = KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply XF86ClearGrab
keycode  64 = Alt_L Meta_L Alt_L Meta_L
keycode  65 = space NoSymbol space
keycode  66 = Caps_Lock NoSymbol Caps_Lock
keycode  67 = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;通常keycode 66 对应Caps_Lock键&lt;/em&gt;&lt;/p&gt;

&lt;h4 id=&quot;使用自定义键盘布局&quot;&gt;使用自定义键盘布局&lt;/h4&gt;

&lt;p&gt;创建一个键盘布局文件（如~/.Xmodmap）：&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ xmodmap -pke &amp;gt; ~/.Xmodmap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;将其中的&lt;code class=&quot;highlighter-rouge&quot;&gt;keycode 66&lt;/code&gt;对应的值改为&lt;code class=&quot;highlighter-rouge&quot;&gt;keycode  66 = Control_L NoSymbol Control_L&lt;/code&gt;。然后使自定义文件生效：&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ xmodmap ~/.Xmodmap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;使用xmodmap命令修改&quot;&gt;使用xmodmap命令修改&lt;/h4&gt;
&lt;p&gt;下面修改可以将Caps Lock键修改为Control键，并且Shift+CapsLock为CapsLock。修改～/.Xmodmap文件内容为：&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;clear lock
clear control
add control = Caps_Lock Control_L Control_R
keycode 66 = Control_L Caps_Lock NoSymbol NoSymbol
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;然后执行：&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ xmodmap ~/.Xmodmap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;或使用xmodmap说明文档中的例子,将Caps Lock键与Control键交换：&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;参见&lt;code class=&quot;highlighter-rouge&quot;&gt;man xmodmap&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h4 id=&quot;使用setxkbmap命令修改&quot;&gt;使用setxkbmap命令修改&lt;/h4&gt;
&lt;p&gt;交换左Control和Caps Lock键&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;setxkbmap -option ctrl:swapcaps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;将caps lock键改为ctrl键&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;setxkbmap -option ctrl:nocaps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;建议使用文章头给出的方法，简单有效。&lt;/strong&gt;&lt;/p&gt;

</description>
				<pubDate>Sat, 30 Apr 2016 00:00:00 +0800</pubDate>
				<link>/tech/modify-caps-lock-to-ctrl.html</link>
				<guid isPermaLink="true">/tech/modify-caps-lock-to-ctrl.html</guid>
			</item>
		
			<item>
				<title>恶意勒索软件初探</title>
				<description>&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;新搭建了个人博客，文章全部转到&lt;a href=&quot;http://blog.datarepo.cn&quot;&gt;http://blog.datarepo.cn&lt;/a&gt;上更新。&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;恶意勒索软件（&lt;a href=&quot;https://en.wikipedia.org/wiki/Ransomware&quot;&gt;Ransomware&lt;/a&gt;）通过加密、锁定等方式破坏用户对计算机软硬件系统或文件资源的访问，感染后的数据难以用现有的方法恢复，用户需要支付一定的赎金才能重新获得访问权。随着黑客技术的不断提高，恶意勒索软件已经成为一种难以追踪且能够获得大量非法收入的手段。近期已有多家医院和医疗服务机构受到勒索攻击，并带来了不小的经济损失。其他企业和个人也成为攻击对象，需要引起足够的重视。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;恶意勒索软件一般实施流程&quot;&gt;恶意勒索软件一般实施流程&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;勒索软件传播&lt;/strong&gt;。利用特洛伊木马、僵尸网络、系统漏洞或社会工程学方法。常见传播方法为：发送垃圾邮件。邮件往往伪装为由合法公司发送，标题通常为发票、协议修改等，如：&lt;code class=&quot;highlighter-rouge&quot;&gt;ATTN: Invoice J-6xxxxxx&lt;/code&gt;， &lt;code class=&quot;highlighter-rouge&quot;&gt;FW: Payment #xxxxx&lt;/code&gt;。邮件附件为word文档，或者修改了后缀的Zip压缩文件（如修改为.pdf并且将文档的图标作相应修改），或者为JavaScript脚本。也有勒索软件在邮件中给出一个Dropbox链接，诱导用户下载。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;勒索软件触发&lt;/strong&gt;。若恶意软件包含在word文档附件中,打开word文档后，文档内容往往显示为乱码，文档标题提示开启宏查看内容，若开启了宏之后，则触发了软件或脚本的执行，在远程服务器中下载恶意软件执行代码等。若下载的附件为JavaScript脚本，或恶意软件包含在Zip包中，或者下载自Dropbox，则双击打开该文档即可能触发软件的执行。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;恶意代码执行&lt;/strong&gt;。勒索软件触发后，可能执行的恶意行为包括：
    &lt;ul&gt;
      &lt;li&gt;修改系统注册表，添加恶意软件的开机自启动；&lt;/li&gt;
      &lt;li&gt;删除系统还原点数据，禁止系统自动备份；&lt;/li&gt;
      &lt;li&gt;利用系统漏洞，获取系统控制权并禁止用户访问；&lt;/li&gt;
      &lt;li&gt;加密磁盘中用户文档数据，不仅本地磁盘，还包括共享网络磁盘；&lt;/li&gt;
      &lt;li&gt;破坏系统启动记录和文件系统，使系统崩溃。&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;迫使用户支付&lt;/strong&gt;。恶意行为执行完毕后，会在明显的位置告知用户的系统发生了什么，需要执行什么样的操作才能恢复。如将系统桌面改为写有提示的图片，将各个加密过的文件夹内放置用于提醒的图片或文本文档。提示内容一般为需要用户在期限内支付一定的金额才能恢复系统，若期限内不支付，则赎金增加且有可能永久的删除用于恢复系统的数据。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;交还控制权限&lt;/strong&gt;。在用户支付赎金后，攻击者会使用技术手段交还对软硬件或文件系统的控制权。对于加密型的勒索软件，一般给用户下载一个定制的解密工具以及解密密钥，来恢复被加密的数据。&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;恶意软件常用的技术手段和工具&quot;&gt;恶意软件常用的技术、手段和工具&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Social Engineering （社会工程学）&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;在计算机科学中，社会工程学是指通过与他人的合法交流，来使其心理受到影响，做出某些动作或者是透露一些机密信息的方式。在勒索软件的传播过程中，通过伪造的垃圾邮件，使得用户以为邮件内容为可信的或者重要的事件，从而下载并打开邮件附件，触发勒索软件的执行。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Packer、Crypter&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;软件加壳和加密是恶意软件通常采用的技术，能够辅助恶意软件躲避杀毒软件的查杀，并尽可能阻止恶意软件被安全人员逆向分析。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Word/Excel宏&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;为了提高工作效率，微软在起office软件中提供了宏功能，能够通过宏执行批处理命令，并可以通过用户自己编写VBA（Visual Basic for Applications）脚本增加灵活性。恶意软件的执行代码往往通过网络下载获得，在Word文档开启宏之后，会执行一段混淆的VBA脚本下载恶意代码，从而感染用户系统。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;AES、RSA加密&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;一个通过精心设计的加密型恶意勒索软件，将用户的数据加密后的恢复问题转化为一个数学问题，即现代密码学中加密算法的破解问题。由于密码学的发展，先进的加密技术（如RSA-2048、AES-128）在不知道密钥（或只知道公钥）的前提下，采用现有工具和手段难以在可接受时间内破解。因此，现代密码的加密技术是加密型勒索软件得以实施的一个理论基础。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Bitcoin&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;比特币是一种全球通用的加密互联网货币。与采用中央服务器开发的第一代互联网不同，比特币采用点对点（P2P）网络开发的区域链。比特币不依靠特定货币机构发行，而是通过特定的算法大量计算产生。作为货币，包括中国在内的许多政府不承认其合法性，但在美国等国家承认其作为货币的合法地位。基于密码学的设计可以使比特币只能被真实的拥有者转移或支付，同时确保货币所有权与沟通交流的匿名性。因此为攻击这提供一种理想的支付途径，能够做到在收取到赎金的前提下不被追踪。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Tor Browser&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Tor（The Onion Router, 洋葱路由器）是实现匿名通信的自由软件，用户通过Tor可以在因特网上进行匿名交流，实现匿名对外连接、匿名隐藏服务。Tor Browser是Tor项目的旗舰产品，能够自动通过Tor网络启动Tor的后台进程连接网络。一旦关闭程序便会自动删除隐私敏感数据，能够防范流量过滤和嗅探分析。这些特性使得其成为黑客与用户进行网络通信的不二之选，实现用户对攻击者服务器的访问而不被追踪。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Botnet&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;僵尸网络病毒Gameover ZeuS被美国FBI成为“史上最复杂、最具破坏性的网络僵尸病毒”，尽管在2014年反僵尸网络组织Operation Tovar已经中断了其运行,但危险依然存在。Gameover ZeuS不仅会利用ZeuS木马感染计算机，窃取在线电子邮件账户、社交网络和网银于其他在线金融服务，还会传播Cryptolocker，从而加密数据并索要赎金。&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;近期流行的恶意勒索软件&quot;&gt;近期流行的恶意勒索软件&lt;/h2&gt;

&lt;p&gt;近期恶意软件十分猖獗，出现了大量的恶意勒索软件变种，下面仅对部分进行罗列，并给出相关报道，如希望详细了解，可以自行网络检索。&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Locky&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;McAfee （迈克菲）: &lt;a href=&quot;https://blogs.mcafee.com/mcafee-labs/locky-ransomware-arrives-via-email-attachment/&quot;&gt;Locky Ransomware Arrives via Email Attachment&lt;/a&gt; 2016.03.11&lt;/li&gt;
      &lt;li&gt;Avast （爱维士）: &lt;a href=&quot;https://blog.avast.com/a-closer-look-at-the-locky-ransomware&quot;&gt;A closer look at the Locky ransomware&lt;/a&gt; 2016.03.10&lt;/li&gt;
      &lt;li&gt;Avira （小红伞）: &lt;a href=&quot;http://blog.avira.com/locky-ransomware-is-dead-long-live-locky&quot;&gt;Locky ransomware is dead, long live Locky&lt;/a&gt; 2016.03.01&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;CTB-Locker （Web服务器版本）&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Securelist （卡巴斯基实验室）: &lt;a href=&quot;https://securelist.com/blog/research/73989/ctb-locker-is-back-the-web-server-edition/&quot;&gt;CTB-Locker is back: the web server edition&lt;/a&gt; 2016.03.01&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cerber&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Malwarebytes Labs: &lt;a href=&quot;https://blog.malwarebytes.org/threat-analysis/2016/03/cerber-ransomware-new-but-mature/&quot;&gt;Cerber Ransomware - New, But Mature&lt;/a&gt; 2016.03.11&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Petya （破坏文件系统的主引导分区MBR和主文件表MFT）&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;G Data : &lt;a href=&quot;https://blog.gdatasoftware.com/2016/03/28226-ransomware-petya-a-technical-review&quot;&gt;Randomeware Petya - a technical review&lt;/a&gt; 2016.03.31&lt;/li&gt;
      &lt;li&gt;Bleeping Computer: &lt;a href=&quot;http://www.bleepingcomputer.com/news/security/petya-ransomware-skips-the-files-and-encrypts-your-hard-drive-instead/&quot;&gt;Petya Ransomware skips the Files and Encrypts your Hard Drive Instead&lt;/a&gt; 2016.03.25&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;LeChiffre&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Malwarebytes Labs: &lt;a href=&quot;https://blog.malwarebytes.org/threat-analysis/2016/01/lechiffre-a-manually-run-ransomware/&quot;&gt;LeChiffre, Ransomware Ran Manually&lt;/a&gt; 2016.01.22&lt;/li&gt;
      &lt;li&gt;McAfee （迈克菲）: &lt;a href=&quot;https://blogs.mcafee.com/mcafee-labs/mcafee-labs-unlocks-lechiffre-ransomware/&quot;&gt;McAfee Labs Unlocks LeChiffre Ransomware&lt;/a&gt; 2016.03.28&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Maktub Locker （美丽又危险的勒索软件）&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Malwarebytes Labs: &lt;a href=&quot;https://blog.malwarebytes.org/threat-analysis/2016/03/maktub-locker-beautiful-and-dangerous/&quot;&gt;Maktub Locker - Beautiful And Dangerous &lt;/a&gt; 2016.03.24&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;TeslaCrypt&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Fortinet: &lt;a href=&quot;http://blog.fortinet.com/post/nemucod-adds-ransomware-routine&quot;&gt;Nemucod Adds Ransomware Routine&lt;/a&gt; 2016.03.16&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Criakl&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Phishme: &lt;a href=&quot;http://phishme.com/ransomware-rising-criakl-osx-others/&quot;&gt;Ransomware Rising – Criakl, OSX, and others – PhishMe Tracks Down Hackers, Identifies Them and Provides Timeline of Internet Activities&lt;/a&gt; 2016.03.10&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;防御方法&quot;&gt;防御方法&lt;/h2&gt;

&lt;h3 id=&quot;通过技术手段&quot;&gt;通过技术手段&lt;/h3&gt;

&lt;p&gt;近期，法国&lt;a href=&quot;www.lexsi.com&quot;&gt;Lexsi&lt;/a&gt;的研究人员研究了使用疫苗（vaccine）对抗Locky的方法。（由于恶意软件频繁出现变种，下列方法仅作为参考）&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.lexsi.com/securityhub/a-new-dynamic-vaccine-against-locky/?lang=en&quot;&gt;A new dynamic vaccine against Locky&lt;/a&gt; 2016.04.01&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.lexsi.com/securityhub/abusing-bugs-in-the-locky-ransomware-to-create-a-vaccine/?lang=en&quot;&gt;Abusing bugs in the Locky ransomware to create a vaccine&lt;/a&gt; 2016.03.22&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;采用的方法主要为：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;将语言设置为俄语（部分恶意勒索软件对语言为俄语的系统不做处理），该方法对很多人不适用；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;手动创建注册表值&lt;code class=&quot;highlighter-rouge&quot;&gt;HKEY_CURRENT_USER\Software\Locky&lt;/code&gt;，并设置ACLs保护，阻止所有用户修改。该方法有效的原因为，在检查完语言后，Locky尝试创建&lt;code class=&quot;highlighter-rouge&quot;&gt;HKEY_CURRENT_USER\Software\Locky&lt;/code&gt;，当创建失败时，Locky会立刻终止；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;设置注册表id和completed值，欺骗Locky认为系统已经加密完毕。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;破坏注册表中RSA pubkey，使得Locky重命名文档而不加密；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;使用已知RSA密钥，由于Locky在加密前未对pubkey进行验证，因此可以设置已知的RSA公钥，即使Locky将文件加密，也可通过已知的私钥进行解密。&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;这里只做简单介绍，具体方法参考文章 &lt;a href=&quot;https://www.lexsi.com/securityhub/abusing-bugs-in-the-locky-ransomware-to-create-a-vaccine/?lang=en&quot;&gt;Abusing bugs in the Locky ransomware to create a vaccine&lt;/a&gt;。&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;增强安全意识&quot;&gt;增强安全意识&lt;/h3&gt;

&lt;p&gt;增强安全意识对于保护系统免受恶意软件攻击具有至关重要的意义，主要的方法有：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;定期备份重要文件，文件备份后要与主机断开；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;对可疑邮件进行确认，确保为合法邮件后再打开邮件，下载附件；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;不随意打开网络链接，防止下载恶意软件；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;默认关闭office的宏，不要在浏览邮件附件文档是打开它；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;安装先进的防病毒软件（建议使用国外的知名软件），并定期更新和扫描；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;对使用的操作系统和应用软件及时打好补丁。&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;针对企业用户&quot;&gt;针对企业用户&lt;/h3&gt;
&lt;p&gt;老牌代码安全审计机构&lt;a href=&quot;https://www.nccgroup.trust&quot;&gt;NCC Group&lt;/a&gt; 于2016年3月11日针对企业发布了&lt;a href=&quot;https://www.nccgroup.trust/uk/our-research/ransomware-what-organisations-can-do-to-survive/&quot;&gt;Ransomware: what orgnisations can do to survive&lt;/a&gt;，帮助企业如何能够最大限度的减少初次感染的可能性。&lt;/p&gt;
</description>
				<pubDate>Mon, 04 Apr 2016 00:00:00 +0800</pubDate>
				<link>/tech/a-brief-study-of-ransomware.html</link>
				<guid isPermaLink="true">/tech/a-brief-study-of-ransomware.html</guid>
			</item>
		
			<item>
				<title>毕业宴请邀请函</title>
				<description>&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;新搭建了个人博客，文章全部转到&lt;a href=&quot;https://blog.datarepo.cn&quot;&gt;https://blog.datarepo.cn&lt;/a&gt;上更新。&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;为了庆祝师兄师姐圆满毕业，花了点时间写（画）了下面的邀请函。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;有学术味道&lt;/li&gt;
  &lt;li&gt;有实验室特色&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;该内容纯属娱乐～其中的病句与图片中的错误就当做我现在文字水平的见证吧。&lt;/p&gt;
&lt;center&gt;
    &lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-invitation-20160329.jpg&quot; align=&quot;center&quot; /&gt;&lt;/p&gt;
&lt;/center&gt;
</description>
				<pubDate>Tue, 29 Mar 2016 00:00:00 +0800</pubDate>
				<link>/life/invitation.html</link>
				<guid isPermaLink="true">/life/invitation.html</guid>
			</item>
		
			<item>
				<title>C/C++局部变量在栈区的存储情况分析</title>
				<description>&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;新搭建了个人博客，文章全部转到&lt;a href=&quot;http://blog.datarepo.cn&quot;&gt;http://blog.datarepo.cn&lt;/a&gt;上更新。&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;最近看到同学书上写了个例子，关于strcpcy导致的内存覆盖问题，自己实验后发现与书上所讲结果不同。之后跟同学一起深入分析了一段程序，分析结果如下文。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;考虑如下代码的运行结果在vc编译器中运行&quot;&gt;考虑如下代码的运行结果（在vc++编译器中运行）&lt;/h2&gt;

&lt;div class=&quot;language-c++ highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;iostream&amp;gt;
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;abcdefghijklmn&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;zy&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;strcpy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;s = &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;endl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;d = &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;endl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;pause&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;一般看到这个题，最先的反应是，字符串s是源串，肯定不会变…但是，神奇的是s真的变了！我们来看看为什么～&lt;/p&gt;

&lt;h2 id=&quot;变量在内存中的存储情况&quot;&gt;变量在内存中的存储情况&lt;/h2&gt;

&lt;p&gt;一个由C/C++编译的程序占用的内存分为以下几个部分&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;栈区&lt;/strong&gt; — 由编译器自动分配释放 ，存放函数的参数值，局部变量的值等。其操作方式类似于数据结构中的栈。在一个进程中，位于用户虚拟地址空间顶部的是用户栈，编译器用它来实现函数的调用。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;堆区&lt;/strong&gt; — 一般由程序员分配释放， 若程序员不释放，程序结束时可能由OS回收 。注意它与数据结构中的堆是两回事。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;全局/静态存储区&lt;/strong&gt; — 全局变量和静态变量被分配到同一块内存中，在以前的 C 语言中，全局变量又分为初始化的和未初始化的（初始化的全局变量和静态变量在一块区域，未初始化的全局变量与静态变量在相邻的另一块区域，同时未被初始化的对象存储区可以通过 void* 来访问和操纵，程序结束后由系统自行释放），在 C++ 里面没有这个区分了，他们共同占用同一块内存区。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;常量存储区&lt;/strong&gt; — 这是一块比较特殊的存储区，他们里面存放的是常量，不允许修改（当然，你要通过非正当手段也可以修改，而且方法很多）&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;上面的文字摘抄自网络，具体的区别可以自行谷歌。这里只分析栈区的内存情况，其他的可以自己研究。&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;开始实例分析&quot;&gt;开始实例分析&lt;/h2&gt;

&lt;p&gt;现在看如下代码&lt;/p&gt;

&lt;div class=&quot;language-c++ highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;iostream&amp;gt;
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;290&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sc&quot;&gt;'w'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sc&quot;&gt;'x'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;abcz&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;def&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;以上变量均存放于系统栈区，存放于堆区、全局区等的情况有所不同。&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;其中各变量在栈中的存储情况&lt;strong&gt;示意图&lt;/strong&gt;如下所示：&lt;/p&gt;

&lt;center&gt;
    &lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-memory-example.png&quot; align=&quot;center&quot; /&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;p&gt;说明：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;图中内存为栈空间；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;图中一小格为一个字节；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;内存中存储为4字节对齐，不满4字节的按照4字节处理；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;申请变量的内存地址为从高到低；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;深色部分为编译器自动分配的变量间间隔，其大小取决于编译器。在我的实验中，windows下vs++编译器分配的间隔为8个字节，linux下gcc间隔为12字节；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;编译时可以确定其大小的变量（如 int， char等）在内存中分布为：变量高位与间隔后字单元高位对齐，如图中的变量a=290及c=’w’等；&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;对于字符串类型的变量在内存中分布为：变量低位与字单元（可能为多个字单元，与变量对齐后大小有关）低位对齐，数组内容分布为从低到高分布，如字符数组e和f。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;指针位置为当前变量最低位地址。&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;指针&amp;amp;e与指针&amp;amp;f的距离（字节数）可如下计算：sizeof(f)%4? (sizeof(f)/4+1)*4+8 : sizeof(f)+8&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(sizeof()函数返回值包括字符数组结尾的’\0’,上式中的数字8为间隔字节数，根据编译器不同而不同)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;strcpy函数的执行逻辑，如下所示：&lt;/p&gt;

&lt;div class=&quot;language-c++ highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;_TCHAR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;_tcscpy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_TCHAR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pDst&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_TCHAR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pSrc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;_TCHAR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pDst&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pDst&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pSrc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;sc&quot;&gt;'\0'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;在进行字符串复制时，仅检查源字符串的结尾，而不对目的字符串的长度进行检查。&lt;/p&gt;

&lt;h2 id=&quot;重新分析文章开头的例子&quot;&gt;重新分析文章开头的例子&lt;/h2&gt;

&lt;p&gt;再看一下代码&lt;/p&gt;

&lt;div class=&quot;language-c++ highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;iostream&amp;gt;
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;abcdefghijklmn&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;zy&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;strcpy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;s = &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;endl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;d = &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;endl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;pause&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;根据上面分析，可以将内存中的情况画出如下所示的图：&lt;/p&gt;

&lt;center&gt;
    &lt;p&gt;&lt;img src=&quot;http://7xsbrq.com1.z0.glb.clouddn.com/img/blogs/blog-memory-analysis.png&quot; align=&quot;center&quot; /&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;p&gt;可以发现，字符串s被d的内容覆盖掉了，可以看到字符串d会被截断，因此，字符串（以’\0’结尾）输出结果为&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;	s = mn
	d = abcdefghijklmn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;注：Linux下gcc编译运行结果不同，原因为gcc为变量间分配的间隔为12字节，因此可增加s字符串的长度，实现类似的效果，如char s[]=”abcdefghijklmnopqr”，则输出s为qr。&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;结论&quot;&gt;结论&lt;/h2&gt;

&lt;p&gt;MSDN上给出的建议是：&lt;/p&gt;

&lt;p&gt;To avoid overflows, the size of the array pointed by destination shall be long enough to contain the same C string as source (including the terminating null character), and should not overlap in memory with source. Because strcpy does not check for sufficient space in strDestination before it copies strSource, it is a potential cause of buffer overruns. Therefore, we recommend that you use strcpy_s instead. – MSDN&lt;/p&gt;

&lt;p&gt;即在使用strcpy时需要对目标字符串的长度进行事先判定，使其至少等于源字符串，或者改用strcpy_s函数。&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;以上内容为我自己实验结果所得，如有疑问可自行实验后告知，谢谢～&lt;/li&gt;
&lt;/ul&gt;
</description>
				<pubDate>Sun, 27 Mar 2016 00:00:00 +0800</pubDate>
				<link>/tech/cplusplus-memory-layout.html</link>
				<guid isPermaLink="true">/tech/cplusplus-memory-layout.html</guid>
			</item>
		
	</channel>
</rss>
