.如果真 (hMemLibModule ≤ 0 或 指针到短整数 (hMemLibModule) ≠ 23117)
返回 (0)
.如果真结束
lpNTHeader = hMemLibModule + 指针到整数 (hMemLibModule + 60)
.如果真 (指针到整数 (lpNTHeader) ≠ 17744 或 指针到整数 (lpNTHeader + 124) = 0)
返回 (0)
.如果真结束
OffsetStart = 指针到整数 (lpNTHeader + 120)
lpExportDirectory = 申请内存_页 (40)
CopyMemory (lpExportDirectory, hMemLibModule + OffsetStart, 40)
CopyMemory (取指针_通用型 (AddressOfNames), hMemLibModule + 指针到整数 (lpExportDirectory + 32), 4)
AddressOfNames = hMemLibModule + AddressOfNames
AddressOfNameOrdinals = hMemLibModule + 指针到整数 (lpExportDirectory + 36)
Ordinals = lpProcName
' 调试输出 (Ordinals, IsBadReadPtr (lpProcName, 4))
.如果 (IsBadReadPtr (lpProcName, 4) ≠ 0)
Ordinals = Ordinals - 指针到整数 (lpExportDirectory + 16)
.如果真 (Ordinals ≤ 指针到整数 (lpExportDirectory + 20) 且 Ordinals ≥ 0)
CopyMemory (取指针_通用型 (Address), hMemLibModule + 指针到整数 (lpExportDirectory + 28) + Ordinals × 4, 4)
.如果真 (Address ≠ 0)
Address = hMemLibModule + Address
.如果真结束
.如果真结束
.否则
Ordinals = 0
NumberOfFunctions = 指针到整数 (lpExportDirectory + 24)
.计次循环首 (NumberOfFunctions, )
len = lstrlen (AddressOfNames)
CopyMemory (取指针_通用型 (Ordinals), AddressOfNameOrdinals, 2)
.如果真 (Ordinals ≤ NumberOfFunctions 且 Ordinals ≥ 0)
.如果真 (StrCmpN (lpProcName, AddressOfNames, len) = 0)
CopyMemory (取指针_通用型 (Address), hMemLibModule + 指针到整数 (lpExportDirectory + 28) + Ordinals × 4, 4)
.如果真 (Address ≠ 0)
Address = hMemLibModule + Address
跳出循环 ()
.如果真结束
.如果真结束
.如果真结束
AddressOfNames = AddressOfNames + len + 1
AddressOfNameOrdinals = AddressOfNameOrdinals + 2
.计次循环尾 ()
.如果结束
释放内存_页 (lpExportDirectory)