HelpError In My Code

Posts 1–7 of 7 · Page 1 of 1
Error In My Code
Hello Coders I Am Getting A Error On My Code Could You Please Point Out / Fix The Problem?


Code:
#include <windows.h>
#define wpoint 0xE66094
#define NoRecoil1 0xEA8
#define NoRecoil2 0x1178
#define NoRecoil3 0x1010
#define NoRecoil4 0x36B8
#define NoRecoil5 0x34E8
#define NoRecoil6 0x34D8
#define NoRecoil7 0x658

bool coil = true; 

Sleep(9800); 

DWORD CShell     = (DWORD)GetModuleHandleA("CShell.dll");
DWORD pWeaponMgr = *(DWORD*)(CShell + wpoint);



if(coil)
{
	if (pWeaponMgr)
		{
			for(int i=0; i<600; i++) 
				{	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil1) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil2) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil3) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil4) = 100;

					i=0;
			
	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil5) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil6) = 100;
	
					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil7) = 100;
				}	
		}
}
Here Is The Log

Code:
1>------ Build started: Project: NoRec, Configuration: Debug Win32 ------
1>Build started 4/10/2013 12:43:50 AM.
1>PrepareForBuild:
1>  Creating directory "c:\users\lenovo v470\documents\visual studio 2010\Projects\NoRec\Debug\".
1>InitializeBuildStatus:
1>  Creating "Debug\NoRec.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1>  stdafx.cpp
1>  NoRec.cpp
1>c:\users\lenovo v470\documents\visual studio 2010\projects\norec\norec\norec.cpp(69): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:10.38
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Error Or What?

ps. Please Be Patient since im new to this but i have used turboc3 in the past

update.
after some code editing this is my new error

Code:
Code

#include <windows.h>
#include "stdafx.h"
#define wpoint 0xE66094
#define NoRecoil1 0xEA8
#define NoRecoil2 0x1178
#define NoRecoil3 0x1010
#define NoRecoil4 0x36B8
#define NoRecoil5 0x34E8
#define NoRecoil6 0x34D8
#define NoRecoil7 0x658

bool coil = true; 


DWORD CShell     = (DWORD)GetModuleHandleA("CShell.dll");
DWORD pWeaponMgr = *(DWORD*)(CShell + wpoint);


if (coil);
{
	if (pWeaponMgr);
		{
			for(int i=0; i<600; i++);
				{	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil1) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil2) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil3) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil4) = 100;

					i=0;
			
	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil5) = 100;

					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil6) = 100;
	
					i=0;

	
					if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) != NULL)
					*(float*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i))) + NoRecoil7) = 100;
				}	
		}
}

The Log

1>------ Build started: Project: NoRec, Configuration: Debug Win32 ------
1>Build started 4/10/2013 1:03:45 AM.
1>InitializeBuildStatus:
1>  Touching "Debug\NoRec.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>  NoRec.cpp
1>c:\users\lenovo v470\documents\visual studio 2010\projects\norec\norec\norec.cpp(20): error C2059: syntax error : 'if'
1>c:\users\lenovo v470\documents\visual studio 2010\projects\norec\norec\norec.cpp(21): error C2447: '{' : missing function header (old-style formal list?)
1>
1>Build FAILED.
1>
Put your codes into a function argument and add a DllMain, i fixed your code for you.
This addresses are from PH version, right ?

Code:
#include <Windows.h>


#define WeaponMgr 0xE66094

#define NoRecoil1 0xEA8
#define NoRecoil2 0x1178
#define NoRecoil3 0x1010
#define NoRecoil4 0x36B8
#define NoRecoil5 0x34E8
#define NoRecoil6 0x34D8
#define NoRecoil7 0x658

int NoRecoil  = 1; 

void MemoryFunction ( void )
{
	DWORD CShell     = (DWORD)GetModuleHandleA("CShell.dll");
	DWORD pWeaponMgr = *(DWORD*)(CShell + WeaponMgr);
	
	for (int i=0; i<=999; i++)
	{
		DWORD Weapon = (*(DWORD*)(pWeaponMgr + (4*i)));
		if(Weapon)
		{
			if ( NoRecoil )
				for(int y = 0; y<9; y++) 
				{
					*(float*)( Weapon + (NoRecoil1 + (4*y))) = 0.0f;
					*(float*)( Weapon + (NoRecoil2 + (4*y))) = 0.0f;
					*(float*)( Weapon + (NoRecoil3 + (4*y))) = 0.0f;	
					*(float*)( Weapon + (NoRecoil4 + (4*y))) = 0.0f;
			                *(float*)( Weapon + (NoRecoil5 + (4*y))) = 0.0f;
				        *(float*)( Weapon + (NoRecoil6 + (4*y))) = 0.0f;
				        *(float*)( Weapon + (NoRecoil7 + (4*y))) = 0.0f;
				}
		}
	}

}

