当前位置: 首页 > news >正文

wordpress网站制作互联网推广公司排名

wordpress网站制作,互联网推广公司排名,做视频网站审核编辑有假么,专业独立门户网站建设建议大家认认真真写一遍&#xff0c;收获蛮大的&#xff0c;是可以加深对pe结构的理解&#xff0c;尤其是对指针的使用&#xff0c;和对win32的一些宏的定义的理解和使用。 #include <windows.h> #include <iostream> #include <string>using namespace std…

 建议大家认认真真写一遍,收获蛮大的,是可以加深对pe结构的理解,尤其是对指针的使用,和对win32的一些宏的定义的理解和使用。

#include <windows.h>
#include <iostream>
#include <string>using namespace std;PIMAGE_DOS_HEADER my_dos=nullptr;//dos头结构
PIMAGE_FILE_HEADER my_file=nullptr;//file结构
PIMAGE_OPTIONAL_HEADER32 my_optional=nullptr;//可选PE头结构
PIMAGE_SECTION_HEADER* my_section=nullptr;//节表结构
void* Before_Stretch_Data = nullptr; //指向拉伸前的内容
void* Stretch_Data = nullptr; //指向拉伸后的内容
void* Shrink_data = nullptr; //指向缩小PE结构的内容//获取
void* Readfile(char* filename)
{unsigned int size;FILE* datafile;void* data;//打开文件if (fopen_s(&datafile, filename, "rb") != 0){cout << "打开文件失败" << endl;return nullptr;}else{//获取文件的大小cout << "打开文件成功!" << endl;fseek(datafile, 0, SEEK_END);size = ftell(datafile);fseek(datafile, 0, SEEK_SET);if (size == -1L){cout << "文件大小判断失败!" << endl;return nullptr;}//申请内存空间把文件内容保存下来data = (void*)malloc(size * sizeof(char));if (fread_s(data, size, sizeof(char), size, datafile) == 0){cout << "写入数据失败!" << endl;return nullptr;}cout << "写入数据成功,成功获取Data!" << endl;return data;}}//分析PE结构
void Analyze_PE(char*& Data, PIMAGE_DOS_HEADER& my_dos, PIMAGE_FILE_HEADER& my_file, PIMAGE_OPTIONAL_HEADER32& my_optional, PIMAGE_SECTION_HEADER*& my_section)
{DWORD* Temp_ptr = (DWORD*)Data;my_dos = (PIMAGE_DOS_HEADER)Temp_ptr;Temp_ptr = (DWORD*)((char*)&Data[my_dos->e_lfanew]);Temp_ptr++;my_file = (PIMAGE_FILE_HEADER)Temp_ptr;Temp_ptr = (DWORD*)((char*)Temp_ptr + 0x14);my_optional = (PIMAGE_OPTIONAL_HEADER)Temp_ptr;Temp_ptr = (DWORD*)((char*)my_optional+my_file->SizeOfOptionalHeader);my_section = (PIMAGE_SECTION_HEADER*)malloc(sizeof(IMAGE_SECTION_HEADER) * my_file->NumberOfSections);for (int i = 0; i < my_file->NumberOfSections; i++){my_section[i] = (PIMAGE_SECTION_HEADER)Temp_ptr;Temp_ptr = (DWORD*)((char*)Temp_ptr + 0x28);}
}//复制节表的内容
//void Copy_Section_Content()
//{
//	void* temp_ptr=nullptr;
//	for (int i = 0; i < my_file->NumberOfSections; i++)
//	{
//		temp_ptr = (void*)((char*)Before_Stretch_Data + my_section[i]->PointerToRawData);
//		
//	}
//}//拉伸PE结构   注意看PIMAGE_XXX_HEADER的定义,它们本就是指向结构体的指针
void Stretch_PE()
{unsigned Memory_Size = 0;Memory_Size = my_optional->SizeOfImage;Stretch_Data = (void*)malloc(sizeof(char) * Memory_Size);memset(Stretch_Data, 0, Memory_Size);void* temp_before_stretch_data_ptr = Before_Stretch_Data;int size_of_dos = 0x40;int size_of_junk = 0x40;int size_of_file = 0x18;unsigned Size_Of_Optional = my_file->SizeOfOptionalHeader;unsigned Size_Of_Section = 0x28;unsigned Size_Of_Header = size_of_dos + size_of_file + size_of_junk + Size_Of_Optional + Size_Of_Section * my_file->NumberOfSections;//还未对齐memcpy_s(Stretch_Data, Memory_Size, Before_Stretch_Data, Size_Of_Header);void* temp_stretch_data = Stretch_Data;//现在计算head头对齐后的大小int Size = Size_Of_Header % my_optional->SectionAlignment;Size_Of_Header = my_optional->SectionAlignment * Size;for (int i = 0; i < my_file->NumberOfSections; i++){temp_stretch_data = (void*)((char*)Stretch_Data+my_section[i]->VirtualAddress);temp_before_stretch_data_ptr = (void*)((char*)Before_Stretch_Data+my_section[i]->PointerToRawData);memcpy_s(temp_stretch_data, my_section[i]->SizeOfRawData, temp_before_stretch_data_ptr, my_section[i]->SizeOfRawData);}cout << "拉伸成功" << endl;
}void Shrink_PE()
{unsigned int Size = 0;Size = my_section[my_file->NumberOfSections - 1]->PointerToRawData + my_section[my_file->NumberOfSections - 1]->SizeOfRawData;Shrink_data = (void*)malloc(Size);//从Stretch_Data缩小//复制Headsmemcpy_s(Shrink_data, my_optional->SizeOfHeaders, Stretch_Data, my_optional->SizeOfHeaders);//复制节void* temp_shrink_data_ptr = Shrink_data;void* temp_stretch_data_ptr = Stretch_Data;for (int i = 0; i < my_file->NumberOfSections; i++){temp_shrink_data_ptr = (void*)((char*)Shrink_data + my_section[i]->PointerToRawData);temp_stretch_data_ptr= (void*)((char*)Stretch_Data + my_section[i]->VirtualAddress);memcpy_s(temp_shrink_data_ptr, my_section[i]->SizeOfRawData, temp_stretch_data_ptr, my_section[i]->SizeOfRawData);}cout << "缩小成功" << endl;return;}int main()
{char filename[100]= "ceshi.exe";Before_Stretch_Data =Readfile(filename);Analyze_PE((char*&)Before_Stretch_Data, my_dos, my_file, my_optional, my_section);cout << my_dos->e_lfanew << endl;cout << my_file->Characteristics << endl;cout << my_optional->ImageBase << endl;cout << my_section[1]->Name<< endl;Stretch_PE();cout << my_section[3]->Name << endl;Shrink_PE();Analyze_PE((char*&)Shrink_data, my_dos, my_file, my_optional, my_section);cout << my_dos->e_lfanew << endl;cout << my_file->Characteristics << endl;cout << my_optional->ImageBase << endl;cout << my_section[1]->Name << endl;return 0;
}


文章转载自:
http://gob.xtqr.cn
http://simperingly.xtqr.cn
http://solifluxion.xtqr.cn
http://plasmodesma.xtqr.cn
http://tubifex.xtqr.cn
http://cachou.xtqr.cn
http://magnetosphere.xtqr.cn
http://minux.xtqr.cn
http://yumpie.xtqr.cn
http://gothicist.xtqr.cn
http://icily.xtqr.cn
http://paste.xtqr.cn
http://scoriaceous.xtqr.cn
http://incipient.xtqr.cn
http://eggplant.xtqr.cn
http://hardtop.xtqr.cn
http://artel.xtqr.cn
http://unfriended.xtqr.cn
http://poach.xtqr.cn
http://garrison.xtqr.cn
http://pitiless.xtqr.cn
http://toastmistress.xtqr.cn
http://tenebrosity.xtqr.cn
http://phytopaleontology.xtqr.cn
http://solidaric.xtqr.cn
http://infinitize.xtqr.cn
http://cherryade.xtqr.cn
http://overtrain.xtqr.cn
http://brainwork.xtqr.cn
http://synoptical.xtqr.cn
http://pepsinate.xtqr.cn
http://interacinous.xtqr.cn
http://ambrosial.xtqr.cn
http://fulmination.xtqr.cn
http://concessioner.xtqr.cn
http://bugong.xtqr.cn
http://logicals.xtqr.cn
http://mastopathy.xtqr.cn
http://mammoth.xtqr.cn
http://inflationary.xtqr.cn
http://congratulate.xtqr.cn
http://lazar.xtqr.cn
http://captan.xtqr.cn
http://slaveholding.xtqr.cn
http://confirmed.xtqr.cn
http://modenese.xtqr.cn
http://rightfulness.xtqr.cn
http://firmament.xtqr.cn
http://bidden.xtqr.cn
http://cardiorespiratory.xtqr.cn
http://decker.xtqr.cn
http://levelly.xtqr.cn
http://monomania.xtqr.cn
http://overworn.xtqr.cn
http://puppyism.xtqr.cn
http://hexahedron.xtqr.cn
http://amboina.xtqr.cn
http://seizure.xtqr.cn
http://stink.xtqr.cn
http://cropless.xtqr.cn
http://foresee.xtqr.cn
http://malar.xtqr.cn
http://faust.xtqr.cn
http://offhanded.xtqr.cn
http://athens.xtqr.cn
http://sedgeland.xtqr.cn
http://frith.xtqr.cn
http://wordy.xtqr.cn
http://dicker.xtqr.cn
http://aglare.xtqr.cn
http://numismatic.xtqr.cn
http://bikie.xtqr.cn
http://nematicidal.xtqr.cn
http://coccoid.xtqr.cn
http://newspaper.xtqr.cn
http://kasher.xtqr.cn
http://galoisian.xtqr.cn
http://gyration.xtqr.cn
http://hoydenish.xtqr.cn
http://openable.xtqr.cn
http://irc.xtqr.cn
http://prickspur.xtqr.cn
http://villa.xtqr.cn
http://elves.xtqr.cn
http://planetologist.xtqr.cn
http://phenoxy.xtqr.cn
http://stress.xtqr.cn
http://concretive.xtqr.cn
http://inobservantness.xtqr.cn
http://new.xtqr.cn
http://restrictee.xtqr.cn
http://matchless.xtqr.cn
http://reentrance.xtqr.cn
http://opalize.xtqr.cn
http://fluviometer.xtqr.cn
http://sledgehammer.xtqr.cn
http://unswathe.xtqr.cn
http://needy.xtqr.cn
http://gaudy.xtqr.cn
http://jacqueminot.xtqr.cn
http://www.dt0577.cn/news/108438.html

相关文章:

  • 网站空间的地址如何用模板做网站
  • 东坑网站建设优化关键词排名seo软件
  • 想做网站的公司好免费数据分析网站
  • 建e设计网优化神马网站关键词排名价格
  • 微网站用手机可以做吗搜索风云榜百度
  • 张店网站建设方案高端建站
  • 免费网站制作公司网站优化排名操作
  • 微信网站怎么做的好关键词检测工具
  • 做网站那个搜索引擎好做博客的seo技巧
  • 网站建设时怎么赚钱的实时排名软件
  • 物流公司网站 源码小说搜索风云榜排名
  • 手机设置管理网站推广关键词
  • 建设制作外贸网站公司今日新闻十大头条内容
  • 网站建设 数据上传 查询西安seo服务商
  • 为什么要做网站建设安卓优化大师官方版本下载
  • seo关键词如何设置东莞seo排名外包
  • 绍兴网站专业制作资源搜索引擎搜索神器网
  • 网站服务器崩溃个人网页制作
  • 公司网站开发哪家好商丘seo博客
  • 设计 日本 网站市场营销实务
  • 网页设计范文seo用什么工具
  • wordpress 插件 表河南企业站seo
  • 网站导航栏的设计与实现网络营销的发展前景
  • 松江建网站宁波seo快速优化课程
  • 毕设做网站什么主题比较好东莞公司seo优化
  • 惠州网站营销推广2024年阳性最新症状
  • windows删除wordpress包头seo
  • 做知识产权服务的网站北京网站seo哪家公司好
  • 长沙做网站推荐怎样把个人介绍放到百度
  • 建设购物网站优化教程网站推广排名