Here is version 3.45 Beta 1 of my tool scan.exe now supporting Nasm.

Originally, intended to use with Fasm, this tool reads source files and searches for external functions called by the invoke statement. It creates an include file containing all the declarations of external functions eliminating the usage of conventional include files like, etc.

An example from the nasm32 package :

%include '..\' ;* skip this line
%include 'Msgbox.imp'

%define FALSE 0
%define NULL FALSE
%define MB_OK 0h

entry    demo1

proc    demo1
    invoke    my_p, dword szContentTwo, dword szTitleTwo ;*
    invoke    MessageBox, dword NULL, dword szContent, dword szTitle, dword MB_OK
    invoke    ExitProcess, dword NULL


proc    my_p
sz_Content    argd
sz_Title      argd

    invoke    MessageBox, dword NULL, dword argv(sz_Content), dword argv(sz_Title), dword MB_OK


    szTitle:      db  'Demo1', 0x0
    szTitleTwo:    db  'Demo1 Procedure', 0x0
    szContent:    db  'Hello from the Application!', 0x0
    szContentTwo:  db  'Hello from the Procedure!', 0x0

scan Msgbox.asm -na

The output file Msgbox.imp :

%define __stdcall_defined_ExitProcess _ExitProcess@4
%define __stdcall_defined_MessageBox _MessageBoxA@16
Posted on 2006-07-03 13:32:31 by Vortex
This would be pretty neat when used with a beefed-up batch file :)
Posted on 2006-07-03 17:39:52 by SpooK
I think that's its intended purpose. Paul used it along with a batch file.  ;)
Posted on 2006-07-07 21:10:30 by roticv
I would recommend for more advanced users, include files are there to prevent mistypings. Something might get past the assembler, but the linker would complain and die.
Posted on 2006-07-08 00:30:36 by SpooK
It depends on your personal choice. Assemblers like Fasm and GoAsm don't check the number of passed parameters.
Posted on 2006-07-08 02:24:17 by Vortex
Version 3.45

Support for C functions :

%include '..\' ;*

%include 'demo.imp'

%define cinvoke invoke ;*

caption : db "Hello",0x0
msg1 : db "Nasm",0x0
msg2 : db 'demo',0x0
format : db "%s %s",0x0

buffer : resb 10

entry demo

proc    demo

    cinvoke  wsprintf,dword buffer,dword format,dword msg1,dword msg2
    invoke  MessageBox, dword 0, dword buffer, dword caption, dword 0
    invoke  ExitProcess, dword 0


scan demo.asm -na

%define __stdcall_defined_ExitProcess _ExitProcess@4
%define __stdcall_defined_MessageBox _MessageBoxA@16
%define __cdecl_defined_wsprintf _wsprintfA
Posted on 2006-07-12 12:16:45 by Vortex