|
[求助]TSS 任务段跳转问题
问题解决了。 程序执行过程中不能有任何调试器的中断或单步执行。如果把int 3 去掉程序可以顺利执行。 调试器的动作会导致eflag寄存器被修改。 而eflag寄存器的nt位正好用于标志此时CPU处于一个nested task中, 调试器的单步或中断会使nt位置0, 导致iretd不能正确执行tss返回(因为nt位被置0了), 而执行了中断返回,中断返回就会pop cs, eip, eflag,esp, ss出来, 那程序当然会直接崩掉, 并导致蓝屏。 |
|
[讨论]exe文件最后一个节后面的内容
就是感觉这个数据可以做各种各样的事情,藏个被加密的恶意代码什么的。但具体都有哪些用途思路就不清楚了~ |
|
[讨论]exe文件最后一个节后面的内容
这个证书是干嘛用的,能否解释下,去掉会不会有什么影响。本人比较小白~。。 |
|
[讨论]exe文件最后一个节后面的内容
又上传了下图片,麻烦各位给看看~ |
|
[讨论]exe文件最后一个节后面的内容
so,一般那个地方会写些什么东西? |
|
[求助]PE程序怎样合并节
确实会使文件变大,但会把节表压缩,空出一堆零 |
|
[求助]PE程序怎样合并节
谢谢大家的指导,问题已经解决了。 其实我这个合并节并不需要移动各种表,因为我是作为整体移动的,而且当节合并之后,加载到内存中的时候,节的RVA并不会有任何变化。之前我是用模拟加载PE的过程,把每个节经过拉伸,填补内存对齐。然后再合并节,这样并不会影响data_directory所记录的RVA。 但是当我程序不模拟加载PE过程的时候,就出现了错误。因内存对齐和文件对齐参数的不同,没有把每个节的所应该的偏移量找准。 至于你们说的代码段和数据段的问题, 只要改动节表属性就行了。这个程序并不影响data_directory记录的RVA。 研究这个的主要原因还是当空闲空间不够添加一个节时,可以合并节之后再添加节。但势必会造成文件尺寸加大。比如我测试时用的windows 32位的笔记本程序,由原来的65k,变成了73k。因为内存对齐比文件对齐大的因素。合并节之后统一按照每个节的内存对齐(RVA)来直接存储到文件中。下面附上经修改后的代码 PVOID PE_Headers::CompressSection(IN PVOID File_Buffer) { PVOID newbuff = NULL; PBYTE read = NULL, write = NULL; DWORD i; if (File_Buffer == NULL) { Error_Flag |= EMPTY_IMAGEBUFFER; return NULL; } //新生成的文件大小 = 最后节的RVA + 最后节的FOA - 头的RVA + 头的FOA File_Size = pSection_Header[pPE_Header->NumberOfSections - 1].VirtualAddress + pSection_Header[pPE_Header->NumberOfSections - 1].SizeOfRawData - pSection_Header->VirtualAddress + pSection_Header->PointerToRawData; newbuff = malloc(File_Size); memset(newbuff, 0, File_Size); memcpy (newbuff, pDos_Header, pOptional_Header->SizeOfHeaders); //拷贝头部 for (i = 0; i < pPE_Header->NumberOfSections; i++) { read = (PBYTE) pDos_Header + pSection_Header[i].PointerToRawData; write = (PBYTE) newbuff + pSection_Header[i].VirtualAddress - pSection_Header->VirtualAddress + pSection_Header->PointerToRawData; //因头部的RVA和FOA的不同产生的偏移量 memcpy(write, read, pSection_Header[i].SizeOfRawData); } Release(File_Buffer); GetPEHeaders(newbuff); //合并后,virtualsize = 文件大小 - 头的文件大小 pSection_Header->Misc.VirtualSize = File_Size - pSection_Header->PointerToRawData; pSection_Header->SizeOfRawData = File_Size - pSection_Header->PointerToRawData; for (i = 1; i < pPE_Header->NumberOfSections; i++) { pSection_Header->Characteristics |= pSection_Header[i].Characteristics; //把每个节的节属性合并到第一个节里 memset(&pSection_Header[i], 0, sizeof(IMAGE_SECTION_HEADER)); //把原来节的数据置0,以便新增一个节 } pPE_Header->NumberOfSections = 1; return newbuff; } |
|
[求助]PE程序怎样合并节
手头只有一个PE tool,分析了一下,发现并没有看出什么问题。但是改完的程序就是不能正常运行了。 |
|
[求助]PE程序怎样合并节
好吧,我大致说明下类内的成员: pSection_Header,一个指向节表的指针,(PIMAGE_SECTION_HEADER)类型 pOptional_Header, 指向optional header的结构体指针 pPE_Header, 一个指向IMAGE_FILE_HEADER的指针 pDos_Header, 指向DOS头指针 GetPEHeaders(newbuff)函数:把以上的指针赋值, |
|
[原创]Windows 程序分析工具
楼主是不是以前参加过滴水逆向班? |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值