News:

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

New version of L2INC

Started by hutch--, August 22, 2005, 08:56:58 AM

Previous topic - Next topic

hutch--

I have modified the last version of L2INC so that it has a duplicate guard and while it allows the file to build even with a duplicate which it excludes, it displays a warning at build that there is a duplicate include file. I have so far tested it on user32.inc and it displays this warning if it has already been included.


Assembling: H:\asm\ASM1\CNVTIF\cnvtif.asm
-----------------------------------------
WARNING Duplicate include file user32.inc
-----------------------------------------
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


I will manually do the same for the other include files as well as it will help people who have had problems with duplicate include files in the past.

IMPORTANT

With user32.inc, the following prototype for wsprintfA must be added manually in the following form after the IFNDEF line and the equate.


  ; ===========================================
  ; user32.inc copyright MASM32 1998 - 2005
  ; ===========================================

IFNDEF USER32_INC
USER32_INC equ <1>

IFNDEF _wininc_
  wsprintfA PROTO C :DWORD,:VARARG
  wsprintf equ <wsprintfA>
ENDIF


[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ToutEnMasm

Hello,
I was searching for the problem  with wsprintf and see your post.
Is it the same thing with all proto C in the library ?.
                                           ToutEnMasm

stanhebben

It's the same, I use it too.

  wsprintfW PROTO C :DWORD,:VARARG

Shylock

Hello Hutch,

I've got a little Problem with 'L2INC'. It doesn't build INC Files from any other LIB Files else those in MASM32 Directory. An Example:
I'll try to build an Include File from a File 'cll3216.lib' (It's a Lib File to Access a special Hardware Driver). So the following Message apears in the 'Dos Box':

Quote
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

c:\Assembler\Dunker\Lib\ASM>l2inc *.lib
Processing cll3216.lib

c:\Assembler\Dunker\Lib\ASM>

But the generated File doesn't exist!

:(

Hope you could solve my Problem,

Shy :8)

hutch--

Guys,

That particular tool performs one task only, it read STDCALL decorated names directly from the import library and creates include files from each library for those STDCALL. It was never intended to do otherwise. It does not handle C calling convention functions or any other format and it only works on Microsoft 32 bit COFF format libraries.

Pelle's tools have a different method if you can get the import list and it will build import libraries from DEF files.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Vortex

Shylock,

Can you post that library here?

ToutEnMasm

Hello,
I am writing a tool to extract and i can explain why sometimes l2inc failed.
The standard format of a library (pecoff.doc of microsoft) need two linkers.
A linker is where the list of symboles (functions ...) are.
The second linker have a list arranged in alphabetical order.Sometimes this linker doesn't exist,why i don't know.
L2inc write the proto in alphabetical order so he use the second linker,where sometimes there is no list.
For the SDK library ,Functions that are only in the first linker are not in the help file.
                                            ToutEnMasm

hutch--

The basics of l2inc does is scan the complete library file trapping words in the form "_function@16_" and adds them to a list, it then sorts the words, removes exact duplicates, does another pass to remove a near duplicate then parses each word into its prototype.

_function@16_ becomes function PROTO :DWORD,:DWORD,:DWORD,:DWORD

This tool cannot work on a C function name as there is no bytecount for the arguments.

When using Pelle's tools, I do it the other way round, dump a DLL using DumpPE, clean up the names then create a DEF file and then a LIB file from it.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Shylock

Quote from: Vortex on June 03, 2006, 09:11:15 AM
Shylock,

Can you post that library here?

I'll try to do my very best ...  :wink Ok, attached the .def and the .dll also...

greetz Shy  :8)

[attachment deleted by admin]

Vortex

Here is the include file extracted from the associated import library. All the functions are assumed to be C functions.

[attachment deleted by admin]

Vortex

Running your tool, I get an error message saying :

LoadLibrary failed - The specified module could not be found

Is there something that I am missing?

ToutEnMasm

#11
Hello,
have write protolib,he works like that:

Using the peformat,he read names in the second linker of the library.
If the library have object files,search for functions in it.
If not ,try to load the library,and verify that names are realy functions.
If there is'nt a second linker , the names in the first are writed in a text file.

Like that you are granted to find all the functions in the library.
proto C are only  write as proto C,only the header file .h can say how many arguments they need.

Protolib accept command file .cmd with the full path of the lib.
dir /S/B *.lib > file.cmd          (file can be any name)

I try it on the sdk list of lib without problem.
See the modify version at the bottom of posts

                        ToutEnMasm



[attachment deleted by admin]

Vortex

Thanks ToutEnMasm, now it works fine.

ToutEnMasm

#13
Hello,
see the workshop http://www.masm32.com/board/index.php?topic=5175.0 for final release and have a protolib that translate the decorated functions names of c++
I have made some changes in protolib.
Functions in the second linker are now extracted and translated,in the .txt.
When the library have no symbol,there was a little problem,corrected.
Conditions to be a function are one more:
        IMAGE_SYM_DTYPE function and SectionNumber != 0
        IMAGE_SYM_CLASS == IMAGE_SYM_CLASS_EXTERNAL
        and the one added  NumberOfAuxSymbols not zero
I have made a comparison between dumpbin (VC++ 2005) and protolib,it's a hard work,but I don't see differences.
Protolib made as named function as no "@".Ml can compiled this functions.If you know of such function with "@" inside them,mail me.The name can be shorter with them.

Have a look also at uuidlib.exe in the workshop,it's the little brother of protolib

                                           ToutEnMasm








[attachment deleted by admin]