SolvedProblem with loading DLL

Posts 1–9 of 9 · Page 1 of 1
Problem with loading DLL
I wrote such LoadLib.cpp:
Code:
#include "stdafx.h"

using namespace std;

int main(int argc, char* argv[])
{
	if (argc == 1)
	{
		cout << "Please specify dll name with \".dll\" as argument" << endl;
	}
	else
	{
		char* libName = argv[1];
		HMODULE handle = LoadLibraryA(libName);
		if (handle)
			cout << "Successfully loaded" << endl;
		else
		{
			LPWSTR lpMsgBuf;

			FormatMessage( 
				FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
				NULL,
				GetLastError(),
				MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
				(LPTSTR) &lpMsgBuf,
				0,
				NULL 
			);

			//cout << "Error:\n" << lpMsgBuf << endl;
			MessageBoxW(0, lpMsgBuf, L"GetLastError()", MB_ICONERROR);

			// Free the buffer.
			LocalFree( lpMsgBuf );
		}
	}
	system("pause");

	return 0;
}
When I transfer to it, for example, D3DX9_42.dll, it loads with success. It also works with msvcp71.dll, atl71.dll and others. But when I run it with *80 or CShell.dll it shows these errors:

What's the problem?
Have you tried the messagebox method?
Where you inject a simple msgbox dll and cshell.
Can you explain it more? Or give a link please

---------- Post added at 07:15 PM ---------- Previous post was at 07:03 PM ----------

I also tried loadlib from this topic and it shows same errors, so the problem isn't in my code
I don't know of any link sorry.
This method doesnt work for everyone but iv never had an issue since i started doing it like this.

Just create a simple dll that creates a thread with an inf loop for your messagebox.

Code:
void TheThread()
{
      while (true)
     {
         Sleep(1);
        //Your messagebox here
     }
             
}
BOOL WINAPI DllMain(HMODULE dHandle, DWORD nReason, LPVOID Reserved)
{
	if(nReason == DLL_PROCESS_ATTACH)
	{
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)TheThread, NULL, NULL, NULL);
	}
	return TRUE;
}
Thing is, if you try injecting cshell into CF, CF just closes.
The messagebox forces CF to stay open.

Take your injector, choose cshell.dll and the msgbox.dll and double click crossfire from your install folder.
Dont open CF the way you normally do, do it from the install folder.
Solution to LoadLibrary (CShell).

1 - Download VC++ 2005.

2 - C&P This:

Code:
#include "windows.h"
#include <iostream>

int main()
{
	DWORD err;
	HINSTANCE hDLL = LoadLibrary("CShell.dll");               // Handle to DLL
	if(hDLL != NULL) {
		printf("Library has been loaded\n");
        }
	else 	{
        err = GetLastError();
		printf("Couldn't load dll\n");
	}
	system("pause");
	return 0;
}
3 - Put on your Crossfire folder and Open the Archive. You got free LoadLibrary.

Credits: @DOCtor and @giniyat101
XarutoUsoCrack, my code is exactly the same, but VC++ version is 2010 not 2005, I don't think there is difference. But you give me an idea I'll try compile with 2012 version (probably *80 DLL's corresponds to VS 2012 runtime)

I have a suspicion that these simple methods were fixed, because I heard they made some major update recently.
Quote Originally Posted by needhash View Post
XarutoUsoCrack, my code is exactly the same, but VC++ version is 2010 not 2005, I don't think there is difference. But you give me an idea I'll try compile with 2012 version (probably *80 DLL's corresponds to VS 2012 runtime)

I have a suspicion that these simple methods were fixed, because I heard they made some major update recently.
yeah there is a different. vs2005 uses msvcp80.dll while vs2010 uses msvcp100.dll.
Quote Originally Posted by needhash View Post
XarutoUsoCrack, my code is exactly the same, but VC++ version is 2010 not 2005, I don't think there is difference. But you give me an idea I'll try compile with 2012 version (probably *80 DLL's corresponds to VS 2012 runtime)

I have a suspicion that these simple methods were fixed, because I heard they made some major update recently.
this is not an error what will be fixed this error is a protection system to stop debug / open cshell.dll whit ollydbg
yeah I already understand this. topic may be closed
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?