Help with FindWindow();

Posts 1–6 of 6 · Page 1 of 1
Help with FindWindow();
I have a base its undetected but for the sake of leechers i will put up a simple detected base with my error in it.

Code:
// 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;
}
I am trieing to NOP the address where it kicks you when u get a Client Error, any help or suggestions?
Quote Originally Posted by gcflames12 View Post
I have a base its undetected but for the sake of leechers i will put up a simple detected base with my error in it.

Code:
// 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;
}
I am trieing to NOP the address where it kicks you when u get a Client Error, any help or suggestions?
What is your error ?
Code:
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
Change character set to multi byte. have fun!
ah you must be trolling
use either FindWindowA( NULL, "CrossFire")
FindWindowW( NULL, L"CrossFire")
or FindWindow( NULL, TEXT("CrossFire"))
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us