ntdll.dll!LdrSetDllManifestProber,我相信很多人听都没有听说过这个命令,实际上,我们用这个命令只是为了干一件事:替换LdrpManifestProberRoutine。
在系统初始化DllMain的时候(本质上是走到LdrpWalkImportDescriptor的时候),它会检查LdrpManifestProberRoutine是否有效,然后调用LdrpManifestProberRoutine,对此部分的预原注释是: Probe the DLL for its manifest. Some details are omitted(探测 DLL 的清单。 省略了一些细节)
LdrSetDllManifestProber是直接将LdrpManifestProberRoutine替换为我们的子程序,当调用LdrpWalkImportDescriptor时,便会触发回调,如图: