Hello, I'm having problems with ALink, whatever assembler i use to output the .obj file whenever i use this syntax:

alink -oPE -entry main X86.obj msvcrt.dll

ALink returns:


Loading file X86.obj
Loading file msvcrt.dll
Unsupported CPU type for module


What does this mean and how may I fix it?I need to link using ALink so GoLink or any other linker not supporting OMF files is out of the question. (By the way this happens with COFF too, not just OMF)

Any help is appreciated, thanks.
Posted on 2003-02-08 15:52:30 by kairon
Are you sure you want to link with msvcrt.dll and not msvcrt.lib? I think this would be my first time I heard a succesful linking with a dll.

// CyberHeg
Posted on 2003-02-09 04:14:06 by CyberHeg
Hm, ive linked with DLL's in this past with no problem. Learn something every day.:)

Where can I get msvcrt.lib?
Posted on 2003-02-09 05:05:23 by kairon
IIRC, msvcrt.dll is a c library. Maybe if vc is installed, it should be there
Posted on 2003-02-09 06:05:34 by roticv
Does anyone have it that can attach it?(I hope this isn't against board rules)
Also, how would I get the function names from .lib files?Like if printf happened to be called __printf in a lib file or something and I needed to know its new name.
Posted on 2003-02-09 07:13:50 by kairon

Does anyone have it that can attach it?(I hope this isn't against board rules)
Also, how would I get the function names from .lib files?Like if printf happened to be called __printf in a lib file or something and I needed to know its new name.


ftp://ftp.microsoft.com/Softlib/MSLFILES/msvcrt.exe
Posted on 2003-02-09 07:19:36 by bazik


Still "Unsupported CPU type for module" message from ALink
Posted on 2003-02-09 07:35:12 by kairon
Any ideas?:(
Like where I could get a good omf2coff program so I could just use golink instead of ALink?(If it wants to be so stubborn when linking with things)
Posted on 2003-02-09 14:49:24 by kairon
Kairon:

If you use ALINK you have two options to link omf files in a PE file.
Both options are valid if tou use NASM.

1. Use ALIB to create your .LIB file from your .DLL:

ALIB msvcrt.dll

You will get a msvcrt.lib file that you can use so:

alink -oPE -entry main X86.obj msvcrt.lib

You can call any win32 api using a macro as:

%MACRO wcall 1
extern __imp_%1
call [__imp_%1]
%ENDMACRO

2. Use EliCZ iIMP.exe to create a .IMP file from your DLL:

iIMP msvcrt.dll msvcrt

You will have to include your .IMP file in your .ASM NASM source code:

%INCLUDE "msvcrt.imp"

Then you call any win32 api using the same wcall macro.

I recommend you download the EliASM pack from:

http://www.anticracking.sk/EliCZ/infos.htm

greetings
Posted on 2003-02-15 00:00:09 by n u M I T_o r
ImpLib32 - ImpLib for Win32. ImpLib32 is a small utility which creates
an import library for Visual C++ 2.x/4.x/5.x from an existing DLL. ...

Back in the good old days of Windows 3.x, Microsoft supplied a tool called
IMPLIB. This tool was able to create a import library for a given DLL.
After creating this library, you linked it to your program in order to
call functions contained in the DLL.


Freeware:

This program is freeware. You can copy and distribute this program as long as
it is left in an unmodified form and no fee is charged. Please distribute
IMPLxxx.ZIP as a whole instead of the single files.


http://www.geocities.com/SiliconValley/5806/implib32.htm
Posted on 2003-02-15 22:54:52 by Nguga