Question DLL Compiling issue

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

maxibaby

Newbie
Full Member
Oct 23, 2015
48
383
1
Basically, I have this DLL.

C++:
#include <tchar.h>
#include <windows.h>

using namespace std;

BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
{
    if (dwAttached == DLL_PROCESS_ATTACH) {
    	MessageBox(0 , _T("Successfull"), _T("Injection"), MB_OK);
	}

    return TRUE;
}
I would try to compile it on G++
C++:
g++ -shared main.cpp -o nte.dll
And the DLL won't work, DLL would be loaded, but thread is not created or dies instantly.


If I compile the same source on Visual Studio, everything would work good.
Where is the problem, what's happening?
 

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,294
37,938
269
Never used gpp myself, does the command you use also do linking for you?
 

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,745
40,528
316
Hmm, try creating a new thread in the DllMain. Maybe the g++ compiler detects the deadlock. Or maybe it doesn't link properly as mambda said.
 

maxibaby

Newbie
Full Member
Oct 23, 2015
48
383
1
Never used gpp myself, does the command you use also do linking for you?
Вroihon;37588 said:
Hmm, try creating a new thread in the DllMain. Maybe the g++ compiler detects the deadlock. Or maybe it doesn't link properly as mambda said.
Actually by default it should give me compiled version straight ahead or I could use -c to compile and then run without it to link, but tried both ways and still nothing.

Wondering if Visual Studio adds extra things on the file?
Maybe i'm missing something from https://www.mingw.org/wiki/sampledll
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods