SolvedVisual Studio Error

Posts 1–4 of 4 · Page 1 of 1
Visual Studio Error
Whilst compiling de_stroyer to test i get this error which since im new i have no idea how to fix.

Severity Description Project File Line Suppression State
Error 'int wcscmp(const wchar_t *,const wchar_t *)': cannot convert argument 1 from 'CHAR [260]' to 'const wchar_t *' injector C:\Users\cool\Desktop\sickmemeSource\injector\inje ctor.cpp 13






My injector.cpp file which i assume i should include since the error occurs here.



Code:
#include "injector,h"

bool FindProcessByName(string strProcessname, DWORD &_dwProcessID)
{
	std::wstring szTempName = std::wstring(strProcessname.begin(), strProcessname.end());
	const wchar_t* wszName = szTempName.c_str();

	HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
	PROCESSENTRY32 ProcEntry;
	ProcEntry.dwSize = sizeof(ProcEntry);

	do
		if (!wcscmp(ProcEntry.szExeFile, wszName))
		{
			CloseHandle(hSnapshot);
			_dwProcessID = ProcEntry.th32ProcessID;
			return true;
		}
	while (Process32Next(hSnapshot, &ProcEntry));

	return false;
}

bool Injector::Inject(string strProcessName, string strDLLPath)
{
	DWORD dwProcessID, dwMemSize;
	HANDLE hProcess;
	LPVOID lpRemoteMemory, lpLoadLibrary;
	char szPath[MAX_PATH];

	if (!FindProcessByName(strProcessName, dwProcessID))
		return false;

	GetFullPathNameA(strDLLPath.c_str(), MAX_PATH, szPath, NULL);

	if (_access(szPath, 0) != 0)
		return false;

	dwMemSize = strlen(szPath) + 1;
	hProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_CREATE_THREAD, FALSE, dwProcessID);
	lpRemoteMemory = VirtualAllocEx(hProcess, NULL, dwMemSize, MEM_COMMIT, PAGE_READWRITE);
	WriteProcessMemory(hProcess, lpRemoteMemory, (LPCVOID)szPath, dwMemSize, NULL);
	lpLoadLibrary = GetProcAddress(GetModuleHandleA("Kernel32.dll"), "LoadLibraryA");

	if (CreateRemoteThread(hProcess, NULL, NULL, (LPTHREAD_START_ROUTINE)lpLoadLibrary, lpRemoteMemory, NULL, NULL))
	{
		VirtualFreeEx( hProcess, ( LPVOID ) lpRemoteMemory, 0, MEM_RELEASE );
		CloseHandle(hProcess);
		return true;
	}
	else 
		return false;
}
Please don't say you watched Masterloosers video on how to 'make your own cheat' - then copied the sourcecode with what he put..
Quote Originally Posted by cameronh View Post
Please don't say you watched Masterloosers video on how to 'make your own cheat' - then copied the sourcecode with what he put..
Xd .
Been over a week since last bump/update. Assuming solved.

//closed.
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us