Problem!

Posts 1–14 of 14 · Page 1 of 1
Problem!
So,I'm working on a CF Hack.(Cross Fire)
I got a problem in:
[php]
#include <detours.h>
[/php]

[php]
#include <Windows.h>
#include <d3d9.h>
#included <detours.h>
[/php]

And here the whole code:
[php]
#include <Windows.h>
#include <d3d9.h>
#include <detours.h>

#pragma comment (lib, "d3d9.lib")


IDirect3DDevice9 * pGameDevice;

////////////////
///BeginScene///
////////////////
typedef HRESULT(WINAPI* BeginScene_)(LPDIRECT3DDEVICE9 pDevice);
BeginScene_ pBeginScene;
HRESULT WINAPI nBeginScene(LPDIRECT3DDEVICE9 pDevice)
{
_asm NOP;
HRESULT hRet = pBeginScene(pDevice);






return hRet;
}

/************************************************** ************************************************/

//////////////
///EndScene///
//////////////
typedef HRESULT(WINAPI* EndScene_)(LPDIRECT3DDEVICE9 pDevice);
EndScene_ pEndScene;
HRESULT WINAPI nEndScene(LPDIRECT3DDEVICE9 pDevice)
{

HRESULT hRet = pEndScene(pDevice);




return hRet;
}

/************************************************** ************************************************/

//////////////////////////
///DrawIndexedPrimitive///
//////////////////////////
typedef HRESULT(WINAPI* DrawIndexedPrimitive_)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,
UINT NumVertices, UINT StartIndex, UINT PrimitiveCount);
DrawIndexedPrimitive_ pDrawIndexedPrimitive;
HRESULT WINAPI nDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,
UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{


{

pDevice->SetRenderState( D3DRS_FOGENABLE, false );//useless engine has it set to 0 Tablefog is on tho


}



IDirect3DVertexBuffer9* pStreamData = NULL;

UINT iOffsetInBytes,iStride;

pDevice->GetStreamSource(0,&pStreamData,&iOffsetInBytes, &i Stride);

if ( iStride == 40 )


{


pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
pDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_NEVER );


}






return pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);


}

/************************************************** ************************************************/

/////////////////////
///SetStreamSource///
/////////////////////
typedef HRESULT(WINAPI* SetStreamSource_)(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber, IDirect3DVertexBuffer9 * pStreamData, UINT OffsetInBytes, UINT Stride);
SetStreamSource_ pSetStreamSource;
HRESULT WINAPI nSetStreamSource(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber, IDirect3DVertexBuffer9 * pStreamData, UINT OffsetInBytes, UINT Stride)
{
_asm NOP;
HRESULT hRet = pSetStreamSource(pDevice, StreamNumber, pStreamData, OffsetInBytes, Stride);

return hRet;
}

/************************************************** ************************************************/

///////////
///Reset///
///////////
typedef HRESULT(WINAPI* Reset_)(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters);
Reset_ pReset;
HRESULT WINAPI nReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
{
_asm NOP;
HRESULT hRet = pReset(pDevice, pPresentationParameters);

return hRet;
}

/************************************************** ************************************************/


DWORD dwWait(LPVOID lpArgs)
{

DWORD Base = NULL;

for (;Base == NULL;Sleep(100))
Base = (DWORD)GetModuleHandle("crossfire.exe");

for(;pGameDevice == NULL; Sleep(10000))
{
DWORD dwProtect;
VirtualProtect((void*)(0x70A440), 4, PAGE_EXECUTE_READWRITE, &dwProtect);
memcpy(&pGameDevice, (void*)(0x70A440), 4);
VirtualProtect((void*)(0x70A440), 4, dwProtect, NULL);
}




DWORD* pdwNewDevice = *(DWORD**)pGameDevice;
pdwNewDevice = (DWORD*)pdwNewDevice[0]; //turn our pointer into an array for the vtable*/


// pReset = (Reset_)DetourFunction((PBYTE)pdwNewDevice[16],(PBYTE)nReset);
// pBeginScene = (BeginScene_)DetourFunction((PBYTE)pdwNewDevice[41],(PBYTE)nBeginScene);
pEndScene = (EndScene_)DetourFunction((PBYTE)pdwNewDevice[42],(PBYTE)nEndScene);
// pDrawIndexedPrimitive = (DrawIndexedPrimitive_)DetourFunction((PBYTE)pdwNe wDevice[82],(PBYTE)nDrawIndexedPrimitive);
// pSetStreamSource = (SetStreamSource_)DetourFunction((PBYTE)pdwNewDevi ce[100],(PBYTE)nSetStreamSource);

return 0;
}

