|
[己解决]一段感染EXE文件的代码,对偏移量的疑惑
entrywrite=header->section_header[0].PointerToRawData+header->section_header[0].Misc.VirtualSize; 也就是这个偏移(entrywrite)是相当对文件头的偏移 而实际的程序入口(newentryaddress)是内存中相当对于加载基址的偏移(RVA) 这两都如何转换呢?这就要用到那个codeoffset codeoffset=header->opt_head.BaseOfCode-physaddress; 其实这是个数学题,上面可能从直观上不容易理解,我们把上面的问题转化成数学题: newentryaddress = entrywrite +codeoffset codeoffset = BaseofCode - Rawoffset 我们把他写成这样可能更容易让人理解: newentryaddress = entrywrite - Rawoffset + BaseofCode entrywrite - Rawoffset 等于我们写代码的位置相当对于代码段开始始位置的偏移(均指文件中),因为这是个偏移,所以它也等于加载入内存后,我们的代码相对于代码段加载基址的偏移。(即内存中) 此时得到的这个偏移+BaseofCode 就是代码相对于程序加载基址(ImageBase)的偏移。这个偏移就是我们常说的EntryPoint。 |
|
[求助]关于在汇编程序中调用函数时参数的问题
我想你的理解是: push esi 这足以代表 CreateFileA 是以esi为其中一个参数的。 实际上不是这样的,push esi 仅仅代表着把esi入栈,这和call _CreateFileA可以说没有任何必然的关系。些时的esi可以换成任意寄存器或内存地址,只要这个寄存器或内存地址是指向文件名的指针即可。 下面是CreateFileA的代码,你可以清楚的看见他是如何取参数的: 7C801A24 > 8BFF mov edi, edi ; ntdll.7C930738 7C801A26 55 push ebp 7C801A27 8BEC mov ebp, esp 7C801A29 FF75 08 push dword ptr [ebp+8] 7C801A2C E8 43C60000 call 7C80E074 7C801A31 85C0 test eax, eax 7C801A33 74 1E je short 7C801A53 7C801A35 FF75 20 push dword ptr [ebp+20] 7C801A38 FF75 1C push dword ptr [ebp+1C] 7C801A3B FF75 18 push dword ptr [ebp+18] 7C801A3E FF75 14 push dword ptr [ebp+14] 7C801A41 FF75 10 push dword ptr [ebp+10] 7C801A44 FF75 0C push dword ptr [ebp+C] 7C801A47 FF70 04 push dword ptr [eax+4] 7C801A4A E8 11ED0000 call CreateFileW 7C801A4F 5D pop ebp 7C801A50 C2 1C00 retn 1C 7C801A53 83C8 FF or eax, FFFFFFFF 7C801A56 ^ EB F7 jmp short 7C801A4F 他引用参数时用的是[ebp+XX],这显然是在堆栈中取参数,而不是你说某个寄存器。 |
|
[求助]关于在汇编程序中调用函数时参数的问题
CreateFileA肯定不会到Esi中取参数,他只知道到堆栈中去取。。。。 或许你会在esi中看到FileName,但那说明不了他会取esi做参数。。 在Call CreateFileA之前,你肯定能看见入栈操作。。。 btw:你谈的不是64位的汇编吧,那我可是一窍不通。 |
|
[求助]关于在汇编程序中调用函数时参数的问题
HANDLE CreateFile( LPCTSTR lpFileName, // file name DWORD dwDesiredAccess, // access mode DWORD dwShareMode, // share mode LPSECURITY_ATTRIBUTES lpSecurityAttributes, // SD DWORD dwCreationDisposition, // how to create DWORD dwFlagsAndAttributes, // file attributes HANDLE hTemplateFile // handle to template file ); Return Values If the function succeeds, the return value is an open handle to the specified file. If the specified file exists before the function call and dwCreationDisposition is CREATE_ALWAYS or OPEN_ALWAYS, a call to GetLastError returns ERROR_ALREADY_EXISTS (even though the function has succeeded). If the file does not exist before the call, GetLastError returns zero. If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError API好像是用堆栈来传参数的,返回值要么在Eax里,要么在参数中。。 汇编中可以Invoke来调用API,你把参数写在后面就行了,不用你亲自压栈 |
|
|
|
|
|
[原创]Import REConstructor 1.7 FINAL 汉化美化版
这么快。。。。。。 |
|
|
|
[求助]让灰色按钮突破专家失效
我也想过,但是在消息传送的时候, 有些消息有保留参数的。。。我正在追的一个软件就是这样,传消息的时候利用那个保留参数玩了点小把戏。 不过即使这样,也很容易被手抓到。。。 |
|
[求助]让灰色按钮突破专家失效
里面不写代码,让他按了也白按。。。 |
|
[建议]要求升为普通会员!
赶紧写篇精华文章送给大家吧。。 |
|
[分享]peid 插件源码新地址
赶紧去看看,谢谢 |
|
[求助]问一个高深的问题。望高手来回答。谢谢!!!在线等的。yangjt老兄请进一下。。。
昨天晚上最后我睡觉去了……呵呵……毕竟还是个学生……嘻嘻我不是学生,所以我晚上没睡觉。。。嘿嘿 另:500水帖留念 |
|
[原创]某国产共享软件的关键注册算法
这种方式不错。。。 |
|
[转帖]Import REConstructor 1.7 FINAL
谢谢分享,收藏了 |
|
[原创]希望加密与解密第三版能够在鼠年如约而至!
春天的脚步近了。。。 |
|
[下载]Wine 0.9.56
支持,下个看看,谢谢分享 |
|
|
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值