[求助]请教这段汇编。。谁能指点迷津?!
不是没人帮你,是这种产物是古董了。
FUNLOVE的代码不怎么样,代码很多地方很笨拙,初学者最好还是多看些例如29A benny的代码他的代码一向注释详细,适合初学者。你的这段代码注释不知道是谁加的,有些误导新人了。
call delta
delta:
sub ebx,offset delta - Vstart
ret
;此句代码我想不用我多说了吧,求出Vstart的重定位地址。
lea esi,[offest HostCode + ebx]
; esi = 重定位 HostCode的地址偏移
mov edi,[esp] ; esp ptr kernel32地址
sub edi,08
;减去8是将[esp]指向的kernel32地址的前8个字节用作存储,其实在现在的win32环境中,这个kernel32地址是写不进去的。除非通过Virtualprotect改变内存页属性为可写才可以写入。
mov [esp],edi ;将Edi写入[esp]
movsd ;mov [edi], [esi] ; esi = HostCode
movsd ;mov [edi+4], [esi+4]
push dword ptr [esp + 04]
call RelocKernel32
RelocKernel32:
push r_kernel32
;该子程序的参数,将kernel32的地址传入r_kernel32并入栈保护
call Whereis_GPA ; 查找GetProcAddress 的子程序
oreax,eax ;得到GetProcAddress函数的地址
jzshort RK_00
pusheax
leaesi,[offset Kernel32_Functions + ebx]
pushesi
callDLL_Relocate ; DLL 重定位子程序,调用来重定位kernel32.dll
RK_00:
ret
我不知道传入dword ptr [esp + 04] 有啥用,
下面直接push r_kernel32 传入常量。
然后在看 过程返回ret,这也是个明显错误。 压入了一个参数,应该ret 4才对。。