<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>零度x&#039;s blog &#187; 手工</title>
	<atom:link href="http://www.lingdux.com/tag/%e6%89%8b%e5%b7%a5/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lingdux.com</link>
	<description>Take it slowly,it&#039;s OK,it&#039;s OK.</description>
	<lastBuildDate>Wed, 09 Mar 2011 14:16:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>手工给PE文件添加区块</title>
		<link>http://www.lingdux.com/2010/184.html</link>
		<comments>http://www.lingdux.com/2010/184.html#comments</comments>
		<pubDate>Mon, 24 May 2010 03:55:57 +0000</pubDate>
		<dc:creator>零度x</dc:creator>
				<category><![CDATA[逆向学习]]></category>
		<category><![CDATA[PE]]></category>
		<category><![CDATA[区块]]></category>
		<category><![CDATA[手工]]></category>
		<category><![CDATA[添加]]></category>

		<guid isPermaLink="false">http://www.lingdux.com/?p=184</guid>
		<description><![CDATA[1.在区块表(section table)中最后一个IMAGE_SECTION_TABLE后面添加一个IMAGE_SECTION_TABLE

IMAGE_SECTION_TABLE 结构如下

typedef struct _IMAGE_SECTION_HEADER {

<span class="readmore"><a href="http://www.lingdux.com/2010/184.html" title="手工给PE文件添加区块">阅读全文——共718字</a></span>]]></description>
			<content:encoded><![CDATA[<p>1.在区块表(section table)中最后一个IMAGE_SECTION_TABLE后面添加一个IMAGE_SECTION_TABLE<br />
IMAGE_SECTION_TABLE 结构如下<br />
typedef struct _IMAGE_SECTION_HEADER {<br />
    BYTE    Name[IMAGE_SIZEOF_SHORT_NAME];<br />
    union {<br />
            DWORD   PhysicalAddress;<br />
            DWORD   VirtualSize;<br />
    } Misc;<br />
    DWORD   VirtualAddress;<br />
    DWORD   SizeOfRawData;<br />
    DWORD   PointerToRawData;<br />
    DWORD   PointerToRelocations;<br />
    DWORD   PointerToLinenumbers;<br />
    WORD    NumberOfRelocations;<br />
    WORD    NumberOfLinenumbers;<br />
    DWORD   Characteristics;<br />
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;<br />
按照结构添加一个长度为1000h名为.<a href="http://www.lingdux.com" target="_blank">lingdux</a>的区块：</p>
<p><span id="more-184"></span><br />
名称：.<a href="http://www.lingdux.com" target="_blank">lingdux</a><br />
真实长度：1000h<br />
RVA地址：290000h<br />
文件中对齐后的尺寸：1000h<br />
在文件中的偏移：0028d730<br />
其他00填充<br />
区块属性：E0200000(可读可写可执行)</p>
<p>添加好后修改PE头处NumberOfSections,从4改为5</p>
<p>修正SizeOfImage，文件大小发生变化，故修改之</p>
<p style="text-align: center;"><a href="http://www.lingdux.com/wp-content/uploads/2010/05/section1.jpg"><img class="size-full wp-image-185 aligncenter" title="section1" src="http://www.lingdux.com/wp-content/uploads/2010/05/section1.jpg" alt="" width="540" height="455" /></a></p>
<p>2.在文件末尾插入1000h的数据块</p>
<p style="text-align: center;"><a href="http://www.lingdux.com/wp-content/uploads/2010/05/section2.jpg"><img class="size-full wp-image-186 aligncenter" title="section2" src="http://www.lingdux.com/wp-content/uploads/2010/05/section2.jpg" alt="" width="402" height="205" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lingdux.com/2010/184.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

