News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Custum function to get procedure addresses

Started by Vortex, November 06, 2020, 02:14:56 AM

Previous topic - Next topic

Vortex

A custom GetProcAddr function based on binary search :

include     \masm32\include64\masm64rt.inc

EXTERN      GetProcAddr:PROC

.data

user32      db 'user32.dll',0
msgbox      db 'MessageBoxA',0

.data?

hDLL        dq ?

.code

start PROC

    invoke  LoadLibrary,ADDR user32
    mov     hDLL,rax

    invoke  GetProcAddr,rax,ADDR msgbox
    cmp     rax,-1
    je      @f

    invoke  rax,0,"GetProcAddr test",\
            "Hello",MB_OK
@@:
    invoke  FreeLibrary,hDLL

    invoke  ExitProcess,0

start ENDP

END

stevenxie

Hi ,Vortex. It is very good. I will  work hard on  the code. Thank for you!