Detours.h Compile Errors

Posts 1–9 of 9 · Page 1 of 1
Detours.h Compile Errors
Hey guys, just reinstalled Crysis and am getting back into coding hacks for it, but I've ran across a few problems. I'm using Visual Studio 2005 and Detours 1.5. Here is the program I'm trying to include it on, it's just a simple dll injector:

Code:
//------------------------------------------------------------------------------------------
//	This Injector launch an application with dxhook injected to it.
//------------------------------------------------------------------------------------------
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <atlbase.h>
#include <atlstr.h>
#include <conio.h>
#include <iostream>
#include <fstream>
#include <string>
#include "stdafx.h"

#include <detours.h>
	
#define GAME2

int main()
{
	////////////////////////////////////
	// Launch The Process
	////////////////////////////////////
	STARTUPINFO si = {sizeof(STARTUPINFO)};
	PROCESS_INFORMATION pi = {0};

	//	Run the application with our dll
#ifdef GAME1
	BOOL bResult = DetourCreateProcessWithDll(L"D:\\Games\\World of Warcraft\\wow.exe", NULL, 0, 0, TRUE,
		CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_CONSOLE, NULL,
		L"D:\\Games\\World of Warcraft",&si, &pi, L"D:\\Technion\\Semester 6\\Graphics Project\\Wrapper\\DXWrapper\\Release\\dxhook.dll" , 0 );
#endif
#ifdef GAME2
	BOOL bResult = DetourCreateProcessWithDll(L"C:\\Program Files\\Electronic Arts\\Crytek\\Crysis\\Bin32\\Crysis.exe", NULL, 0, 0, TRUE,
		CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_CONSOLE, NULL,
		L"C:\\Program Files\\Electronic Arts\\Crytek\\Crysis\\Bin32",&si, &pi, L"C:\\Program Files\\Electronic Arts\\Crytek\\Crysis\\Mods\\CrysisMod\\Bin32\\CrysisH.dll" , 0 );
#endif

#ifdef GAME3
	BOOL bResult = DetourCreateProcessWithDll(L"D:\\Games\\Tomb Raider - Anniversary\\tra.exe", NULL, 0, 0, TRUE,
		CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_CONSOLE, NULL,
		L"D:\\Games\\Tomb Raider - Anniversary",&si, &pi, L"D:\\Technion\\Semester 6\\Graphics Project\\Wrapper\\DXWrapper\\Release\\dxhook.dll" , 0 );
#endif

#ifdef GAME4
	BOOL bResult = DetourCreateProcessWithDll(L"D:\\Games\\Heroes of Might and Magic V - Tribes of the East\\bin\\H5_Game.exe", NULL, 0, 0, TRUE,
		CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_CONSOLE, NULL,
		L"D:\\Games\\Heroes of Might and Magic V - Tribes of the East\\bin",&si, &pi, L"D:\\Technion\\Semester 6\\Graphics Project\\Wrapper\\DXWrapper\\Release\\dxhook.dll" , 0 );
#endif


	printf("Attached is %s.\n", (bResult)?"successful":"unsuccessful");
	if (!bResult)
		getch();
}
And here are the errors I'm getting when I try to compile:

Code:
1>------ Build started: Project: NewDllLauncher, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(23) : error C2146: syntax error : missing ';' before identifier 'Data1'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(23) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(23) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(24) : error C2146: syntax error : missing ';' before identifier 'Data2'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(24) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(24) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(25) : error C2146: syntax error : missing ';' before identifier 'Data3'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(26) : error C2146: syntax error : missing ';' before identifier 'Data4'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(26) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(26) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(139) : error C2146: syntax error : missing ';' before identifier 'cbHeaderSize'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(140) : error C2146: syntax error : missing ';' before identifier 'nSignature'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(140) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(140) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(141) : error C2146: syntax error : missing ';' before identifier 'nDataOffset'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(141) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(141) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(142) : error C2146: syntax error : missing ';' before identifier 'cbDataSize'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(142) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(142) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(144) : error C2146: syntax error : missing ';' before identifier 'nOriginalImportVirtualAddress'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(144) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(144) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(145) : error C2146: syntax error : missing ';' before identifier 'nOriginalImportSize'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(145) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(145) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(146) : error C2146: syntax error : missing ';' before identifier 'nOriginalBoundImportVirtualAddress'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(147) : error C2146: syntax error : missing ';' before identifier 'nOriginalBoundImportSize'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(147) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(147) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(149) : error C2146: syntax error : missing ';' before identifier 'nOriginalIatVirtualAddress'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(149) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(149) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(150) : error C2146: syntax error : missing ';' before identifier 'nOriginalIatSize'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(150) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(150) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(151) : error C2146: syntax error : missing ';' before identifier 'nOriginalSizeOfImage'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(151) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(151) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(152) : error C2146: syntax error : missing ';' before identifier 'nReserve'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(157) : error C2146: syntax error : missing ';' before identifier 'cbBytes'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(158) : error C2146: syntax error : missing ';' before identifier 'nReserved'
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(158) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(158) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(183) : error C2065: 'CALLBACK' : undeclared identifier
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(183) : error C2065: 'PF_DETOUR_BINARY_BYWAY_CALLBACK' : undeclared identifier
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(183) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 8\vc\include\detours.h(183) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>Build log was saved at "file://c:\Documents and Settings\Main\My Documents\Visual Studio 2005\Projects\NewDllLauncher\NewDllLauncher\Debug\BuildLog.htm"
1>NewDllLauncher - 58 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I appreciate any help!
Ok yes theres a problem with your code in detours.h
Paste the code in detours.h here...There is a problem with your header file
Quote Originally Posted by cnttuchme View Post
Ok yes theres a problem with your code in detours.h
Paste the code in detours.h here...There is a problem with your header file
Lol. You wouldn't wnat to post all of detours.h here that's a huge SDK that has to be downloaded form Microsoft. Let's see what the problem is...
Quote Originally Posted by why06 View Post
Lol. You wouldn't wnat to post all of detours.h here that's a huge SDK that has to be downloaded form Microsoft. Let's see what the problem is...
Wow Microsoft fail.
Hrmm well my colledge im going to says that im i learn alot of programming then there going to set me up with a job at Microsoft lol.
Hmmm... well he's not posting all the code. The errors don't match the code he supplied. If you want us to help you your going have to provide the whole thing. If you want me to I will even delete the source when we are done if you don't want it leeched.
ya and why the fuck does it say visual studio 2008 in error's if he is using visual studio 2005.and why use either of those?dev c++ is the way to go
Quote Originally Posted by cnttuchme View Post
Wow Microsoft fail.
Hrmm well my colledge im going to says that im i learn alot of programming then there going to set me up with a job at Microsoft lol.
You really do not want to work for the biggest fails in history of mankind o__O.
Their list of fails is bigger then the amount of leechers and copy pasters on all hack sites together!

Quote Originally Posted by stevethehacker View Post
why use either of those?dev c++ is the way to go
dev C++ fails...
Go make an engine hook with it and you'll find out(especially if you're gonna do the source engine)
Hmmmm... how to put this? HD how r u me o_O?
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us