sxzxs / cimgui-ahk Goto Github PK
View Code? Open in Web Editor NEWAuto generated ahk wrapper for Dear ImGui via cimgui
Auto generated ahk wrapper for Dear ImGui via cimgui
推荐从模块地址获取函数地址,一次性获取,避免逐个GetProcAddress()。
我测试初始化时间从3毫秒缩减到2
#Requires AutoHotkey v2.0
class Cimgui_dll
{
static __New()
{
SplitPath(A_LineFile, , &dir)
path := ""
lib_path := dir
if (A_IsCompiled)
{
path := (A_PtrSize == 4) ? A_ScriptDir . "\lib\dll_32\" : A_ScriptDir . "\lib\dll_64\"
lib_path := A_ScriptDir . "\lib"
}
else
{
path := (A_PtrSize == 4) ? dir . "\dll_32\" : dir . "\dll_64\"
}
DllCall("SetDllDirectory", "Str", path)
this.lib := DllCall("LoadLibrary", "Str", 'example_win32_directx11.dll', "ptr")
LibAddr this.lib, this
}
static GPA(function)
{
return DllCall("GetProcAddress", 'Ptr', this.lib, 'AStr', function, 'Ptr')
}
}
LibAddr(h, t := {}) {
If (s := NumGet(h, 60, "UInt")) > 1
&& StrGet(h + s, 4, "CP0") == "PE"
&& NumGet(h + r := s + 4, 16, "Short") != 0
&& NumGet(h + n := r + 20, 108, "Int") > 1
&& (Off_Export := NumGet(h + n, 112, "UInt")) > 1 ; 导出表偏移量
&& (ExportSize := NumGet(h + n, 116, "UInt")) > 1 ; 导出表大小
{
of_fn := NumGet(h + Off_Export, 28, "Int")
nameRef := h + NumGet(h + Off_Export, 32, "Int")
ordinal := h + NumGet(h + Off_Export, 36, "Int")
loop NumGet(h + Off_Export, 24, "Int")
t.%StrGet(h + NumGet(nameRef, "UInt"), "CP0")% := h + NumGet(h + of_fn + (NumGet(ordinal, "Short") * 4), "UInt"),
nameRef += 4, ordinal += 2
return t
}
}
当前库的example_win32_directx11.dll似乎是Debug版本,我下载了imgui源码,但只能编绎出example_win32_directx11.exe。
请问如何编绎example_win32_directx11.dll?有什么技巧吗。谢谢。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.