Giter VIP home page Giter VIP logo

cimgui-ahk's People

Contributors

sxzxs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cimgui-ahk's Issues

请问如何编绎example_win32_directx11.dll?

当前库的example_win32_directx11.dll似乎是Debug版本,我下载了imgui源码,但只能编绎出example_win32_directx11.exe。
请问如何编绎example_win32_directx11.dll?有什么技巧吗。谢谢。

推荐从模块地址获取函数地址

推荐从模块地址获取函数地址,一次性获取,避免逐个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
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.