PDA

View Full Version : Disasm Vs. VC++ 6.0


anorak
August 10th, 2006, 13:13
im making an plugin using the disasm library (ollydbg 1.4)

and im stuck with one problem:

Plugin.obj : error LNK2001: unresolved external symbol "unsigned long __stdcall Disasm(char *,unsigned long,unsigned long,struct t_disasm *,int)" (?Disasm@@YGKPADKKPAUt_disasm@@H@Z)
../Debugger.dll : fatal error LNK1120: 1 unresolved externals

i dont know why it heppend but found one thing if the call of disasm function goes from ".c" file (and the project is fully c(the demo works)) everything goes ok,if not - then not


if anyone could help it would be great

ancev
August 11th, 2006, 09:30
hi,

to me, seens the problem is the "decorated" function name: Disasm@@YGKPADKKPAUt_disasm@@H@Z

ancev

anorak
August 11th, 2006, 11:07
yeah t he problem is in that the comiler is makin incorrect name and the linker cant find the right function to be called

but i dont know how to fix it - the problem is in that ".c" files are compilied like C and ".cpp" are compiled like C++ modules...

Knight
August 12th, 2006, 00:42
Put OllyDbg PDK include headers within
Code:
extern "C"{
/*includes/definitions here*/
}


Regards,
Knight

blabberer
August 12th, 2006, 01:34
i am writing this off the cuff
but did you try using alex clarks pdk (its available in original as well as in the mirror here) he modified the pdk to make it work with vc 6.0 and 7.0

i think your problem relates to some definitions in header files that vc doesnt recognize properly

Quote:

Modified PDK from Alex Clarke. He wrote:


Oleh,

Firstly congratulations and thanks for OllyDbg - it's incredibly good. I've been playing with the SDK using C++ for a plugin. I've made a few modifications that make the SDK header work better when using it in C++ code in (at least) a couple of newer C++ compilers (namely Borland C++ builder v1 and Visual Studio.net). They also remove various errors/warnings and the need for unsigned characters (when compiling .cpp's) or forcing byte packing (any source file). Finally I've got intellisense working with the SDK (the code hints in VisC).

Here's how the edits work:


http://ollydbg.de/whatsnew.htm

anorak
August 12th, 2006, 02:10
heheh
guys im not making the plugin for OllyDbg - im making a plugin for my own proggie - using disasm library

but thanks for idea - i can see what in PDK was changed for working correctly with VC++

anorak
August 12th, 2006, 02:21
ok guys - found a solution - it will help in future for guys like me

just write extern and cdexl at any function in disasm.h, for example:

extern int cdecl Assemble(char *cmd,ulong ip,t_asmmodel *model,int attempt,
int constsize,char *errtext);

good luck

anorak
August 12th, 2006, 02:44
sorry for flood- but it doesnt works(((((

Debugger.obj : error LNK2001: unresolved external symbol _Disasm@20
../Debugger.dll : fatal error LNK1120: 1 unresolved externals

Maximus
August 12th, 2006, 08:02
uhm...
remember that they are GPL, and _even_ if you warp them up in a dll, you need to distribute the whole application source that integrates with it. No way out.

made it extern "c"?