2014-10-01 52 views

回答

4

自己解决了。我使用pefile python模块提取文本部分,并使用PointerToRawData和VirtualSize来推断文本部分的位置。然后我用dd将.text部分提取到单独的文件中。

import pefile 
pe = pefile.PE('filepath') 
for section in pe.sections: 
    if section.Name == '.text' 
    print "%s %s" % (section.PointerToRawData),hex(section.Misc_VirtualSize)) 

然后DD:

dd if=<lib> of=<lib.text> bs=1 skip=$PointerToRawData count=$VirtualSize