Did you try the LTClient Function
restore the address when out of game
if your not already doing so
Code:if (InGame()) { if (Hack) memcpy(address, PatchBytes, Size); else memcpy(address, OriginalBytes , Size); } else { memcpy(address, OriginalBytes, Size); }
Last edited by realnigger; 06-03-2012 at 01:26 AM.
matypatty (06-06-2012)
What thread?
That's basically how all of my hacks look like. Including PTC's.Code:void cHacks::NameTags(int Val) { if(Val > 0 && *(BYTE*)ADDR_GAMESTATUS == 1) { MemEdit((PBYTE)(ADDR_TAGS1), (PBYTE)"\x90\x90", 2); MemEdit((PBYTE)(ADDR_TAGS2), (PBYTE)"\x90\x90", 2); }else{ MemEdit((PBYTE)(ADDR_TAGS1), (PBYTE)"\x75\x05", 2); MemEdit((PBYTE)(ADDR_TAGS2), (PBYTE)"\x75\x05", 2); } }
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
@cubanelite here's the Function.
I Use this(I Don't Take Credits for This)
Code:bool inGame() { typedef bool (*IsConnected_t)(void); DWORD* LTBase = (DWORD*)ADDR_LTCLIENT; IsConnected_t pConnected = *(IsConnected_t*)(*LTBase + 0x8C); return pConnected(); }
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
Xipher (06-03-2012)
I added this:
Credits: NightmareCode:void Memoria( void* pvAddress, void* pvBuffer, size_t len ) { if( *(BYTE*)pvAddress == *(BYTE*)pvBuffer ) return; memcpy( ( void* )pvAddress, ( void* )pvBuffer, len ); } bool bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask) { for(;*szMask;++szMask,++pData,++bMask) if(*szMask=='x' && *pData!=*bMask ) return false; return (*szMask) == NULL; } DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask) { for(DWORD i=0; i < dwLen; i++) if(bDataCompare( (BYTE*)( dwAddress+i ),bMask,szMask) ) return (DWORD)(dwAddress+i); return 0; }
Now I don't crash my second game.
Last edited by cubanelite; 06-03-2012 at 12:16 PM.
If you have any questions, PM Me. I always check them.PEACE, HOMIES!
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
Code:if( (*(BYTE *)GameStatus == 1) ){ // All functions }
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
cubanelite (06-04-2012)
You can easily condense this algorithm to:Or, why not try some ternary operatorsCode:if (Hack && InGame()) memcpy(address, PatchBytes, Size); else memcpy(address, OriginalBytes , Size);The code written by the OP of this thread made me want to cry it was so inefficient. Function calls are pretty expensive, and he made TONS of unnecessary ones. At the beginning of each frame, cache the result of the InGame call to a variable, and then use that.Code:(Hack && InGame())?memcpy(address, PatchBytes, Size):memcpy(address, OriginalBytes , Size);
This would save lots of resource usage over time.Code://gobals bool statusCache; //top of present statusCache = InGame(); //then for accessing it if (Hack && statusCache) memcpy(address, PatchBytes, Size); else memcpy(address, OriginalBytes , Size);
Oh no! Vortex is gay!
cubanelite (06-04-2012)