News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

LIB2LIB

Started by bomz, February 12, 2013, 06:23:05 PM

Previous topic - Next topic

bomz

 :lol:

http://implib.sourceforge.net/index.html
http://implib.sourceforge.net/EN.HTM
make batch file
@echo off
color 0a
if "%~1"=="" exit /b
cd %~dp1
SetLocal EnableDelayedExpansion
\masm32\bin\dumpbin.exe /EXPORTS %~nx1 /out:%~n1.txt
echo include 'implib.inc'>%~n1.def
echo.>>%~n1.def
for /f "skip=9 delims=" %%i in (%~n1.txt) do (
if not !stop!==stop (
if "%%i"=="  Summary" (
set stop=stop
) else (
set string=%%i
set string=!string:~18!

set name=!string:~1!
for /f "delims=@" %%a in ('echo !name!') do set name=%%a

echo implib %~n1.dll, !string!, !name!>>%~n1.def
)
)
)
echo.>>%~n1.def
echo endlib>>%~n1.def
echo.
fasm %~n1.def %~nx1.lib
pause

it's makes from DDK_XP lib such files:
include 'implib.inc'

implib kernel32.dll, _ActivateActCtx@8, ActivateActCtx
implib kernel32.dll, _AddAtomA@4, AddAtomA
implib kernel32.dll, _AddAtomW@4, AddAtomW
.............................................
endlib

than FASM makes LIB from it. New LIB works but something wrong with mask signs through back converting.
What is wrong?
http://s018.radikal.ru/i514/1302/49/0b38119938a4.gif

japheth


Cool little "movie"! ( I particularly like the green color )


However, for finding errors it's probably way better to provide a simple, old-fashioned text that describes the cmdline parameters how fasm is launched - and, additionally, attach the input file that fasm is to assemble!

bomz

if I attach file hutch eat me without solt . all files download from first url and lib from microsoft site . how add them see screen

ragdog

Quoteif I attach file hutch eat me without solt


:badgrin: :badgrin:

japheth

Quote from: bomz on February 12, 2013, 08:33:07 PM
if I attach file hutch eat me without solt . all files download from first url and lib from microsoft site . how add them see screen

That's nonsense because there's no copyright violation. I'm not going to do thousand additional things just because of an ignorant person.

bomz

I ask two forums else, of course attach all files, but nobody answer me

dedndave

not sure what you mean by "wrong mask signs"

Quoteif I attach file hutch eat me without solt

i heard a similar phrase in the tv series "Justified"
Quotei am going to smile real big and eat a nice plate of shit, with no salt
:lol:

bomz

if begin convert "new" lib you don't get the same result as with DDK lib.
if open LIB in notepad the difference __imp__fname __imp___fname

bomz

#8
LIB 2 INC (without FASTCALL!)
Quote@echo off
color 0a
rem --------------------------
rem ©™Alex_Piggy ru-board.com®
rem --------------------------
if "%~1"=="" exit /b
cd %~dp1
set fname=%~n1
SetLocal EnableDelayedExpansion
\masm32\bin\dumpbin.exe /EXPORTS %~nx1 /out:%fname%.txt
set string=%fname%
for /f "tokens=2* delims=:" %%i in ('find "" ":%string%\" 2^>^&1') do set upstring=%%j
set upstring=%upstring:~0,-1%
echo ; ---------------------------------------------------------------->%fname%.inc
echo ;      %fname%.inc>>%fname%.inc
echo ; ---------------------------------------------------------------->>%fname%.inc
echo.>>%fname%.inc
echo    IFNDEF %upstring%_INC>>%fname%.inc
echo    %upstring%_INC equ ^<1^>>>%fname%.inc
echo.>>%fname%.inc
for /f "skip=9 delims=" %%i in (%fname%.txt) do (
   if "%%i"=="  Summary" goto :break
      set "string=%%i"
      set string7=!string:~18,1!
      if not "!string7!"=="?" (
         set "string=!string:~19!"
         set "string5=!string:@=A@!"
         set "string6=!string:@=W@!"
( echo !string! | findstr "@" && (findstr /c:"!string5!" /c:"!string6!" %fname%.txt || call :stdcall) || (findstr /c:"!string!A" /c:"!string!W" %fname%.txt || call :decl))>nul
      )
)
:break
echo.>>%fname%.inc
echo    ELSE>>%fname%.inc
echo       echo ------------------------------------------->>%fname%.inc
echo       echo WARNING duplicate include file %fname%.inc>>%fname%.inc
echo       echo ------------------------------------------->>%fname%.inc
echo    ENDIF>>%fname%.inc
pause
del %fname%.txt
exit /b

:stdcall
SetLocal EnableDelayedExpansion
set string2=%string:*@=%
set string3=!string:@%string2%=!
if !string2!==0 (
   set string=!string:@%string2%= PROTO STDCALL!
) else (
   set string=!string:@%string2%= PROTO STDCALL !
)
:next
set /a string2=!string2!-4
if !string2!==0 (
   set string=!string!:DWORD&& goto :next
) else (
   if not !string2!==-4 set string=!string!:DWORD,&& goto :next
)
echo !string!>>%fname%.inc
set string4=!string3:~-1!
if !string4!==A (
(echo   !string3:~0,-1! equ ^<!string3!^>)>>%fname%.inc
)
exit /b

:decl
SetLocal EnableDelayedExpansion
set string4=!string:~-1!
set string3=!string!
set string=!string! PROTO C :VARARG
echo !string!>>%fname%.inc
if !string4!==A (
(echo   !string3:~0,-1! equ ^<!string3!^>)>>%fname%.inc
)
exit /b

hutch--

Hmmmm,

The data at this uRL "http://implib.sourceforge.net/EN.HTM" is simply wrong. MASM32 has provided a working MSVCRT import library for years. The tools for creating it are in the directory "\masm32\tools\makecimp".

> That's nonsense because there's no copyright violation. I'm not going to do thousand additional things just because of an ignorant person.

Yet another profundity from a backyard GPL lawyer. Whats mine is mine, whats yours is mine, whats theirs is mine but don't touch anything thats mine.  :P

bomz

implib.inc is sourceforge.net
bin fasm free for copy and distribution with license file
kernel32.lib ???
who interested download all files

hutch--

I would try and explain it but you won't even read anything when its translated into Russian.

bomz

google translator makes terrible translation, because English use fixed word order in sentence, as all Latin language group even Poland and
some respect Ukrainian, but Russian have not fixed word order in sentence, word order may change sense 100%

plus prepositions . I 1 hours find with google in all internet to find how say
Drug and Drop ON\INTO\TO batch file ???

get russian subtitles translate it with google and try to see movie

hutch--

Russian is just anoth4er Indo-European language that is much closer to English than say Chinese or worse, Japanese. I have had no problems translating Russian with Google and while the word order is a little strange, its no harder to read that say Greek.

Vortex

Hi bomz,

Wouldn't it be better to rename your tool to something like dll2lib?