|
[求助]学了一天PE结构,entrypoint(raw)?
不是钻到牛角尖里了吧? 我看了system32 下的exe 文件, 例如notepad.exe, calc.exe ,都很正常,entrypoint 都是用RVA 表示的 没有entrypoint(RAW) 之说, 我没有用过stud_pe 工具, 如果这个 RAW 不是RVA 又不是offset 的话, 哪它就没有任何意义了。 建议你用别的工具看吧,例如lord_pe |
|
[求助]学了一天PE结构,entrypoint(raw)?
程序入口点就是用RVA 表示的,entrypoint(raw) 是什么意思 ? 是将 entrypoint RVA 转为文件的Offset 吗? 如是,也简单,用工具或查 节表手工计算都行。 若不是 RVA- offset 转换,我就不知道它表达的是 什么意思了.... |
|
[求助]学了一天PE结构,entrypoint(raw)?
typedef struct _IMAGE_OPTIONAL_HEADER { // // Standard fields. // WORD Magic; // NT HDR32 定义为010b BYTE MajorLinkerVersion; //link version 不重要 BYTE MinorLinkerVersion; DWORD SizeOfCode; //代码段大小 DWORD SizeOfInitializedData; //初始化数据大小 DWORD SizeOfUninitializedData; //未初始化数据大小 DWORD AddressOfEntryPoint; //程序入口点: 重要 DWORD BaseOfCode; //代码基址(RVA) DWORD BaseOfData; //数据基址(RVA) ...... 先找到option header 位置,在第5个DWORD 处。 DWORD AddressOfEntryPoint; 怎样找option header 位置,建议你还是看看pe 的格式吧。 |
|
[求助]API 是什么意思?求大侠告之!!!
说的很好吗!你只管用,用着用着就理解了。 通俗讲API 就是操作系统给我们提供的子程序。 好比有人问你什么叫“1”,1个人,1块砖,1个木头,反正那就叫1. 抽象的东西就是应该先用后理解。 |
|
|
|
[已解决]请问PE Header的大小如何确定。
这部分起始位置,有dos header ->e_lfanew 给出, 就是0x3c 处的位置。为0x000000b0, 大小:0x4+0x14+0xe0=0xf8, 前面已经说了(前面计算大小错了,多加了起始地址0xb0)。大小固定。 然后就得到节表开始地址: 0xb0+0xf8 = 0x1a8 , 指的正好是text 段位置。 我还想请问, 您是根据什么一下定位到1b0出开始看呢, 我看到了第一个段.text 段名字, 这块数据是.text 段节表头。 完整的理解你可以看一看 新兵论坛 置顶的 由 笨笨雄版主推荐的 pe 启发式学习 第一部分。 可能内容比较多,你要有时间阅读。 |
|
[原创]宏汇编语言控制台程序的“宏” 解析
input 宏有如下的解释和定义 comment * ------------------------------------- use the "input" macro as follows, If you want a prompt use this version mov lpstring, input("Type text here : ") If you don't need a prompt use the following mov lpstring, input() NOTE : The "lpstring" is a preallocated DWORD variable that is either LOCAL or declared in the .DATA or .DATA? section. Any legal name is OK. LIMITATION : MASM uses < > internally in its macros so if you wish to use these symbols in a prompt, you must use the ascii value and not use the symbol literally. EXAMPLE mov var, input("Enter number here ",62," ") ------------------------------------------- * input MACRO prompt:VARARG LOCAL txt LOCAL buffer IFNB <prompt> .data txt db prompt, 0 buffer db 128 dup (0) align 4 .code invoke StdOut,ADDR txt invoke StdIn,ADDR buffer,LENGTHOF buffer invoke StripLF,ADDR buffer mov eax, offset buffer EXITM <eax> ELSE .data buffer db 128 dup (0) align 4 .code invoke StdIn,ADDR buffer,LENGTHOF buffer invoke StripLF,ADDR buffer mov eax, offset buffer EXITM <eax> ENDIF ENDM ; --------------------------------------------------------------------------- 有了print 宏解释的基础,input 宏就好理解了。我这里简单翻译一下,为意译非逐字译。 input 宏有两种用法,根据是否有提示信息而划分. 一种带提示,例如: mov lpstring, input("Type text here : ") 一种不带提示:例如: mov lpstring, input() 其中 lpstring 是预先分配好的变量,可以为局部变量或存在于data, data?段中。它是一个 只占4字节的指针。 而那个input 为我们提供的缓冲区,是128字节。定义在数据区中,如果 promp 不为空,promp 字符串也会被定义在数据区中。 ; ---------------------------------------------------------- ; str$ macros that takes a DWORD parameter and ; returns the address of the buffer that holds the result. ; The return format is for use within the INVOKE syntax. ; ---------------------------------------------------------- str$ MACRO DDvalue LOCAL rvstring .data rvstring db 20 dup (0) align 4 .code invoke dwtoa,DDvalue,ADDR rvstring EXITM <ADDR rvstring> ENDM str$ 宏以DWORD 值为参数,定义一个缓冲区20bytes 接受转换后的字符串。 然后调用dwtoa 函数将数值转换为字符串。注意,字符串是10进制的。 str$ 宏把数值转变成字符串。在数据区定义了20 bytes 空间,隐含调用dwtoa (或dw2a)函数。 chr$ 宏在数据区定义了相关数据。 这两个宏比较重要,可以常用,再加上print 宏, input宏, print 宏,隐含调用了StdOut 向屏幕输出字符串。字符串定义在堆中。 input 宏,隐含调用了StdIn, 并在堆中定义了128 个bytes 来接受键盘的输入。 这四个宏需要掌握。 其它宏视情况了,理解了可以用,不理解就不用,尽量少用。 宏与函数的显著差别是什么? 宏是编译时的替代,函数是运行时的连接。这是实质差别。 调用宏是不需要invoke 修饰的,而调用函数需要用invoke 修饰(供查错用)。这是书写差别。 |
|
[已解决]请问PE Header的大小如何确定。
pe 中有很多header 你所说的PE header 大小到底是指谁的大小? 如果是指NT header 大小, msdn 中是这样定义的 typedef struct _IMAGE_NT_HEADERS { DWORD Signature; //这里的标记是 PE00 IMAGE_FILE_HEADER FileHeader; //NT header 包含FILE header 和Option header IMAGE_OPTIONAL_HEADER32 OptionalHeader; } IMAGE_NT_HEADERS32 其大小为4+0x14+0xe0=0x1a8 字节。 看样子你好像是指代码段之前所有的空间,包括dos 头,dos体,文件头,可选头,节表,考虑到对齐的关系,在内存中往往占0x1000字节,在文件中占0x200字节。 具体到你这个文件,看1b0 处,指明text段大小0x68, 在内存位置0x0200处, 文件大小0x200, 文件偏移0x200,所以这里的PE 头部就是0x200了 这就是看到的信息了。 |
|
|
|
[原创]PE 文件格式启发式学习2(以count.dll为例)
感谢支持。近期较忙。PE 格式我还想再补充一些应用给大家看,估计要稍微拖后一点了。 |
|
[求助]UE+Stud_PE修改DLL中的SQL语句
延长text 段将使后面的data段等引起地址后移,有重定位问题。 建议先增加一个节,使节的属性与text段属性一致,然后修改原text 段代码 使其jump 或 call 到新增的节中。这种方法我没有试过,会不会引发异常我不敢肯定,感觉成功的机会还是挺大的,如果不行,就要仔细研究一下x86 的保护机制看有没有机会下手了。 |
|
[原创]PE 文件格式启发式学习2(以count.dll为例)
出差了,一直未能上网! [QUOTE=aluocn;461156]提个疑问如下: 答5.3中下一行里的[0x638]=="0207 setDlgItemInt"是不是"0207"应该为"0227"呀? 3. [0x600] == 2038, RVA 2038==offset 638, [0x638]...[/QUOTE] 你说的是对的,是我书写疏忽了。你很仔细! 关于另一个问题:
这种思路是不可取的,将text 段延长0x1000,意味着将其后的数据段,rsrc 段等的地址依次推后0x1000 字节, 而你的text 段中可能有很多与数据地址有关的指令,也就是说,这些都是需要重定位的,虽然dll 中有重定位表,但你也不应该去遍历这个重定位表,重新修改代码再存盘,这样似乎付出代价太大。我推荐的一种办法,请查看你的原帖子,希望对你有帮助。 |
|
[求助]加密与解密第2版第8章P290,DllDemo.DLL的重定位数据为何有4个而不是2个?
请看如下帖子的5.13 问题,或许能帮到你 http://bbs.pediy.com/showthread.php?t=65620 我没有书,不知道怎样写的,学习方法是活读书不是死读书。万一书上由于疏忽写错了或者漏写了什么,你在那里死刻就不值得了,能前后贯穿起来,掌握其要领为目标。 |
|
[推荐]PE 文件格式启发式学习系列(6月4日更新)
建议版主将名称如下改一下,将更符合帖子内容 -- hjjdebug PE 文件格式启发式学习1 -- 文件头,节表,导入表 PE 文件格式启发式学习2 -- 导出表,重定位表 PE 文件格式启发式学习3 -- 资源表 |
|
|
|
[原创]PE 文件格式启发式学习7-资源文件
我的原则,既然写了,就把它写明白。 |
|
[求助]加密与解密第2版第8章P290,DllDemo.DLL的重定位数据为何有4个而不是2个?
最初由incrediman发布 我的理解,你所说的重定位数据3:0000 是重定位块结束标识。 没有重定位数据4. |
|
[求助]怎么通过编程来卸载程序的模块
卸载模块可以用如下API, 不知是否是你要的。 BOOL FreeLibrary( HMODULE hLibModule // handle of loaded library module ); |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值