Thread: simple "no fog"

Results 1 to 12 of 12
  1. #1
    cannonpas's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    kyoto
    Posts
    122
    Reputation
    10
    Thanks
    45

    simple "no fog"

    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);
    	}
    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?

  2. #2
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    831
    Reputation
    44
    Thanks
    401
    My Mood
    Twisted
    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

  3. #3
    cannonpas's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    kyoto
    Posts
    122
    Reputation
    10
    Thanks
    45
    Quote Originally Posted by Ch40zz-C0d3r View Post
    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)
    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;
    }


  4. #4
    OpKilts's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    The Interwebs
    Posts
    94
    Reputation
    57
    Thanks
    425
    My Mood
    Aggressive
    Quote Originally Posted by cannonpas View Post
    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
    1. (Complete)Make Simple Menu For Combat Arms NA
    2. (Complete) Reach 50 Post's
    3. (In Progress)Troll Nerdy Kids
    4. (Complete)Get a job at KFC

  5. #5
    Saltine's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    493
    Reputation
    104
    Thanks
    629
    Quote Originally Posted by OpKilts View Post
    Ahhh, the @matypatty way
    Also known as Structured Exception Handling

    Oh no! Vortex is gay!

  6. The Following User Says Thank You to Saltine For This Useful Post:

    matypatty (03-29-2013)

  7. #6
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,178
    My Mood
    Inspired
    Quote Originally Posted by Saltine View Post

    Also known as Structured Exception Handling
    I guess it got out
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    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


  8. #7
    matypatty's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    864
    Reputation
    229
    Thanks
    2,694
    My Mood
    Amused
    Quote Originally Posted by Flengo View Post


    I guess it got out
    Yea I stuck it in my menu base

    Pretty sure nofog is possible via puchtoconsole (not sure after this new ptc shit, havent kept up with the changes) which would be the preferred method as nexon protects DIP as much as it protects its employees virginity's.

  9. #8
    gotter's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    Minecraft snowy Biome
    Posts
    360
    Reputation
    6
    Thanks
    153
    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...

  10. The Following User Says Thank You to gotter For This Useful Post:

    matypatty (03-30-2013)

  11. #9
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    831
    Reputation
    44
    Thanks
    401
    My Mood
    Twisted
    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)

    Quote Originally Posted by Flengo View Post


    I guess it got out
    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

  12. The Following 2 Users Say Thank You to Ch40zz-C0d3r For This Useful Post:

    [MPGH]Flengo (03-30-2013),matypatty (03-30-2013)

  13. #10
    BadBurrito's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    32
    Reputation
    21
    Thanks
    226
    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

  14. #11
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    831
    Reputation
    44
    Thanks
    401
    My Mood
    Twisted
    Quote Originally Posted by BadBurrito View Post
    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
    Well I think there is no way without coding a bypass.

    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

  15. #12
    arun823's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Los Angeles, California
    Posts
    523
    Reputation
    151
    Thanks
    1,899
    My Mood
    Amused
    Quote Originally Posted by Ch40zz-C0d3r View Post
    Well I think there is no way without coding a bypass.
    Hooking DIP the "normal" way is still undetected for NA, on the other hand EU requires a bypass since it crashes after about 10 seconds.
    Reversing is the only way to move forward.

Similar Threads

  1. Favorite Quote
    By EleMentX in forum Spammers Corner
    Replies: 13
    Last Post: 01-04-2020, 04:36 PM
  2. When I quote people it quotes in my colour?
    By Hysteria in forum General
    Replies: 2
    Last Post: 10-14-2011, 08:46 AM
  3. MPGH AIM Chat Quote Thread
    By ace76543 in forum Entertainment
    Replies: 30
    Last Post: 09-25-2011, 12:14 PM
  4. MPGH IRC Chat Quote Thread
    By i eat trees in forum Entertainment
    Replies: 746
    Last Post: 07-02-2011, 10:07 PM
  5. [Release] Combat Arms EU Simple Chams,No Fog,Wallhack
    By kellermanz in forum Combat Arms Europe Hacks
    Replies: 1
    Last Post: 12-12-2009, 02:13 PM