News:

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

Terminate Process

Started by Force, May 12, 2012, 09:58:30 PM

Previous topic - Next topic

dedndave

curiosity got the better of me - lol
so, i played with this some more...

as it turns out, Hutch uses his own lib tool called inc2l.exe to create the libraries
it works by using ML and LINK to create the import LIB from the INC file
when i use this IF/ELSE structure in the INC file....
IFDEF __UNICODE__
  Process32First equ <Process32FirstW>
ELSE
  Process32First PROTO STDCALL :DWORD,:DWORD
ENDIF

the inc2l program does not attempt to create an import for the symbols in the IF/ELSE
my guess is that it assumes they are all EQUates and moves on

most functions have names like SomeFuncA and SomeFuncW
the tool works ok in those cases because both may be prototyped, then an EQU can be used to select one as SomeFunc
these functions use a different naming convention, and thus, the problem arises

i am going to assume that Erol's tools create good import libraries
Hutch uses a different tool to avoid creating DEF files
which (i believe) is how older versions of the masm32 package built LIB's

as for the size of the import libraries created by inc2l.exe - ouch !   :eek

Vortex

my def2lib creates short import libraries, this is why the size is smaller. MS' library manager lib.exe follows the long import library convention. Long time ago, I created an include file to import library converter ( another version of inc2lib ) but that tool's dependency was polib.exe  def2lib's work is based on MS COFF format specification and does not depend on other tools.

Microsoft PE and COFF Specification :

QuoteIn an import library with the long format, a single member contains the following information:
   Archive member header
   File header
   Section headers
   Data that corresponds to each of the section headers
   COFF symbol table
   Strings
In contrast, a short import library is written as follows:
   Archive member header   
   Import header
   Null-terminated import name string
   Null-terminated DLL name string

This is sufficient information to accurately reconstruct the entire contents of the member at the time of its use.

http://msdn.microsoft.com/library/windows/hardware/gg463125

dedndave

ahhh - thanks Erol   :U

it wouldn't seem to hard to write a little program that just locates "PROTO" strings
then, uses def2lib   :P

Force

Vortex
Your tools thats in ur site are too usefull  :U
Never Stop Until You Are Better Than The Best

xandaz

   There seems to be yet another problem.
PROCESSENTRY32 STRUCT
    dwSize              DWORD ?
    cntUsage            DWORD ?
    th32ProcessID       DWORD ?
    th32DefaultHeapID   DWORD ?
    th32ModuleID        DWORD ?
    cntThreads          DWORD ?
    th32ParentProcessID DWORD ?
    pcPriClassBase      DWORD ?
    dwFlags             DWORD ?
    szExeFile           db MAX_PATH dup(?)
PROCESSENTRY32 ENDS


doesnt seem to work with unicode.
szExeFile dw MAX_PATH dup(?)...works tho.
    I don't know if everyone has this problem with their masm sdk...Thanks and later

dedndave

yes - for unicode, szExeFile should be defined with WCHAR's - not bytes
so - the structure size would be 556 bytes