Macros for quick procedure definition

Started by Vortex, March 18, 2024, 07:54:20 PM

Previous topic - Next topic

Vortex

Hello,

Here are some macros for quick procedure definition. The PROCX macro sets automatically the PARMAREA value :

PROCX MACRO functionname:REQ,args:VARARG

fname TEXTEQU functionname

    functionname PROC args PARMAREA=16*QWORD

ENDM

ENDPX MACRO

    fname ENDP

ENDM


The maximum number of parameters which is 16 by default can be modified easily.

EDIT : PARMAREA does not impose a limit of 16 parameters.

An example :

PROCX start

LOCAL hModule:QWORD

    invoke  GetModuleHandle,NULL
    mov     hModule,rax
    invoke  DialogBoxParam,hModule,\
            ADDR Resource,NULL,ADDR DlgProc,NULL
    invoke  ExitProcess,rax

ENDPX
Code it... That's all...

HellOfMice

Windows 11 antivirus does not allow to download the zip file!

Vortex

Hello Philippe,

Could you try another browser?

By the way, no need to use any macro to omit the parameter type QWORD. This one works fine :

DlgProc PROC hWnd,uMsg,wParam,lParam PARMAREA=4*QWORD
Code it... That's all...

HellOfMice

I had the same problem with a zip file that I posted and wanted to get.
In fact I added an exception in the antivirus parameter (MS antimalware)
Do you know where I could find a Boyer-Moore function in asm?


Philippe


HellOfMice

There is a long time I wanted to make a software with search capabilities but never did it. Today if I have not this function I can't continue.
Thank you Vortex


Philippe

Vortex

Hello Philippe,

QuoteI had the same problem with a zip file that I posted and wanted to get.
In fact I added an exception in the antivirus parameter (MS antimalware)

If you are using Windows 10\11 , curl does the job to download a file :

curl -R http://address.ext/file.zip -o file.zip
Code it... That's all...

HellOfMice

Some time ago  sed Curl buy now I din't think to it.


Thank You :D :D :D :D :D :D :D