久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Win32 API 枚舉dll 導出函數?

Win32 API to enumerate dll export functions?(Win32 API 枚舉dll 導出函數?)
本文介紹了Win32 API 枚舉dll 導出函數?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我發現了類似的問題,但沒有找到我想要的答案.所以這里是:

I found similar questions but no answer to what I am looking for. So here goes:

對于本機 Win32 dll,是否有 Win32 API 來枚舉其導出函數名稱?

For a native Win32 dll, is there a Win32 API to enumerate its export function names?

推薦答案

dumpbin/exports 幾乎是您想要的,但這是一個開發人員工具,而不是 Win32 API.

dumpbin /exports is pretty much what you want, but that's a developer tool, not a Win32 API.

LoadLibraryExDONT_RESOLVE_DLL_REFERENCES 被嚴重警告,但碰巧對這種特殊情況很有用它完成了將 DLL 映射到內存的繁重工作(但您實際上并不需要或不想使用庫中的任何內容),這使得您讀取頭文件變得微不足道:LoadLibraryEx<返回的模塊句柄/code> 指向它.

LoadLibraryEx with DONT_RESOLVE_DLL_REFERENCES is heavily cautioned against, but happens to be useful for this particular case – it does the heavy lifting of mapping the DLL into memory (but you don't actually need or want to use anything from the library), which makes it trivial for you to read the header: the module handle returned by LoadLibraryEx points right at it.

#include <winnt.h>
HMODULE lib = LoadLibraryEx("library.dll", NULL, DONT_RESOLVE_DLL_REFERENCES);
assert(((PIMAGE_DOS_HEADER)lib)->e_magic == IMAGE_DOS_SIGNATURE);
PIMAGE_NT_HEADERS header = (PIMAGE_NT_HEADERS)((BYTE *)lib + ((PIMAGE_DOS_HEADER)lib)->e_lfanew);
assert(header->Signature == IMAGE_NT_SIGNATURE);
assert(header->OptionalHeader.NumberOfRvaAndSizes > 0);
PIMAGE_EXPORT_DIRECTORY exports = (PIMAGE_EXPORT_DIRECTORY)((BYTE *)lib + header->
    OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
assert(exports->AddressOfNames != 0);
BYTE** names = (BYTE**)((int)lib + exports->AddressOfNames);
for (int i = 0; i < exports->NumberOfNames; i++)
    printf("Export: %s
", (BYTE *)lib + (int)names[i]);

完全未經測試,但我認為它或多或少是正確的.(著名的遺言.)

Totally untested, but I think it's more or less correct. (Famous last words.)

這篇關于Win32 API 枚舉dll 導出函數?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

boost_1_60_0 .zip installation in windows(Windows 中的 boost_1_60_0 .zip 安裝)
How do I get console output in C++ with a Windows program?(如何使用 Windows 程序在 C++ 中獲得控制臺輸出?)
How do I calculate the week number given a date?(如何計算給定日期的周數?)
OpenCV with Network Cameras(帶有網絡攝像機的 OpenCV)
Export all symbols when creating a DLL(創建 DLL 時導出所有符號)
Getting started with OpenCV 2.4 and MinGW on Windows 7(Windows 7 上的 OpenCV 2.4 和 MinGW 入門)
主站蜘蛛池模板: 久久国产精品免费 | 亚洲综合激情网 | 久久精品一区二区三区不卡牛牛 | 三级av网站| 国产二区精品 | 18岁毛片 | 超碰在线中文字幕 | 美女无遮挡网站 | 色八区 | 美女无遮挡网站 | 国产乱国产乱300精品 | 特级黄色大片 | 日皮视频在线观看 | 欧美福利在线观看 | 官场少妇尤物雪白高耸 | 日韩一级在线 | 春色导航| 欧美激情网站 | 一级黄色免费视频 | 四虎在线视频 | 青青草视频 | 亚洲国产精品久久 | 国产一区不卡 | 国产精品福利在线 | 国产成人毛片 | 91播放| 特黄老太婆aa毛毛片 | 天天色影院 | a级片在线 | 大香蕉毛片| 欧美日韩亚洲一区二区三区 | 亚洲激情在线 | 一区二区av| 黄色网址在线播放 | 中文字幕在线免费视频 | 国产精品久久久国产盗摄 | 国产在线黄色 | 亚洲国产成人在线 | 夜夜草导航 | 超碰在线国产 | 久久伊人精品 |