Author Topic: Custum function to get procedure addresses  (Read 1024 times)

Vortex

  • Member
  • *****
  • Posts: 2583
Custum function to get procedure addresses
« on: November 06, 2020, 02:14:56 AM »
A custom GetProcAddr function based on binary search :

Code: [Select]
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

  • Member
  • **
  • Posts: 54
Re: Custum function to get procedure addresses
« Reply #1 on: November 10, 2020, 12:18:55 AM »
Hi ,Vortex. It is very good. I will  work hard on  the code. Thank for you!