// Undetected.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <Windows.h>
#define Reload 0xC2C
#define WeaponPointer 0xB74118
#define Client_Error 0x000000 //removed for leechers
int _Add(void)
{
bool noreload = true;
do
{
DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
DWORD pWeaponPointer = *(DWORD*)(CShell + WeaponPointer);
if(noreload)
{
if(pWeaponPointer)
{
for(int i = 0; i < 670; i++)
{
if((*(DWORD*)((*(DWORD*)(CShell+WeaponPointer))+(4*i))) != NULL)
*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponPointer))+(4*i))) + Reload) = 100;
}
}
}
}while(true);
Sleep(100);
}
void ClientError(void)
{
DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
if(CShell == 0)
{
HWND hWndTarget = FindWindow( NULL, "CrossFire"); //here is my error, "CrossFire" cannot be converted into LPCWSTR.
DWORD dwProcessId;
GetWindowThreadProcessId(hWndTarget, &dwProcessId);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId);
BYTE newdata[]={0x90};
DWORD newdatasize = sizeof(newdata);
WriteProcessMemory(hProcess, (LPVOID)Client_Error, &newdata, newdatasize, NULL);
}
_Add();
}
DWORD WINAPI _Add_Hook(LPVOID)
{
do
{
ClientError();
}while(GetModuleHandleA("CShell.dll") != NULL && GetModuleHandleA("ClientFx.fxd") != NULL);
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if(dwReason == DLL_PROCESS_ATTACH)
{
MessageBoxA(0, "Enjoy","Kaotic", 0);
CreateThread(0,0,(LPTHREAD_START_ROUTINE)_Add_Hook,0,0,0);
}
return true;
}
c:\users\transfer\documents\visual studio 2010\projects\undetected\undetected\undetected.cpp(38): error C2664: 'FindWindowW' : cannot convert parameter 2 from 'const char [10]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast