Hi all :)

I have the following problem. There's a procedure called Assemble, with the following prototype:

; returns SDWORD
Assemble PROTO C _cmd:PTR BYTE, _ip:ulong, _model:PTR t_asmmodel, _attempt:SDWORD, _constsize:SDWORD, _errtext:PTR BYTE


Where ulong is:

ulong? ?TYPEDEF QWORD? ? ? ? ? ? ? ? ? ; Unsigned long


And tried to call it with the following code:

invoke Assemble,addr szCommand,0,addr asmmodel,0,4,addr szError


Where szCommand and szError are ASCIIZ string buffers, and asmmodel is a structure the procedure fills on return (I can post the definition if it matters, but I don't think it does).

Masm complains when trying to assemble that line:

C:\Libre\disasm\asm\test.asm(89) : error A2114: INVOKE argument type mismatch : argument : 2


I'm sure some tree is not letting me see the forest here... any help? :(
Posted on 2005-04-26 16:45:40 by QvasiModo
Hi QvasiModo

why not use a pointer to ulong

Assemble PROTO C _cmd:PTR BYTE, _ip:DWORD, _model:PTR t_asmmodel, _attempt:SDWORD, _constsize:SDWORD, _errtext:PTR BYTE



Posted on 2005-04-26 17:24:59 by mistronr1
Never mind, I just realized that an ulong is 4 bytes in size, not 8. I knew it had to be something stupid...  :(
I can't change the prototype, I'm trying to interface with a C library. Thanks anyway :)
Posted on 2005-04-26 17:34:19 by QvasiModo
Ok, now I have another problem... :shock:

disasm.lib(assembl.obj) : error LNK2001: unresolved external symbol _sizesens
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _sizesens
disasm.lib(assembl.obj) : error LNK2001: unresolved external symbol _ideal
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _ideal
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _iswindowsnt
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _stackalign
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _lockedbus
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _extraprefix
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _badshift
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _iocommand
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _privileged
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _decodevxd
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _farcalls
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _symbolic
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _shortstringcmds
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _shownear
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _showmemsize
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _putdefseg
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _extraspace
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _tabarguments
disasm.lib(disasm.obj) : error LNK2001: unresolved external symbol _lowercase


I'm posting the whole program this time.
Posted on 2005-04-26 17:53:04 by QvasiModo
The static library is made of OllyDbg's assembly and disassembly modules. This is how I built it (using Pelle's C):
Posted on 2005-04-26 17:55:22 by QvasiModo
Found the problem again :) some public variables were being defined in the host program, I've changed that so they're defined in the library itself.
Posted on 2005-04-26 19:24:38 by QvasiModo