NO

Author Topic: Macros for quick procedure definition  (Read 4935 times)

Offline Vortex

  • Member
  • *
  • Posts: 925
    • http://www.vortex.masmcode.com
Macros for quick procedure definition
« on: March 18, 2024, 07:54:20 PM »
Hello,

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

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

Code: [Select]
PROCX start

LOCAL hModule:QWORD

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

ENDPX
« Last Edit: December 15, 2024, 07:48:24 PM by Vortex »
Code it... That's all...

Offline HellOfMice

  • Member
  • *
  • Posts: 274
  • Never be pleased, always improve
Re: Macros for quick procedure definition
« Reply #1 on: December 06, 2024, 06:28:32 PM »
Windows 11 antivirus does not allow to download the zip file!
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 925
    • http://www.vortex.masmcode.com
Re: Macros for quick procedure definition
« Reply #2 on: December 07, 2024, 09:26:38 AM »
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 :

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

Offline HellOfMice

  • Member
  • *
  • Posts: 274
  • Never be pleased, always improve
Re: Macros for quick procedure definition
« Reply #3 on: December 07, 2024, 09:32:31 AM »
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
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 925
    • http://www.vortex.masmcode.com
Code it... That's all...

Offline HellOfMice

  • Member
  • *
  • Posts: 274
  • Never be pleased, always improve
Re: Macros for quick procedure definition
« Reply #5 on: December 07, 2024, 09:44:31 AM »
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
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 925
    • http://www.vortex.masmcode.com
Re: Macros for quick procedure definition
« Reply #6 on: December 13, 2024, 11:17:17 AM »
Hello Philippe,

Quote
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)

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

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

Offline HellOfMice

  • Member
  • *
  • Posts: 274
  • Never be pleased, always improve
Re: Macros for quick procedure definition
« Reply #7 on: December 13, 2024, 09:19:17 PM »
Some time ago  sed Curl buy now I din't think to it.


Thank You :D :D :D :D :D :D :D
--------------------------------
Kenavo