Results 1 to 4 of 4
  1. #1
    virus1g's Avatar
    Join Date
    Nov 2015
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0

    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;
    }

  2. #2
    cameronh's Avatar
    Join Date
    Oct 2016
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    3
    My Mood
    Bitchy
    Please don't say you watched Masterloosers video on how to 'make your own cheat' - then copied the sourcecode with what he put..

  3. #3
    Zaczero's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    localhost
    Posts
    3,288
    Reputation
    1517
    Thanks
    14,262
    My Mood
    Angelic
    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 .
    . . . malsignature.com . . .



    [ global rules ] [ scam report ] [ image title ] [ name change ] [ anime force ]
    [ league of legends marketplace rules ] [ battlefield marketplace rules ]

    "because everytime you post a picture of anime in here
    your virginity's time increases by 1 month"
    ~Smoke 2/18/2018


    Former Staff 09-29-2018
    Battlefield Minion 07-21-2018
    Premium Seller 03-04-2018
    Publicist 12-10-2017
    League of Legends Minion 05-31-2017
    Premium 02-05-2017
    Member 10-13-2013

  4. #4
    Gaar's Avatar
    Join Date
    Jun 2015
    Gender
    male
    Location
    𝙎𝙪𝙞𝙘𝙞𝙙𝙖𝙡 ♥‿♥
    Posts
    6,228
    Reputation
    852
    Thanks
    1,669
    Been over a week since last bump/update. Assuming solved.

    //closed.

Similar Threads

  1. Visual studio error
    By ZectixV1 in forum Counter-Strike 2 Help
    Replies: 1
    Last Post: 03-18-2015, 04:12 PM
  2. [Help] Visual Studio: Error CS1001: Identifier expected
    By Reepa171 in forum Coders Lounge
    Replies: 0
    Last Post: 12-19-2014, 02:12 AM
  3. [Help Request] Visual Studio Error
    By Rai Uchiha in forum Visual Basic Programming
    Replies: 5
    Last Post: 11-12-2014, 04:42 PM
  4. [Solved] Visual Studio Error
    By Rai Uchiha in forum Visual Basic Programming
    Replies: 2
    Last Post: 10-13-2014, 12:07 PM
  5. [Help Request] Visual Studios Error
    By deinemudda012345 in forum C# Programming
    Replies: 1
    Last Post: 12-27-2012, 05:41 AM