[CGO] | Calling C structs(easyhook.h) worked but functions (easyhook.h) not worked.

75 views
Skip to first unread message

Ahmet Tarık GUNAL

unread,
Dec 22, 2019, 11:24:19 AM12/22/19
to golang-nuts

https://play.golang.org/p/MLxY6yh2bQn

Capture.PNG


Hi,

Yes, as you can see, struct works and C.myBeepHook(dllmain.h), but unfortunately the C functions(easyhook.h) don't. if I don't call the C functions(easyhook.h) are compiled normally (few second). It is compiled quickly (60 ms) if I call the C functions(easyhook.h). It's weird and I don't get any output when I run it, but when I open it in gui it throws an error like "the code execution cannot proceed because EasyHook64.dll" but not relevant.


Where am i making a mistake? What do you think is the problem?


Thank you so much.


Is there a preview mode in google groups? Because I can't preview this post, sorry.


Jan Mercl

unread,
Dec 22, 2019, 11:29:51 AM12/22/19
to Ahmet Tarık GUNAL, golang-nuts


On Sun, Dec 22, 2019, 17:24 Ahmet Tarık GUNAL <gahme...@gmail.com> wrote:

Yes, as you can see,


No, I cannot read the picture in mobile gmail. Please post code and/or terminal output as plain text only. 

Thanks.

Jan Mercl

unread,
Dec 22, 2019, 11:33:17 AM12/22/19
to Ahmet Tarık GUNAL, golang-nuts
And sorry for me missing the playground link completely. I'm becoming gradually lost without my glasses. Apologies.

On Sun, Dec 22, 2019, 17:24 Ahmet Tarık GUNAL <gahme...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3cf3879b-9164-46c7-872d-044c027eab3f%40googlegroups.com.

Ahmet Tarık GUNAL

unread,
Dec 22, 2019, 8:44:16 PM12/22/19
to golang-nuts
It was just for the messagebox error. Not for the others(powershell output etc. [go build -v -x go-easyhook.go]). Don't get confused.

22 Aralık 2019 Pazar 19:29:51 UTC+3 tarihinde Jan Mercl yazdı:

Ahmet Tarık GUNAL

unread,
Dec 22, 2019, 8:44:43 PM12/22/19
to golang-nuts
Please forgive me. I put the link to top. Unfortunately, there was no preview, so I didn't know what kind of post I had.

22 Aralık 2019 Pazar 19:33:17 UTC+3 tarihinde Jan Mercl yazdı:
And sorry for me missing the playground link completely. I'm becoming gradually lost without my glasses. Apologies.

On Sun, Dec 22, 2019, 17:24 Ahmet Tarık GUNAL <gahme...@gmail.com> wrote:

https://play.golang.org/p/MLxY6yh2bQn

Capture.PNG


Hi,

Yes, as you can see, struct works and C.myBeepHook(dllmain.h), but unfortunately the C functions(easyhook.h) don't. if I don't call the C functions(easyhook.h) are compiled normally (few second). It is compiled quickly (60 ms) if I call the C functions(easyhook.h). It's weird and I don't get any output when I run it, but when I open it in gui it throws an error like "the code execution cannot proceed because EasyHook64.dll" but not relevant.


Where am i making a mistake? What do you think is the problem?


Thank you so much.


Is there a preview mode in google groups? Because I can't preview this post, sorry.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.

Tamás Gulácsi

unread,
Dec 23, 2019, 12:49:50 AM12/23/19
to golang-nuts
If I read it correctly, EasyHook64.dll is not found.

That's the error.
It is relevant.

Make sure it is in the same directory with your exe, or in %PATH%, or wherever kernel.dll finds it.

Ahmet Tarık GUNAL

unread,
Dec 23, 2019, 3:09:32 AM12/23/19
to golang-nuts
I made the same mistake as this link --> https://stackoverflow.com/q/48845724/12569565 

Yes this is relevant. I thought you'd look under the Ldflags. So I made weird and ignored it.

It worked when I placed the DLLs in the main directory.

Thank you so much.

23 Aralık 2019 Pazartesi 08:49:50 UTC+3 tarihinde Tamás Gulácsi yazdı:
Reply all
Reply to author
Forward
0 new messages