win32汇编认为比较好的一段写法

@@:
							pushad
							mov	eax,@dwIndex
							push	edi
							mov	ecx,[edi].NumberOfNames
							cld
							mov	edi,@lpAddressOfNameOrdinals
							repnz	scasw
							.if	ZERO?	;找到函数名称
								sub	edi,@lpAddressOfNameOrdinals
								sub	edi,2
								shl	edi,1
								add	edi,@lpAddressOfNames
								invoke	_RVAToOffset,_lpFile,DWORD ptr [edi]
								add	eax,_lpFile  
							.else
								mov	eax,offset szExportByOrd
							.endif
							pop	edi
							mov	ecx,@dwIndex
							add	ecx,[edi].nBase
							invoke	wsprintf,addr @szBuffer,addr szMsgName,\
								ecx,dword ptr [esi],eax
							invoke	_AppendInfo,addr @szBuffer
							popad
							add	esi,4
							inc	@dwIndex
		           loop	@B
 

只有代码,不解释:

猜你喜欢

转载自lqzit.iteye.com/blog/1006957