|
[求助]关于PE添加新节前空间的判断
谢谢你!完全搞懂了。 节的总大小+DOS头的大小(PE文件头偏移便是DOS头的大小) 就是这个地方理解误导了我。 e_lfanew DWORD ? ;指向PE文件头 它是DOS头的最后一个双字节,它的编移量就是DOS头的大小。呵呵!没有仔细去想它。最后导致整段代码不能理解。 附:PE文件头汇编完整结构定义 IMAGE_NT_HEADERS STRUCT Signature DWORD ? ;PE文件标识 FileHeader IMAGE_FILE_HEADER <> OptionalHeader IMAGE_OPTIONAL_HEADER32 <> IMAGE_NT_HEADERS ENDS PE文件头的第一个双字是一个标志,它被定义为00004550h,也就是字符“P”,“E”加上两个0,这也是“PE”这个称呼的由来,大部分的文件属性由标志后面的IMAGE_FILE_HEADER和IMAGE_OPTIONAL_HEADER32结构来定义。 |
|
[求助]关于PE添加新节前空间的判断
我把注释全加上 ;*************************************************************** ;判断是否有足够空间存储新节 ;28h=sizeof IMAGE_SECTION_HEADER ,18h=sizeof IMAGE_FILE_HEADER ;edi将指向新节 ;*************************************************************** movzx eax,[ebx].FileHeader.NumberOfSections ;节的数目 mov ecx,28h ;为乘法作准备 mul ecx ;eax=eax*ecx 节的数目*单个节的大小=节的总大小 add eax,pe_header_off 节的总大小+PE文件头偏移=???(1) add eax,18h ;???(1) + IMAGE_FILE_HEADER的大小=???(2) movzx esi,[ebx].FileHeader.SizeOfOptionalHeader add eax,esi ;???(2) + IMAGE_OPTIONAL_HEADER32结构的长度=???(3) mov edi,eax add edi,pMapping ;I forgot this first ???(3)+内存映射文件的指钟 为后面的操作作准备 add eax,28h ???(3)+ 节表的大小( sizeof IMAGE_SECTION_HEADER)=???(4) (此处节表是新增的) .IF eax>[ebx].OptionalHeader.SizeOfHeaders ;上面运算得到的总和如果大于(所有头+节表的 大小)说明空间不够 ;当然SizeOfHeaders肯定包括dos, coff, pe头 和 段表的大小 jmp Exit ;如果空间不够结束程序 .ENDIF [QUOTE=llydd]感觉上面好像少掉了"PE\0\0"的四字节[/QUOTE] 不知道你说少了PE文件标识(Signature)这双字节作用在哪,Signature好像只在判断是否为合法的PE才用到,难道在这里也要用 到它??(在代码的第一行开始就承认是合法的PE了) 上面的代码完全能编译通过正常运行。 作者的意思是可能是: SizeOfHeaders和单步求出表和头的总和相比较,如果后者大说明空间不够不能添加新节。 但是他在单步求表和头的总和表叙令我费解...... |
|
|
|
[求助]windows消息的一个问题
模块应该是这样的: Main proc hWnd,wMsg,wParam,lParam mov eax,wMsg(消息) .if eax == WM_CLOSE .elseif eax == WM_INITDIALOG .elseif eax == WM_COMMAND .else mov eax,FALSE ret .endif mov eax,TRUE ret gMain endp |
|
|
|
[头痛]-穿山甲
2楼朋友在深圳哪里,我在凤岗。 参考大侠们的文章今天又搞了一天,有点收获,但还是没脱成。 DilloDumper,dilloDIE 1。6脱壳机都未脱成。 ---阴阳两全好相貌--- 我恨死穿山甲了 |
|
如何把字符串传入程序中?
如果跳到空白处,把字符串传入eax中,怎样把它压入 堆栈 ss:[0012fb90] 中 [QUOTE] 如? buffer DD ? ...... push eax pop buffer ...... 就把eax的?容?入堆?了。 |
|
[求助]win32汇编,不知道错在哪.
程序有以下错误: 1. ...... szCmdAttrib db 'attrib +h exp1orer.exe',0 szDirectory db 0 szRegKey db 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run',0 ...... szDirectory应该定义为未初始化变量:szDirectory db ? 这个是致命错误也是导致不能写注册表和COPY Myself的原因 动态跟踪就会发现如果定义为szDirectory db 0 invoke RegCreateKey,HKEY_LOCAL_MACHINE,offset szRegKey,addr @hKey offset szRegKey就会指向程序的当前路径当然这一句也不会返回RROR_SUCCESS值 2.invoke RegSetValueEx,@hKey,addr szRegValue,NULL,\ REG_SZ,addr szStrXp,19 最后一个参数当REG_SZ时是写入注册表的字符长度+1你数数看是不是19 如果数不清的话最好用lsstrlen然后inc eax. 3.判断操作系统时 invoke GetVersionEx,addr osVersion;判断操作系统 .if eax == 5 ;是windows2000 GetVersionEx的返回值是在OSVERSIONINFO结构体是光是eax是容不下那么多的参数 4.经过修改以上的错误调试通过. ----------------------------------- 楼主朋友不知道写这段代码的用途在哪? |
|
[求助]关于获取本地时间问题..
.386 .model flat, stdcall option casemap :none include windows.inc include user32.inc includelib user32.lib include kernel32.inc includelib kernel32.lib .data? SysTime SYSTEMTIME <> .data szTime db '今天是20号',0 szDay db '获取时间',0 szNoDay db '今天不是20号',0 .code start: invoke GetSystemTime,addr SysTime .if eax == 14h invoke MessageBox,NULL,addr szTime, addr szDay,MB_OK invoke ExitProcess,NULL .elseif invoke MessageBox,NULL,addr szNoDay,addr szDay,MB_OK invoke ExitProcess,NULL .endif end start ____________________________________________________ invoke MessageBox,NULL,addr szNoDay,addr szDay,MB_OK 不能直接这样输出的 要转换成字符才行 如用wsprintf 还有.if eax == 14h 不知道楼主是什么意思。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值