R
R
rakcheevdmitriy2014-12-21 04:45:16
C++ / C#
rakcheevdmitriy, 2014-12-21 04:45:16

Problem with function call from DLL. Can you help?

Hello.
I'm trying to call an exported function from a dll, but the program fails. By offsets, I came to the line mov eax,[libssp-0.dll!__stack_chk_guard], where the program ends its work.
Can anyone tell me what is the problem here and how to get rid of it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
maaGames, 2014-12-21
@rakcheevdmitriy

Broke the stack. Most likely the function was stdcall, and you called it as cdecl. Or vice versa. The crystal ball refuses to show in more detail.

R
rakcheevdmitriy, 2014-12-21
@rakcheevdmitriy

I export the function as: int __declspec(dllexport) main(int argc, char *argv[]).
I call:
int (*DllFunc)();
h = LoadLibraryA((LPCSTR)"D:\\programms\\MinGW\\msys\\1.0\\tor\\tor-dll\\tor-0.2.4.24\\src\\or\\tor.dll") ;
DllFunc =(int(*) (void)) GetProcAddress(h, (LPCSTR)"main");
Dll Func();
If it helps no more wang :)

P
Power, 2014-12-21
@Power

You are exporting a function with two arguments, but you are importing with no arguments. It is not right.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question