[Help] Building Errors

Posts 114 of 14 · Page 1 of 1
[Help] Building Errors
Hello people,
I have finished my hack's source code, copied and pasted it in Visual C++ Studio (Base.cpp) but when building finishes it gives me some errors and i really can't figure out why.

These are the occuring errors:
Code:
1) error C2181: illegal else without matching if
2) error C2181: illegal else without matching if
3) error C2601: 'dwHackThread' : local function definitions are illegal
4) this line contains a '{' which has not yet been matched
5) error C2601: 'DllMain' : local function definitions are illegal
6) this line contains a '{' which has not yet been matched
7)fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\user\my documents\visual studio 2008\projects\hack\hack\base.cpp(64)' was matched
I think i can correct the 4,7 errors but what about the others?
Any help is appreciated.
Post your source dude you've done something retarded
Yeah post your source, or the error lines.
BUt it seems like you are missing some of those { }
Did you C&P something?
Ok here it is:

[php]#include <windows.h>
#define LTClient 0x37767BD0
bool IsGameReadyForHook()
{
if( GetModuleHandleA( "d3d9.dll" ) != NULL
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;
return false;
}
void __cdecl PushToConsole( const char* szCommand ){
DWORD *Ltclient = ( DWORD* )( LTClient );
void* CONoff = ( void* )*( DWORD* )( *Ltclient + 0x208 );
__asm
{
push szCommand;
call CONoff;
add esp, -3-1+2+6;
}
}
void main()
{
while(true)
Sleep(100);
{
if(GetAsyncKeyState(VK_INSERT)&1){
{
//No spread
PushToConsole("PerturbRotationEffect 0.000000");
PushToConsole("PerturbIncreaseSpeed 0.000000");
PushToConsole("PerturbWalkPercent 0.000000");
PushToConsole("PerturbFiringIncreaseSpeed 0.000000");
PushToConsole("PerturbRecoil 0.000000");
PushToConsole("FireMovePerturb 0.000000");
PushToConsole("ZoomedFireMoveDuckPerturb 0.000000");
PushToConsole("ZoomedFireMovePerturb 0.000000");
PushToConsole("ZoomedFireDuckPerturb 0.000000");
//No recoil
memcpy((LPVOID)0x3741A700, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3741A714, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3741A717, "\x90\x90\x90", 3);
memcpy((LPVOID)0x37418209, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3741A720, "\x90\x90\x90", 3);
//Removals
PushToConsole("DynamicLight 0");
PushToConsole("EnableWeatherFX 0");
PushToConsole("MuzzleLight 0");
PushToConsole("SnowEnable 0");
PushToConsole("CamDamage 0");
PushToConsole("ModelApplySun 0");
PushToConsole("ClientFXDetailLevel 0");
PushToConsole("ModelShadow_Proj_Enable 0");
PushToConsole("DebrisFXLevel 0");
PushToConsole("ScatterEnable 0");
PushToConsole("modelshadow_proj_blurenable 0");
PushToConsole("DrawAllModelShadows 0");
PushToConsole("ModelShadow_Proj_MinColorComponent 0");
PushToConsole("ModelShadow_Proj_MaxProjDist 0");
//No fog
PushToConsole("FogEnable 0");
//NX chams
PushToConsole("SkelModelStencil -1" );
}
else{
//No spread
PushToConsole("PerturbRotationEffect 3.000000");
PushToConsole("PerturbIncreaseSpeed 3.000000");
PushToConsole("PerturbWalkPercent 9.000000");
PushToConsole("PerturbFiringIncreaseSpeed 0.500000");
PushToConsole("PerturbRecoil 9.000000");
PushToConsole("FireMovePerturb 9.000000");
PushToConsole("ZoomedFireMoveDuckPerturb 9.000000");
PushToConsole("ZoomedFireMovePerturb 9.000000");
PushToConsole("ZoomedFireDuckPerturb 9.000000");
//No recoil
memcpy((LPVOID)0x3741A700, "\xD8\x66\x54", 3);
memcpy((LPVOID)0x3741A714, "\xD9\x46\x54", 3);
memcpy((LPVOID)0x3741A717, "\xD9\x5E\x54", 3);
memcpy((LPVOID)0x37418209, "\xD9\x46\x48", 3);
memcpy((LPVOID)0x3741A720, "\xD9\x5E\x48", 3);
//Removals
PushToConsole("DynamicLight 1");
PushToConsole("EnableWeatherFX 1");
PushToConsole("MuzzleLight 1");
PushToConsole("SnowEnable 1");
PushToConsole("CamDamage 1");
PushToConsole("ModelApplySun 1");
PushToConsole("ClientFXDetailLevel 1");
PushToConsole("ModelShadow_Proj_Enable 1");
PushToConsole("DebrisFXLevel 1");
PushToConsole("ScatterEnable 1");
PushToConsole("modelshadow_proj_blurenable 1");
PushToConsole("DrawAllModelShadows 1");
PushToConsole("ModelShadow_Proj_MinColorComponent 1");
PushToConsole("ModelShadow_Proj_MaxProjDist 1");
//No fog
PushToConsole("FogEnable 1");
//NX chams
PushToConsole("SkelModelStencil 0" );
{ //Full bright
if(GetAsyncKeyState(VK_NUMPAD2)<0){
{
PushToConsole("FullBright 1");
}
else{
PushToConsole("FullBright 0");
}
}
}
DWORD WINAPI dwHackThread(LPVOID)
{
while( !IsGameReadyForHook() )
Sleep(100);
main();
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
}
return TRUE;
} [/php]

Quote Originally Posted by Zoom View Post
Did you C&P something?
Well most of the code is from CN's tutorial.
Code:
if(GetAsyncKeyState(VK_NUMPAD2)<0){
PushToConsole("FullBright 1");
}
That's 1 if corrected ... you can't code can you ?

Code:
if(GetAsyncKeyState(VK_INSERT)&1)
{
and theres the other I'll give a compleatly corrected ver in a sec
Right Click Go To Location o-o
Code:
#include <windows.h>
#define LTClient 0x37767BD0
bool IsGameReadyForHook()
{
if( GetModuleHandleA( "d3d9.dll"     ) != NULL 
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL 
&& GetModuleHandleA( "CShell.dll"   ) != NULL )
return true;
return false;
}
void __cdecl PushToConsole( const char* szCommand ){
DWORD *Ltclient = ( DWORD* )( LTClient );
void* CONoff = ( void* )*( DWORD* )( *Ltclient + 0x208 );
__asm
{
push szCommand;
call CONoff;
add esp, (-3-1)+(2+6);
}
}
void main()
{
	while(true)
	{
		Sleep(100);
		if(GetAsyncKeyState(VK_INSERT)&1)
		{
//No spread
		PushToConsole("PerturbRotationEffect  0.000000");
		PushToConsole("PerturbIncreaseSpeed 0.000000");
		PushToConsole("PerturbWalkPercent 0.000000");
		PushToConsole("PerturbFiringIncreaseSpeed 0.000000");
		PushToConsole("PerturbRecoil 0.000000");
		PushToConsole("FireMovePerturb 0.000000");
		PushToConsole("ZoomedFireMoveDuckPerturb 0.000000");
		PushToConsole("ZoomedFireMovePerturb 0.000000");
		PushToConsole("ZoomedFireDuckPerturb 0.000000");
//No recoil
		memcpy((LPVOID)0x3741A700, "\x90\x90\x90", 3);
		memcpy((LPVOID)0x3741A714, "\x90\x90\x90", 3);
		memcpy((LPVOID)0x3741A717, "\x90\x90\x90", 3);
		memcpy((LPVOID)0x37418209, "\x90\x90\x90", 3);
		memcpy((LPVOID)0x3741A720, "\x90\x90\x90", 3);
//Removals
		PushToConsole("DynamicLight 0");
		PushToConsole("EnableWeatherFX 0");
		PushToConsole("MuzzleLight 0");
		PushToConsole("SnowEnable 0");
		PushToConsole("CamDamage 0");
		PushToConsole("ModelApplySun 0");
		PushToConsole("ClientFXDetailLevel 0");
		PushToConsole("ModelShadow_Proj_Enable 0");
		PushToConsole("DebrisFXLevel 0");
		PushToConsole("ScatterEnable 0");
		PushToConsole("modelshadow_proj_blurenable 0");
		PushToConsole("DrawAllModelShadows 0");
		PushToConsole("ModelShadow_Proj_MinColorComponent 0");
		PushToConsole("ModelShadow_Proj_MaxProjDist 0");
//No fog
		PushToConsole("FogEnable 0");
//NX chams
		PushToConsole("SkelModelStencil -1" );
		}
		else
		{
//No spread
		PushToConsole("PerturbRotationEffect  3.000000");
		PushToConsole("PerturbIncreaseSpeed  3.000000");
		PushToConsole("PerturbWalkPercent  9.000000");
		PushToConsole("PerturbFiringIncreaseSpeed 0.500000");
		PushToConsole("PerturbRecoil 9.000000");
		PushToConsole("FireMovePerturb 9.000000");
		PushToConsole("ZoomedFireMoveDuckPerturb 9.000000");
		PushToConsole("ZoomedFireMovePerturb 9.000000");
		PushToConsole("ZoomedFireDuckPerturb 9.000000");
//No recoil
		memcpy((LPVOID)0x3741A700, "\xD8\x66\x54", 3);
		memcpy((LPVOID)0x3741A714, "\xD9\x46\x54", 3);
		memcpy((LPVOID)0x3741A717, "\xD9\x5E\x54", 3);
		memcpy((LPVOID)0x37418209, "\xD9\x46\x48", 3);
		memcpy((LPVOID)0x3741A720, "\xD9\x5E\x48", 3);
//Removals
		PushToConsole("DynamicLight 1");
		PushToConsole("EnableWeatherFX 1");
		PushToConsole("MuzzleLight 1");
		PushToConsole("SnowEnable 1");
		PushToConsole("CamDamage 1");
		PushToConsole("ModelApplySun 1");
		PushToConsole("ClientFXDetailLevel 1");
		PushToConsole("ModelShadow_Proj_Enable 1");
		PushToConsole("DebrisFXLevel 1");
		PushToConsole("ScatterEnable 1");
		PushToConsole("modelshadow_proj_blurenable 1");
		PushToConsole("DrawAllModelShadows 1");
		PushToConsole("ModelShadow_Proj_MinColorComponent 1");
		PushToConsole("ModelShadow_Proj_MaxProjDist 1");
//No fog
		PushToConsole("FogEnable 1");
//NX chams
		PushToConsole("SkelModelStencil 0" ); //Full bright
		}
	}
	if(GetAsyncKeyState(VK_NUMPAD2)<0)
	{
		PushToConsole("FullBright 1");
	}
	else
	{
	PushToConsole("FullBright 0");
	}
}
DWORD WINAPI dwHackThread(LPVOID)
{
	while( !IsGameReadyForHook() )
	Sleep(100);
	main();
	return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
}
return TRUE;
}
Fixed. I also added indents it helps me know the flow of the functions
yeah all what was wrong was the possition of:
the while and pos of the sleep underneath the while so instead of a shortage of {} it says u used to much :| i guess.


Quote Originally Posted by kelechi96 View Post
Code:
if(GetAsyncKeyState(VK_NUMPAD2)<0){
PushToConsole("FullBright 1");
}
That's 1 if corrected ... you can't code can you ?

Code:
if(GetAsyncKeyState(VK_INSERT)&1)
{
and theres the other I'll give a compleatly corrected ver in a sec
what the hell are u talking about you can use both =_= all keys are 0 while there pressed if they get 1 its bigger then 0 so it activates >.> have both of these in my code like to switch :3
I think I'm owed a thank and a rep from this sorry noob
Quote Originally Posted by kelechi96 View Post
I think I'm owed a thank and a rep from this sorry noob
cough dont go flame btw i have seen you earlier but yeah ... not really a person i know on this section tough. even if you not a newphag

Quote Originally Posted by HaX4LiFe! View Post
im sure thts gna be a laggy hack :/
quite true seems like it has no bools so the use should hold the key to get it working since when on release it switches back to normal values
Quote Originally Posted by Kuro Tenshi View Post

cough dont go flame btw i have seen you earlier but yeah ... not really a person i know on this section tough. even if you not a newphag


quite true seems like it has no bools so the use should hold the key to get it working since when on release it switches back to normal values
sorry EGO DEFLATING ..... Deflated
im sure thts gna be a laggy hack :/
Hello,
Thanks for the corrected code , i just came home.
Thanked+rep , also thanks to all for your quick replies.
Posts 114 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?