News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Fast GetProcAddress

Started by Petroizki, March 22, 2005, 01:33:31 PM

Previous topic - Next topic

db90h

Cool ;). I figured I was missing something.

The 'CMOVA' confused me .. it is an instruction I had never used before ;). You have taught me something new today.

Sounds like you've got it all finished up now ;). Congrats on a cool implementation.

Thanks,
db90h

x86asm

Quote from: Petroizki on March 25, 2005, 07:18:30 AM
striker,

So you want _all_ exports from the module in one call?

db90h,

thanks, your code seems interesting, and the hint stuff is something i haven't heard of before.

x86asm,

Thanks for testing it.
Did the program crash immediatily when you executed it? Or did it crash after you pushed the benchmark button (if so, what was the library and proc name you searched?)?
The program is quite small, could you by any change step it trough with debugger? I suspect it crashes on the SetDlgItemTextA after getting the cpu vendor name with cpuid, the name is probably not null terminated..

It crashed immediately after I ran it, I will debug it and let you know where it goes wrong! :D

Petroizki

I have updated the library with the new function: http://personal.inet.fi/atk/partsu/GetProcLib.zip.

It is called GetProcOffsetEx, and it has an extra third parameter that accepts the hint. It's very fast when the hint is correct, and is still faster than GetProcAddress if the hint is wrong.. It's not much slower than the original GetProcOffset even the hint would be wrong, but i want to keep the original intact. If you don't need hints anywhere use the original version, and vice versa, but don't include both on the same project, as the functions are over 300bytes. :eek

invoke GetProcOffsetEx, hModule, szFunction, 06Bh

x86asm

the SetDlgItemText worked perfectly, no error, after extracting my CPUID string and passing it to the function, it worked perfectly! no error! I found you error, you didnt save EBX, ESI or EDI after using it, you must! Because after calling your function, the API makes a reference using EBX without reloading it.

Petroizki

oops, the first cpuid instruction messes the ebx.. :red

New upload in the website.

+ plus, i also added the new function to the speed test..

James Ladd

Quote
striker,
So you want _all_ exports from the module in one call?
YES.  :)

thomasantony

Hi,
    Any possiblilty of adding this to the MASM32 Library?

Thomas
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

pbrennick

I certainly think that this would be a very useful addition to the masm32 distribution.  This is a very professional work and I am glad that you decided to repost it.

BTW:  I like the idea of doing a second search without the hint if the first one fails.

Paul

Petroizki

I can make a version without my macros, if hutch likes this to be added in the MASM32 library..

pbrennick

I think your macros would be a useful addition to the distribution, also.  You do very nice work.

Paul