News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A question for Vortex

Started by rags, September 05, 2009, 02:13:26 AM

Previous topic - Next topic

rags

What advantage does your tool "External Scanner v3.51" provide over just using the include files
for the appropiate function?
ie: include kernel32.inc
    includelib kernel32.lib
God made Man, but the monkey applied the glue -DEVO

Vortex

Hi rags,

The original purpose of creating scan.exe was to support Fasm to automate the task of writing API function declarations :

section '.idata' import data readable writeable

  library kernel32,'kernel32.dll',\
          user32,'user32.dll'

  import kernel32,\
         ExitProcess,'ExitProcess',\
         GetModuleHandle,'GetModuleHandleA'

  import user32,\
         DialogBoxParam,'DialogBoxParamA',\
         EndDialog,'EndDialog'


Six years ago, the first versions of this tool was a compensation as there was not much include files for Fasm. Later, I added other switches to support other assemblers.
An example, if you wish to eliminate the jump table in your executable with direct function calls :

scan demo.asm -m2

demo.imp :

EXTERNDEF _imp__ExitProcess@4:PTR pr1
ExitProcess EQU <_imp__ExitProcess@4>

EXTERNDEF _imp__GetComputerNameA@8:PTR pr2
GetComputerName EQU <_imp__GetComputerNameA@8>

EXTERNDEF _imp__MessageBoxA@16:PTR pr4
MessageBox EQU <_imp__MessageBoxA@16>

prC TYPEDEF PROTO C :VARARG
EXTERNDEF _imp__sprintf:PTR prC
sprintf EQU <_imp__sprintf>


LzAsm, the Tasm ideal mode compatible assembler is offered without any support of include files. Scan.exe can generate the include file declaring all the external functions :

scan Dialog.asm -l3

EXTERN _ExitProcess@4:PROC
ExitProcess EQU <_ExitProcess@4>

EXTERN _GetModuleHandleA@4:PROC
GetModuleHandle EQU <_GetModuleHandleA@4>

EXTERN _DialogBoxParamA@20:PROC
DialogBoxParam EQU <_DialogBoxParamA@20>

EXTERN _EndDialog@8:PROC
EndDialog EQU <_EndDialog@8>

EXTERN _MessageBoxA@16:PROC
MessageBox EQU <_MessageBoxA@16>

EXTERN _SendMessageA@16:PROC
SendMessage EQU <_SendMessageA@16>


For daily programming purposes, Masm32's include files are always fine and you don't need scan.exe as a replacement for include files. I am intending to add some new swicthes to support more Bogdan's assembler SolAsm.