Jump to content
jdelaney

Get DLL function name from ProcAddress

Recommended Posts

I'm attempting to grab the dll function name from it's proc address...or the ordinal...

$h = _WinAPI_GetModuleHandle("user32.dll")
$i = _WinAPI_GetProcAddress($h,1502) ; ActivateKeyboardLayout
ConsoleWrite("address:" & $i & @CRLF)
; ordinal is 1502, function name is ActivateKeyboardLayout...trying to get 'ActivateKeyboardLayout'

Above is just an example...I'm trying to get the ordinal, in a loop, of one of our internal dlls.  The ordinal can change from build to build.

I've found other ways to do it, but it involves spamming ordinals in a second process until the output is as expected...a second process because most ordianls that are NOT the right one will cause application errors from autoit.

Edit:

I started using the fully decorated function name, and it woks fine.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...