Well, some tips from me:
1. This is detected, so dont try it xD
2. You should show your hook so I can help you
3. Look at the ptc method for this
4. NoFog also works when you hook drawtexture (just a tip how I got my chams working)
this is my full code of "no fog" (without dllmain). it inject sussesfully, but the fog still in the game, what i'm doing wrong?Code:#include <stdio.h> #include <fstream> #include <d3d9.h> #include <d3dx9.h> #pragma comment(lib, "d3d9.lib") #pragma comment(lib, "d3dx9.lib") typedef HRESULT (WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount); tDrawIndexedPrimitive oDrawIndexedPrimitive = NULL; HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) { pDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); return oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); }
Well, some tips from me:
1. This is detected, so dont try it xD
2. You should show your hook so I can help you
3. Look at the ptc method for this
4. NoFog also works when you hook drawtexture (just a tip how I got my chams working)
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
1 im using it for another game and i'm not being disconnected.
2 im using https://www.mpgh.net/forum/207-combat...menu-base.html
Code:/************************************************************************/ /* HOOK */ /************************************************************************/ bool HookEndscene() { DWORD D3D9 = (DWORD)LoadLibrary(TEXT("d3d9.dll")); if (D3D9) { DWORD* Addr = *(DWORD**)(FindPattern(D3D9, 0x150000, (BYTE*)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx")+2); if (Addr) { DWORD dwOld; _EndScene = Addr[42]; VirtualProtect((VOID*)(_EndScene+12), 1, PAGE_EXECUTE_READWRITE, &dwOld); *(BYTE*)(_EndScene+12) = 0x90; VirtualProtect((VOID*)(_EndScene+12), 1, dwOld, &dwOld); return true; } } return false; } /************************************************************************/ /* EXCEPTION HANDLER */ /************************************************************************/ LONG CALLBACK Handler(PEXCEPTION_POINTERS Info) { if (Info->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) { return EXCEPTION_CONTINUE_SEARCH; } if ((DWORD)Info->ExceptionRecord->ExceptionAddress == _EndScene+13) { Info->ContextRecord->Eip = (DWORD)Pre_EndScene; return EXCEPTION_CONTINUE_EXECUTION; } return EXCEPTION_CONTINUE_SEARCH; } /************************************************************************/ /* MAINTHREAD */ /************************************************************************/ DWORD WINAPI MyMainThread(LPVOID) { #ifdef CA while ( !IsGameReadyToBeHooked() ) Sleep(25); #endif main = new cMain(); menu = new cMenu(); d3d = new cD3D(); if(main && menu && d3d) { if(HookEndscene()) AddVectoredExceptionHandler(1, Handler); } return true; } /************************************************************************/ /* DLL MAIN */ /************************************************************************/ BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved ) { DisableThreadLibraryCalls(hDll); switch( dwReason ) { case DLL_PROCESS_ATTACH: CreateThread(NULL, NULL, MyMainThread, NULL, NULL, NULL); break; } return true; }
Ahhh, the @matypatty way
ULTIMATE GAY'S LIST
- Matypatty
- DisOwned
Error: Max Thanks Reached
TASK'S
- (Complete)Make Simple Menu For Combat Arms NA
- (Complete) Reach 50 Post's
- (In Progress)Troll Nerdy Kids
- (Complete)Get a job at KFC
matypatty (03-29-2013)
I Read All Of My PM's & VM'sIf you need help with anything, just let me know.
Staff Administrator Since 10.13.2019
Publicist Since 04.04.2015
Middleman Since 04.14.2014
Global Moderator Since 08.01.2013
Premium Since 05.29.2013
Minion+ Since 04.18.2013
Combat Arms Minion Since 12.26.2012
Contributor Since 11.16.2012
Member Since 05.11.2010
well i dont know much about programmer JOB but i think when you are a full time coder and are paid to do that... your virginity is hard to lose...
matypatty (03-30-2013)
Well, thanks for posting hook.
It seems like you are only hooking endscene xD
As maty points out dip hooking is the hardest job on this game. I wasted 2 days doing it, and got it working 2 ways.
But full chams are not possibile with my method. (but which means nofog would work)
Its easier as you think. You take an address and use VirtualProtect to protect this address with read/write flags so any access results in an application crash. Thats why you install a "VectoredExceptionHandler". Instead of crashing the application runs that.
Now you can check different things like the ExceptionAddress or ExceptionCode. Also you can CHNAGE data like EIP from ContextRecord pointer. The awesome thing is, if you know a bit asm, EIP is the register which says whats the next line to continue. It behaves like a JMP without memory modification
Last edited by Ch40zz-C0d3r; 03-30-2013 at 02:55 AM.
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
[MPGH]Flengo (03-30-2013),matypatty (03-30-2013)
So I have a working DIP hook and the good old chams, but first I had to write a driver that does a ssdt hook on getcontextthread, so that it returns that no debug registers are changed... and then a simple hwbp hook on DIP ...I know the way is quite complicated in comparision how easy it was to hook DIP some time ago
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k