You can obtain all the exported function names and addresses, but you still need to provide the function parameter information yourself.
Of course, you can also parse the header file and extract this information. However, due to the complexity of the header file syntax, it may not be reliable. I am currently trying to generate and export function signatures through the c++compiler.
[2.0-rc.1] Native.ahk - A way for binding third-party dll libraries to AHK, and create native functions from MCode
Re: [2.0-rc.1] Native.ahk - A way for binding third-party dll libraries to AHK, and create native functions from MCode
Of course it won't be in MdFunc, because C++ can't manipulate the stack pointer directly; but you probably didn't meant that so literally.
The low level implementation for x86 is in x86call.asm, DynaCall. MASM automatically inserts the following prologue and epilogue:
Code: Select all
push ebp
mov ebp, esp
...
leave
Code: Select all
mov esp, ebp
pop ebp
If this is for standard Windows functions, you might consider using the metadata from win32metadata. Reading it is very similar to reading the WinRT metadata.I am currently trying to generate and export function signatures through the c++compiler.
Re: create function or method with native code
by the way, if you're going the web route with Godbolt you could also use https://asmjit.com/parser.html to produce the concatenated hex machine code in the website's hex-dump section by pasting the assembly instructions (can select gcc in Godbolt to remove some extra labels that msvc has to avoid cleaning them up, and if you use msvc don't need /..c flag, only /Fa since you don't need those mcodes anymore)
so pasting from gcc's output with -O3
Code: Select all
_Z3addii:
lea eax, [rdi+rsi]
ret
and msvc's 8D0411C3 from
Code: Select all
lea eax, DWORD PTR [rcx+rdx]
ret 0
Return to “Scripts and Functions (v2)”
Who is online
Users browsing this forum: No registered users and 47 guests