bool WINAPI DllMain(HMODULE hMod, DWORD dwReason, LPVOID lpReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{

CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)dwWait, NULL, NULL, NULL);

return true;
}

return false;
}
[/php]

The error is saying:
fatal error C1083 : Cannot open include file: 'detours.h' : No such a file or Directory.

I will thank + rep who fix it or help me fixing it.
what? you got a problem? well since you don't say what's the problem, i assume that it is a life problem.. and well.. we all have problems on our life...

btw... what about...


i don't know....


If you Learn c++?

edit: oh wait you added the error... i have a fix: don't leech
Quote Originally Posted by 'Bruno View Post
what? you got a problem? well since you don't say what's the problem, i assume that it is a life problem.. and well.. we all have problems on our life...

btw... what about...


i don't know....


If you Learn c++?ⓘ

edit: oh wait you added the error... i have a fix: don't leech
I didn't leach.
I found some addies and got them with each other and added some codes,but usually I do it like that.
But it won't work.
Quote Originally Posted by ILoveFatKids View Post
I didn't leach.
I found some addies and got them with each other and added some codes,but usually I do it like that.
But it won't work.
you found addies (not yours) -> Leech
you found other addies (not yours) -> Leech
you added some codes (not yours) -> Leech

in overall, you leeched...
The codes aren't leached.
I didn't find other addies.
And usually no one make his own addies.

If you don't want to help me just stfu,and if you want to help me just do it.
Quote Originally Posted by ILoveFatKids View Post
The codes aren't leached.
I didn't find other addies.
And usually no one make his own addies.

If you don't want to help me just stfu,and if you want to help me just do it.
First of all. If you are coming on c++ section to say "stfu".. i reply to you: "gtfo".

Still, i will answer you, because you seem like you don't understand what you are talking about.
No one makes addies.. people find addies (Did i even talked about making addies..? or do you even know how do you get them...?)
You didn't find addies? so how the hell you have them? oh leeched..
The code is not leeched.. ok.. but you can't realize that you are missing a library.. kk
The reason it looks like you leeched/copy pasted everything (as Brinuz said) is that you are trying to use a library that is obviously missing. If you had leeched the detour part but know a lot about C++ otherwise you would understand that you need to install Microsoft Detours to use it.

If I am mistaken and you already have installed Microsoft Detours, then there has obviously occured some error while installing/configuring it. Make sure you followed the instructions carefully and try again. If you are unsure, try finding specifik instructions for the IDE you are using (if such are available that is, I dont use Detours personally).
Quote Originally Posted by ILoveFatKids View Post
The codes aren't leached.
I didn't find other addies.
And usually no one make his own addies.

If you don't want to help me just stfu,and if you want to help me just do it.
Ok, so you didn't leech the code yet it's
EXTREMELY FUCKIN OBVIOUS
that you're missing detours.h

Stop leeching, stop pretending to know how to code.

kthxbai

Also, if you reinstalled detours make sure to set your environment variable to include it's path.
I re-installed Detours and still nothing is happening.
Okay let's say I "leached it".

How to get this fking detours.h working.
I never used detours.h in my life.

And okay I didn't did the source code,my friend did,I only fixed some things in the code.
Quote Originally Posted by ILoveFatKids View Post
Okay let's say I "leached it".

How to get this fking detours.h working.
I never used detours.h in my life.

And okay I didn't did the source code,my friend did,I only fixed some things in the code.
http://www.mpgh.net/forum/31-c-c/127...ng-policy.html /
This isn't a release or a tutorial.
And I got permission from my friend because I told him to make it for me.
And I ain't release the hack when I finish it I will give it to him because he is busy working on another project.

The teacher gave him a project to do in Summer for the next year.
Quote Originally Posted by ILoveFatKids View Post
This isn't a release or a tutorial.
And I got permission from my friend because I told him to make it for me.
And I ain't release the hack when I finish it I will give it to him because he is busy working on another project.

The teacher gave him a project to do in Summer for the next year.
dude i just found the link where you took it from... i wont post it for obvious reason...
Leech admitted =D

~locked~
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us