Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <d3d9.h>
- #include <d3dx9.h>
- #include <stdio.h>
- #include <iostream>
- #include <string>
- #include <windows.h>
- class CDeathPlayer;
- class CLocalPlayerID;
- class CRenderData;
- class CRenderContext;
- class CGameBase;
- class CBonesContext;
- class CBone;
- class CDeathPlayer
- {
- public:
- BYTE Death[16];
- };
- class CLocalPlayerID
- {
- public:
- BYTE ID;
- };
- class CRenderData
- {
- public:
- CRenderContext* RenderData;
- };
- class CRenderContext
- {
- public:
- char unknown[0x8BF];
- D3DXMATRIX ViewMatrix;
- D3DXMATRIX ProjectMatrix;
- D3DXMATRIX WorldMatrix;
- };
- class CGameBase
- {
- public:
- char pad[0x158];
- CBonesContext* Bones;
- };
- class CBonesContext
- {
- public:
- char pad[0xE8];
- CBone* BoneData;
- };
- class CBone
- {
- public:
- D3DXMATRIX BoneMatrix;
- };
- class CGame
- {
- public:
- BYTE unknown1[0x14];
- CGameBase *GameBase[16];
- };
- DWORD d;
- //=======================================================================
- //-----------------------------------------------------------------
- //"void __thiscall CGameContext::setUserDe"...
- //-----------------------------------------------------------------
- BYTE GetUserLife(int iSlot)//Saber se o Player esta vivo...
- {
- DWORD g_pGameContext = *(DWORD*)0xAFBEC0; //"bool __thiscall CGameCharaBase::NET_Hit"...
- CDeathPlayer *Life = (CDeathPlayer *) (g_pGameContext + 0x2AD08);
- return Life->Death[iSlot];
- VirtualProtect((PVOID*)(g_pGameContext+0x2AD08), 10, PAGE_EXECUTE_READWRITE, &d);
- }
- //Fim__
- //------------------------------------------------------------------
- //"void __thiscall CGameContext::setMySlot"...
- //------------------------------------------------------------------
- int GetCharaIndex()//Obter Meu Slot.
- {
- DWORD g_pGameContext = *(DWORD*)0xAFBEC0; //"bool __thiscall CGameCharaBase::NET_Hit"...
- CLocalPlayerID *LocID = (CLocalPlayerID *) (g_pGameContext + 0x2ACB8);
- return LocID->ID;
- VirtualProtect((PVOID*)(g_pGameContext+0x2ACB8), 10, PAGE_EXECUTE_READWRITE, &d);
- }
- //Fim__
- //------------------------------------------------------------------
- //MyPosition-EnemyPosition...
- //------------------------------------------------------------------
- float CalcDistance(D3DXVECTOR3 VecA, D3DXVECTOR3 VecB)//Calcular distancia.
- {
- return sqrt( (( VecA.x - VecB.x) * ( VecA.x - VecB.x)) +
- (( VecA.y - VecB.y) * ( VecA.y - VecB.y)) +
- (( VecA.z - VecB.z) * ( VecA.z - VecB.z)));
- }
- //Fim__
- //-----------------------------------------------------------------
- //"int __thiscall CGameCharaBoneContext::g"...
- //-----------------------------------------------------------------
- bool GetUserBone(D3DXVECTOR3 &Out, int index, int BoneIndex)//Obter Ossos.
- {
- DWORD g_pCharaManager = *(DWORD*)0xAFBE8C; //ou 0xAFBE90 //"void __thiscall CStageBattle::_SetDefau"...
- if(g_pCharaManager)
- {
- CGameBase* GameBase = (CGameBase*) (*(DWORD*)(g_pCharaManager + 0x14 + (0x4 * index) ));
- VirtualProtect((PVOID*)(g_pCharaManager + 0x14 + (0x4 * index) ), 10, PAGE_EXECUTE_READWRITE, &d);
- if (GameBase && GameBase->Bones)
- {
- Out.x = GameBase->Bones->BoneData[BoneIndex].BoneMatrix._41;
- Out.y = GameBase->Bones->BoneData[BoneIndex].BoneMatrix._42;
- Out.z = GameBase->Bones->BoneData[BoneIndex].BoneMatrix._43;
- return true;
- }
- }
- return false;
- }
- //Fim__
- void *DetourCreate(BYTE *src, const BYTE *dst, const int len)
- {
- BYTE *jmp;
- DWORD dwback;
- DWORD jumpto, newjump;
- VirtualProtect(src,len,PAGE_READWRITE,&dwback);
- if(src[0] == 0xE9)
- {
- jmp = (BYTE*)malloc(10);
- jumpto = (*(DWORD*)(src+1))+((DWORD)src)+5;
- newjump = (jumpto-(DWORD)(jmp+5));
- jmp[0] = 0xE9;
- *(DWORD*)(jmp+1) = newjump;
- jmp += 5;
- jmp[0] = 0xE9;
- *(DWORD*)(jmp+1) = (DWORD)(src-jmp);
- }
- else
- {
- jmp = (BYTE*)malloc(5+len);
- memcpy(jmp,src,len);
- jmp += len;
- jmp[0] = 0xE9;
- *(DWORD*)(jmp+1) = (DWORD)(src+len-jmp)-5;
- }
- src[0] = 0xE9;
- *(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
- for(int i = 5; i < len; i++)
- src[i] = 0x90;
- VirtualProtect(src,len,dwback,&dwback);
- return (jmp-len);
- }
- //-------------------------------------------------------------------
- //Verifica de o player esta a < de 100.0f...
- //-------------------------------------------------------------------
- int GetPriorityTarget()//Pega a posição do player mais próximo.
- {
- int Result = -1;
- float fMaxDistance = 100.0f;
- D3DXVECTOR3 PlayerEnd, LocPlayer;
- for (int index = 0; index < 16; index++)
- {
- if (!GetUserLife(index) && GetCharaIndex() != index)
- {
- if (GetCharaIndex() %2 != index % 2)
- {
- GetUserBone(LocPlayer, GetCharaIndex(), 7);
- GetUserBone(PlayerEnd, index, 7);
- if (CalcDistance(LocPlayer, PlayerEnd) < fMaxDistance)
- {
- fMaxDistance = CalcDistance(PlayerEnd, LocPlayer);
- Result = index;
- }
- }
- }
- }
- return Result;
- }
- //Fim__
- //-----------------------------------------------------------------
- //"void __thiscall WeaponBase::DoLineColli"...
- //-----------------------------------------------------------------
- DWORD dwEnd = 0x4E2B3D;
- DWORD dwReturnEnd = dwEnd + 7;
- float fX = 10.0f, fY = 10.0f, fZ = 10.0f;
- bool EndEnable;
- DWORD dwTempEcx, dwTempEbx;
- _declspec( naked ) void End( )
- {
- if ( EndEnable )
- {
- _asm
- {
- mov [dwTempEcx], ecx;
- mov [dwTempEbx], ebx;
- mov ecx, [ebp+0x0C];
- mov ebx, [fX];
- mov [ecx], ebx;
- mov ebx, [fY];
- mov [ecx+0x04], ebx;
- mov ebx, [fZ];
- mov [ecx+0x08], ebx;
- mov ecx, [dwTempEcx];
- mov ebx, [dwTempEbx];
- }
- }
- _asm
- {
- mov eax, [ebp+0x08];
- push eax;
- mov ecx, [ebp-0x38];
- jmp dwReturnEnd;
- }
- }
- //Fim__
- //-------------------------------------------------------------
- //--------------------------AIMBOT-----------------------------
- //-------------------------------------------------------------
- void AimBot()
- {
- DWORD g_pPlayer = *(DWORD*)0xAAFAE88; //"int __thiscall CGameCharaBase::OnHit(st"...
- if(g_pPlayer != 0x0000)
- {
- int Priority = GetPriorityTarget();
- if(Priority != -1)
- {
- EndEnable = true;
- D3DXVECTOR3 OnScreen, OnWorld;
- D3DXVECTOR3 Out, Screen;
- GetUserBone(Out, Priority, 7);
- fX = Out.x;
- fY = Out.y;
- fZ = Out.z;
- DetourCreate((PBYTE)dwEnd, (PBYTE)End, 7);
- VirtualProtect((PVOID*)(dwEnd), 10, PAGE_EXECUTE_READWRITE, &d);
- VirtualProtect((PVOID*)(dwReturnEnd), 10, PAGE_EXECUTE_READWRITE, &d);
- VirtualProtect((PVOID*)(g_pPlayer), 10, PAGE_EXECUTE_READWRITE, &d);
- }
- }
- else
- {
- EndEnable = false;
- DetourCreate((PBYTE)dwEnd, (PBYTE)End, 7);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement