During the stage of code development for the FASM Coff output,the first task is to convert properly the API function prototypes:


MessageBox equ <MessageBoxA>


extrn __imp__MessageBoxA@16:dword
MessageBox equ [__imp__MessageBoxA@16]

My simple inc2inc tool is intended to convert the function prototypes to the raw form. The tool accepts the .inc files produced by Hutch's l2inca utility.After the conversion process,the full list with the raw form
of prototypes is obtained.

With some minor modifications in the stdcall.inc file (check the stdcall2.inc file),you can invoke directly the API functions as usually:


invoke MessageBox,0,message,caption,MB_OK

I included three examples in the .zip file.Note that you will observe that the .obj files are bloated with the unused function declarations,but this doesn't affect the lenght of the final .EXE file.I think,the solution
is to shorten the .inc files:keep the frequently used functions and delete the majority of the unused ones.


inc2inc <source file> <destination folder>


inc2inc \masm32\include\kernel32.inc \fasm\include

Sorry,the wildcards are not available.Any feedback will be appreciated.


Posted on 2002-11-17 09:41:54 by Vortex
Nice idea! :alright:

(tr : harikasin dostum!)
Posted on 2002-11-18 06:51:57 by CYDONIA
Here is the new version(1.01) of my tool.
Now,the object files are not bloated:the unused APIs are not included in the obj file.
The linking operation is now very fast.

The .inc files appears as:

if used AddAtom
extrn '__imp__AddAtomA@4' as AddAtom
end if
if used AddConsoleAlias
extrn '__imp__AddConsoleAliasA@12' as AddConsoleAlias
end if
if used AllocConsole
extrn '__imp__AllocConsole@0' as AllocConsole
end if


Posted on 2003-01-21 14:32:18 by Vortex
Version 1.02

Now,the tool supports the static libraries. :)

Function prototype converter for Fasm COFF output
Usage : inc2inc -type <source file> <destination folder>
type of library:
-d:dynamic library
-s:static library

Example:if you want a FASM version of masm32.inc,

inc2inc -s \masm32\include\masm32.inc destinationfolder

For kernel32.inc:

inc2inc -d \masm32\include\kernel32.inc destinationfolder


Posted on 2003-02-12 05:30:36 by Vortex
Version 1.03

*Now,no need anymore of modified stcall macros.(stcall2 etc...)
You can use the original macros from the FASM package.

Modified declarations:

if used AddAtom
extrn '__imp__AddAtomA@4' as AddAtom:dword
end if

*WideChar support
Posted on 2003-05-28 01:42:35 by Vortex