BOOL WINAPI DllMain ( HMODULE hideDLL , DWORD dwReason , LPVOID lpvReason )
{
	DisableThreadLibraryCalls(hideDLL);

	if (dwReason == DLL_PROCESS_ATTACH)
	{
		CreateThread(0,0,(LPTHREAD_START_ROUTINE)MemoryFunction,0,0,0);
	}
	return TRUE;
}
Thanks For The Replies. And Yes The Addresses Are For CFPH. I Will Take Note Of That DllMain And The Function Argument
Yep, Try that mate!
I see only one error, you are too new to C++ to make hacks properly yet.
But, I'll help u more, too much more in fact.. lol

Ok. So, this code will get you Banned, but before u even get banned Crossfire will crash cause of Xtrap.

You are loading CShell the old, detected way.

You need to encrypt the string "CShell.dll" in this line of your code:
Code:
 DWORD CShell = ( DWORD ) GetModuleHandleA("CShell.dll");
to do this, Click: Project -> Add New Item -> select Header File (.h)

Name it Encrypt.

go to encrypt, paste this in ( C + P ready lol )

Code:
#ifndef _XOR_H // credits to Stalin for XOR encryption.
#define _XOR_H
template <int XORSTART, int BUFLEN, int XREFKILLER>

class XorStr
{
private: 
	XorStr();
public: 
	char s[ BUFLEN ];

	XorStr( const char * xs );

	~XorStr()
	{
		for ( int i = 0; i < BUFLEN; i++ ) s[ i ]=0; 
	}
};

template <int XORSTART, int BUFLEN, int XREFKILLER>
XorStr<XORSTART,BUFLEN,XREFKILLER>::XorStr( const char * xs )
{
	int xvalue = XORSTART;
	int i = 0;

	for ( ; i < ( BUFLEN - 1 ); i++ ) 
	{
		s[ i ] = xs[ i - XREFKILLER ] ^ xvalue;
		xvalue += 1;
		xvalue %= 256;
	}

	s[ BUFLEN - 1 ] = 0;
}
#endif

#define CShellEncrypted /*CShell.dll*/XorStr<0x77,11,0x0026791B>("\x34\x2B\x11\x1F\x17\x10\x53\x1A\x13\xEC"+0x0026791B).s
NOW, Go back to your Main.cpp or DLLmain.cpp or whatever, and add this:
Code:
#include Encrypt.h
Now, you have to change your old Loading CShell method, change it to this:
Code:
DWORD CShell = ( DWORD ) GetModuleHandleA(CShellEncrypted);
And Vuala! IT WORKS! (your loading CShell works, not sure about the rest :P)

Remember to THANKS if I helped!

Credits: @LucN ,but I donno if he made that encryption method, I'm not sure.
Quote Originally Posted by kinibayVIP44 View Post
I see only one error, you are too new to C++ to make hacks properly yet.
But, I'll help u more, too much more in fact.. lol

Ok. So, this code will get you Banned, but before u even get banned Crossfire will crash cause of Xtrap.

You are loading CShell the old, detected way.

You need to encrypt the string "CShell.dll" in this line of your code:
Code:
 DWORD CShell = ( DWORD ) GetModuleHandleA("CShell.dll");
to do this, Click: Project -> Add New Item -> select Header File (.h)

Name it Encrypt.

go to encrypt, paste this in ( C + P ready lol )

Code:
#ifndef _XOR_H // credits to Stalin for XOR encryption.
#define _XOR_H
template <int XORSTART, int BUFLEN, int XREFKILLER>

class XorStr
{
private: 
	XorStr();
public: 
	char s[ BUFLEN ];

	XorStr( const char * xs );

	~XorStr()
	{
		for ( int i = 0; i < BUFLEN; i++ ) s[ i ]=0; 
	}
};

template <int XORSTART, int BUFLEN, int XREFKILLER>
XorStr<XORSTART,BUFLEN,XREFKILLER>::XorStr( const char * xs )
{
	int xvalue = XORSTART;
	int i = 0;

	for ( ; i < ( BUFLEN - 1 ); i++ ) 
	{
		s[ i ] = xs[ i - XREFKILLER ] ^ xvalue;
		xvalue += 1;
		xvalue %= 256;
	}

	s[ BUFLEN - 1 ] = 0;
}
#endif

#define CShellEncrypted /*CShell.dll*/XorStr<0x77,11,0x0026791B>("\x34\x2B\x11\x1F\x17\x10\x53\x1A\x13\xEC"+0x0026791B).s
NOW, Go back to your Main.cpp or DLLmain.cpp or whatever, and add this:
Code:
#include Encrypt.h
Now, you have to change your old Loading CShell method, change it to this:
Code:
DWORD CShell = ( DWORD ) GetModuleHandleA(CShellEncrypted);
And Vuala! IT WORKS! (your loading CShell works, not sure about the rest :P)

Remember to THANKS if I helped!

Credits: @LucN ,but I donno if he made that encryption method, I'm not sure.
this is useless for CFPH because XTRAP is older version than EU & NA.
/facepalm


1>c:\users\lenovo v470\documents\visual studio 2010\projects\norec\norec\norec.cpp(69): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?

The error is self-explaining!
Quote Originally Posted by BACKD00R View Post
/facepalm


1>c:\users\lenovo v470\documents\visual studio 2010\projects\norec\norec\norec.cpp(69): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?

The error is self-explaining!
even if he did include stdafx.h , he'll have other errors because he didn't add his codes to function argument.
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us