ESP AI using ObjectMgr

Posts 1–15 of 15 · Page 1 of 1
ESP AI using ObjectMgr


Hi guys, I just need some help what is mistake i did with that ? ESP AI doesn't work...

Code:

void CObjectType::ESPZA(LPDIRECT3DDEVICE9 pDevice)
{
	auto ptr = *(DWORD*)(ObjectMgr_Addr);
	if (isBadPointer(ptr)) return;

	auto ObjCount = *(DWORD*)(ptr + 0xA18); 
	if (ObjCount < 0) return;

	POINT pt;
	D3DVIEWPORT9 viewP;
	pDevice->GetViewport(&viewP);
	float ScreenX = viewP.Width;
	float ScreenY = viewP.Height;

	D3DCOLOR ESP_Color = Red;

	for (uint16_t i = 0; i < ObjCount; i++)
	{
		auto ZombieObj = GetInstancesByIndex(i);

		D3DXVECTOR3 tBody = ZombieObj->GetObjectType()->GetBonePosition(6);
		D3DXVECTOR3 Foot = ZombieObj->GetObjectType()->GetBonePosition(28);

		if (ZombieObj != NULL)
		{
			if (ZombieObj->GetObjectType()->GetAIClient() != NULL)
			{
				if (ZombieObj->GetObjectType()->GetAIClient()->AIObject != NULL)
				{
					if (ZombieObj->GetObjectType()->GetAIClient()->AIHealth > 0)
					{
						if (Engine->WorldToScreen(pDevice, &tBody))
						{
							if (Bone)
							{
								this->DrawPlayer(pDevice, Red);
							}

							if (Line)
							{

								POINT pt;
								D3DVIEWPORT9 viewP;
								pDevice->GetViewport(&viewP);
								float ScreenX = viewP.Width;
								float ScreenY = viewP.Height;
								DWORD ScreenCenterX = viewP.Width / 2;
								DWORD ScreenCenterY = viewP.Height / 2;

								int LinesComeFrom_X = ScreenCenterX;
								int LinesComeFrom_Y = ScreenCenterX;

								DirectX->DrawLine(pDevice, LinesComeFrom_X, LinesComeFrom_Y, tBody.x, tBody.y, Red);
							}
						}
					}
				}
			}
		}
	}
	
}
I think mistake in ObjectCount maybe it's wrong because when i tried to Log code to find mistake it's shows nothing, i tried to get latest offset by reclass but i didn't find offset counting AIs

Thanks ALL .

Quote Originally Posted by TheGe2k View Post


Hi guys, I just need some help what is mistake i did with that ? ESP AI doesn't work...

Code:

void CObjectType::ESPZA(LPDIRECT3DDEVICE9 pDevice)
{
	auto ptr = *(DWORD*)(ObjectMgr_Addr);
	if (isBadPointer(ptr)) return;

	auto ObjCount = *(DWORD*)(ptr + 0xA18); 
	if (ObjCount < 0) return;

	POINT pt;
	D3DVIEWPORT9 viewP;
	pDevice->GetViewport(&viewP);
	float ScreenX = viewP.Width;
	float ScreenY = viewP.Height;

	D3DCOLOR ESP_Color = Red;

	for (uint16_t i = 0; i < ObjCount; i++)
	{
		auto ZombieObj = GetInstancesByIndex(i);

		D3DXVECTOR3 tBody = ZombieObj->GetObjectType()->GetBonePosition(6);
		D3DXVECTOR3 Foot = ZombieObj->GetObjectType()->GetBonePosition(28);

		if (ZombieObj != NULL)
		{
			if (ZombieObj->GetObjectType()->GetAIClient() != NULL)
			{
				if (ZombieObj->GetObjectType()->GetAIClient()->AIObject != NULL)
				{
					if (ZombieObj->GetObjectType()->GetAIClient()->AIHealth > 0)
					{
						if (Engine->WorldToScreen(pDevice, &tBody))
						{
							if (Bone)
							{
								this->DrawPlayer(pDevice, Red);
							}

							if (Line)
							{

								POINT pt;
								D3DVIEWPORT9 viewP;
								pDevice->GetViewport(&viewP);
								float ScreenX = viewP.Width;
								float ScreenY = viewP.Height;
								DWORD ScreenCenterX = viewP.Width / 2;
								DWORD ScreenCenterY = viewP.Height / 2;

								int LinesComeFrom_X = ScreenCenterX;
								int LinesComeFrom_Y = ScreenCenterX;

								DirectX->DrawLine(pDevice, LinesComeFrom_X, LinesComeFrom_Y, tBody.x, tBody.y, Red);
							}
						}
					}
				}
			}
		}
	}
	
}
I think mistake in ObjectCount maybe it's wrong because when i tried to Log code to find mistake it's shows nothing, i tried to get latest offset by reclass but i didn't find offset counting AIs

Thanks ALL .

set a loop. try at least 400. If esp works then you prolly got the wrong offset for count. if it still doesn't, it's probably the pointers.
and lastly... remove the checks but leave the isbadpointer so you wont crash.
Quote Originally Posted by akbargain View Post
set a loop. try at least 400. If esp works then you prolly got the wrong offset for count. if it still doesn't, it's probably the pointers.
and lastly... remove the checks but leave the isbadpointer so you wont crash.
Error report in 90% so...
Quote Originally Posted by [Snake] View Post
Code:
uint32 CObjectMgr::GetObjectCount()
{
	if (!this)
		return 0;

	return *(uint32*)((uintptr_t)this + 0x0B1C);
}
I'm curious to see what is this that you guys call 'ObjectMgr' o.O
Quote Originally Posted by vaisefud3 View Post
I'm curious to see what is this that you guys call 'ObjectMgr' o.O
remember when i asked for tips but still can't find the entitydb because i can't bypass ce? haha that's the alternative that i used and i told you about it, tho it doesn't have WeaponLTobj in it's list. haha you already found it before.
Quote Originally Posted by akbargain View Post
remember when i asked for tips but still can't find the entitydb because i can't bypass ce? haha that's the alternative that i used and i told you about it, tho it doesn't have WeaponLTobj in it's list. haha you already found it before.
Nice to see you made it work
Quote Originally Posted by vaisefud3 View Post
Nice to see you made it work
up for new challenge ? i can come up with other idea to ruin cf as usual xd
Quote Originally Posted by 96neko View Post
up for new challenge ? i can come up with other idea to ruin cf as usual xd
even more? I updated a lot of stuff I had, including killing everything that shows up in my screen lmao. I do be listening tho
Quote Originally Posted by vaisefud3 View Post
even more? I updated a lot of stuff I had, including killing everything that shows up in my screen lmao. I do be listening tho
well why killing'em when you can spawn more enemies or even a zombie boss ? or maybe freeze all players in the room ? or maybe even start loop room forever ? these are few things i did the past weeks , did more stuff & i won't be sharing any since everyone is profiting from it
Quote Originally Posted by 96neko View Post
well why killing'em when you can spawn more enemies or even a zombie boss ? or maybe freeze all players in the room ? or maybe even start loop room forever ? these are few things i did the past weeks , did more stuff & i won't be sharing any since everyone is profiting from it
Damn that's mean, you have my d1sc0rd, tell me more
Quote Originally Posted by TheGe2k View Post


Hi guys, I just need some help what is mistake i did with that ? ESP AI doesn't work...

Code:

void CObjectType::ESPZA(LPDIRECT3DDEVICE9 pDevice)
{
	auto ptr = *(DWORD*)(ObjectMgr_Addr);
	if (isBadPointer(ptr)) return;

	auto ObjCount = *(DWORD*)(ptr + 0xA18); 
	if (ObjCount < 0) return;

	POINT pt;
	D3DVIEWPORT9 viewP;
	pDevice->GetViewport(&viewP);
	float ScreenX = viewP.Width;
	float ScreenY = viewP.Height;

	D3DCOLOR ESP_Color = Red;

	for (uint16_t i = 0; i < ObjCount; i++)
	{
		auto ZombieObj = GetInstancesByIndex(i);

		D3DXVECTOR3 tBody = ZombieObj->GetObjectType()->GetBonePosition(6);
		D3DXVECTOR3 Foot = ZombieObj->GetObjectType()->GetBonePosition(28);

		if (ZombieObj != NULL)
		{
			if (ZombieObj->GetObjectType()->GetAIClient() != NULL)
			{
				if (ZombieObj->GetObjectType()->GetAIClient()->AIObject != NULL)
				{
					if (ZombieObj->GetObjectType()->GetAIClient()->AIHealth > 0)
					{
						if (Engine->WorldToScreen(pDevice, &tBody))
						{
							if (Bone)
							{
								this->DrawPlayer(pDevice, Red);
							}

							if (Line)
							{

								POINT pt;
								D3DVIEWPORT9 viewP;
								pDevice->GetViewport(&viewP);
								float ScreenX = viewP.Width;
								float ScreenY = viewP.Height;
								DWORD ScreenCenterX = viewP.Width / 2;
								DWORD ScreenCenterY = viewP.Height / 2;

								int LinesComeFrom_X = ScreenCenterX;
								int LinesComeFrom_Y = ScreenCenterX;

								DirectX->DrawLine(pDevice, LinesComeFrom_X, LinesComeFrom_Y, tBody.x, tBody.y, Red);
							}
						}
					}
				}
			}
		}
	}
	
}
I think mistake in ObjectCount maybe it's wrong because when i tried to Log code to find mistake it's shows nothing, i tried to get latest offset by reclass but i didn't find offset counting AIs

Thanks ALL .

Code:
class WorldTreeHelper : public IBase
{
public:

};

class ObjectMgr : public WorldTreeHelper, public singleton<ObjectMgr>
{
public:
	ObjectMgr();

public:
	//(Client and Server)
	List* GetObjectList(int id) { return (List*)((uintptr_t)this + 0x264 + (sizeof(List) * id)); }
};
Code:
class CClientMgr : public IBase, public singleton<CClientMgr>
{
public:
	CClientMgr();

public:
	// The object manager.  This holds the lists of all the objects (which aren't
	// necessarily always in the world tree).
	ObjectMgr*	m_ObjectMgr() { return (ObjectMgr*)((uintptr_t)this + 0x0000); }

	CNetMgr*	m_NetMgr() { return this->GetValue<CNetMgr*>(0x03B8); };

	ClientShell*	m_pCurShell() { return this->GetValue<ClientShell*>(0x0B58); };

public:
	//55 8B EC 51 89 4D FC 0F B7 45 08 8B 4D FC 3B 81 ?? ?? ?? ?? 73 29 0F B7 55 08 8B 45 FC 8B 88 ?? ?? ?? ?? 0F B6 14 D1
	ModelInstance*	FindObjectClient(uint16 id) { return reinterpret_cast<ModelInstance * (__thiscall*)(void*, uint16)>(m_FindObjectClient)(this, id); };
	int		m_ObjectMapSize() { return g_pLTBase->GetObjectElements(); };
	
	//int		ILTCSBase::GetObjectElements()
	//{
	//	return GetVFunc<int(*)(void*)>(this, 181)(this);
	//}
};
Code:
class CServerMgr : public CNetHandler, public singleton<CServerMgr>
{
public:
	CServerMgr();

	// The object manager.  This holds the lists of all the objects (which aren't
	// necessarily always in the world tree).
	ObjectMgr*		m_ObjectMgr() { return (ObjectMgr*)((uintptr_t)this + 0x019C); }

	CNetMgr*		m_NetMgr() { return this->GetValue<CNetMgr*>(0x0538); };

public:
	//55 8B EC 51 A1 ?? ?? ?? ?? 8B 88 ?? ?? 00 00 89 4D FC ?? ?? ?? ?? ?? ??
	static ModelInstance*	FindObjectServer(uint16 id) { return reinterpret_cast<ModelInstance * (__cdecl*)(uint16)>(m_FindObjectServer)(id); };
	int			m_ObjectMapSize() { return this->GetValue<int>(0x73C); };
};
Client Objects Usage
Code:
Method 1
Code:
55 8B EC 8B 45 08 50 8B 0D ? ? ? ? ? ? ? ? E8 ? ? ? ? ? ? ? ? 5D C3
auto sfxlist = g_pClientMgr->m_ObjectMgr()->GetObjectList(OT_MODEL);
if (sfxlist == NULL)
	return;

Link* pListHead = &sfxlist->m_Head;
if (pListHead == NULL)
	return;

for (auto pCur = pListHead->m_pNext; pCur != pListHead; pCur = pCur->m_pNext)
{
	if (pCur == NULL)
		break;

	auto pModelInst = (ModelInstance*)pCur->m_pData;
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}
Method 2
Code:
for (int x = 0; x < g_pClientMgr->m_ObjectMapSize(); x++)
{
	auto pModelInst = g_pClientMgr->FindObjectClient(x);
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}
Server Objects Usage
Code:
Method 1
Code:
55 8B EC 83 EC 0C C7 45 ? ? ? ? ? ? ? ? ? ? 8B 4D 08 E8 ? ? ? ? ? ? ? ? 66 89 45 FC 0F B7 45 FC 3D ? ? ? ? ? ? ? ? 74 47 8B 0D ? ? ? ? ? ? ? ? 8B 91 ? ? ? ? ? ? ? ? 89 55 F4 0F B7 45 FC
auto sfxlist = g_pServerMgr->m_ObjectMgr()->GetObjectList(OT_MODEL);
if (sfxlist == NULL)
	return;

Link* pListHead = &sfxlist->m_Head;
if (pListHead == NULL)
	return;

for (auto pCur = pListHead->m_pNext; pCur != pListHead; pCur = pCur->m_pNext)
{
	if (pCur == NULL)
		break;

	auto pModelInst = (ModelInstance*)pCur->m_pData;
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}
Method 2
Code:
for (int x = 0; x < g_pServerMgr->m_ObjectMapSize(); x++)
{
	auto pModelInst = g_pServerMgr->FindObjectServer(x);
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}

Code:
class Link;

class CheapLink
{
public:
    Link* m_pPrev, * m_pNext;
};

class Link : public CheapLink
{
public:
    void* m_pData;
};

class List
{
public:
    unsigned long m_nElements;
    Link m_Head;
};

/*!
Different object types.  Some can only be created on the client.
*/
enum
{
//! Invisible object.  Note, client's aren't told about
    OT_NORMAL =           0,

//! Model object.
    OT_MODEL =            1,

//! WorldModel.
    OT_WORLDMODEL =       2,

//! Sprite.
    OT_SPRITE =           3,

//! Dynamic light.
    OT_LIGHT =            4,

//! Camera.
    OT_CAMERA =           5,

//! Particle system.
    OT_PARTICLESYSTEM =   6,

//! Poly grid.
    OT_POLYGRID =         7,

//! Line system.
    OT_LINESYSTEM =       8,

//! Container.
    OT_CONTAINER =        9,

//! Canvas (game code renders it).
    OT_CANVAS =           10,

//! Volume effect.
	OT_VOLUMEEFFECT =     11,

/*!
NOTE: the high bit of the object type is reserved
for the engine's networking.
ALSO NOTE: The networking assumes there are < 16 object types!
*/
    NUM_OBJECTTYPES =     12,
};
ohhh thank you very much
Can i try yours, i give up. i can't ruin cf now
Quote Originally Posted by jayjay153 View Post
Code:
class WorldTreeHelper : public IBase
{
public:

};

class ObjectMgr : public WorldTreeHelper, public singleton<ObjectMgr>
{
public:
	ObjectMgr();

public:
	//(Client and Server)
	List* GetObjectList(int id) { return (List*)((uintptr_t)this + 0x264 + (sizeof(List) * id)); }
};
Code:
class CClientMgr : public IBase, public singleton<CClientMgr>
{
public:
	CClientMgr();

public:
	// The object manager.  This holds the lists of all the objects (which aren't
	// necessarily always in the world tree).
	ObjectMgr*	m_ObjectMgr() { return (ObjectMgr*)((uintptr_t)this + 0x0000); }

	CNetMgr*	m_NetMgr() { return this->GetValue<CNetMgr*>(0x03B8); };

	ClientShell*	m_pCurShell() { return this->GetValue<ClientShell*>(0x0B58); };

public:
	//55 8B EC 51 89 4D FC 0F B7 45 08 8B 4D FC 3B 81 ?? ?? ?? ?? 73 29 0F B7 55 08 8B 45 FC 8B 88 ?? ?? ?? ?? 0F B6 14 D1
	ModelInstance*	FindObjectClient(uint16 id) { return reinterpret_cast<ModelInstance * (__thiscall*)(void*, uint16)>(m_FindObjectClient)(this, id); };
	int		m_ObjectMapSize() { return g_pLTBase->GetObjectElements(); };
	
	//int		ILTCSBase::GetObjectElements()
	//{
	//	return GetVFunc<int(*)(void*)>(this, 181)(this);
	//}
};
Code:
class CServerMgr : public CNetHandler, public singleton<CServerMgr>
{
public:
	CServerMgr();

	// The object manager.  This holds the lists of all the objects (which aren't
	// necessarily always in the world tree).
	ObjectMgr*		m_ObjectMgr() { return (ObjectMgr*)((uintptr_t)this + 0x019C); }

	CNetMgr*		m_NetMgr() { return this->GetValue<CNetMgr*>(0x0538); };

public:
	//55 8B EC 51 A1 ?? ?? ?? ?? 8B 88 ?? ?? 00 00 89 4D FC ?? ?? ?? ?? ?? ??
	static ModelInstance*	FindObjectServer(uint16 id) { return reinterpret_cast<ModelInstance * (__cdecl*)(uint16)>(m_FindObjectServer)(id); };
	int			m_ObjectMapSize() { return this->GetValue<int>(0x73C); };
};
Client Objects Usage
Code:
Method 1
Code:
55 8B EC 8B 45 08 50 8B 0D ? ? ? ? ? ? ? ? E8 ? ? ? ? ? ? ? ? 5D C3
auto sfxlist = g_pClientMgr->m_ObjectMgr()->GetObjectList(OT_MODEL);
if (sfxlist == NULL)
	return;

Link* pListHead = &sfxlist->m_Head;
if (pListHead == NULL)
	return;

for (auto pCur = pListHead->m_pNext; pCur != pListHead; pCur = pCur->m_pNext)
{
	if (pCur == NULL)
		break;

	auto pModelInst = (ModelInstance*)pCur->m_pData;
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}
Method 2
Code:
for (int x = 0; x < g_pClientMgr->m_ObjectMapSize(); x++)
{
	auto pModelInst = g_pClientMgr->FindObjectClient(x);
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}
Server Objects Usage
Code:
Method 1
Code:
55 8B EC 83 EC 0C C7 45 ? ? ? ? ? ? ? ? ? ? 8B 4D 08 E8 ? ? ? ? ? ? ? ? 66 89 45 FC 0F B7 45 FC 3D ? ? ? ? ? ? ? ? 74 47 8B 0D ? ? ? ? ? ? ? ? 8B 91 ? ? ? ? ? ? ? ? 89 55 F4 0F B7 45 FC
auto sfxlist = g_pServerMgr->m_ObjectMgr()->GetObjectList(OT_MODEL);
if (sfxlist == NULL)
	return;

Link* pListHead = &sfxlist->m_Head;
if (pListHead == NULL)
	return;

for (auto pCur = pListHead->m_pNext; pCur != pListHead; pCur = pCur->m_pNext)
{
	if (pCur == NULL)
		break;

	auto pModelInst = (ModelInstance*)pCur->m_pData;
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}
Method 2
Code:
for (int x = 0; x < g_pServerMgr->m_ObjectMapSize(); x++)
{
	auto pModelInst = g_pServerMgr->FindObjectServer(x);
	if (pModelInst == NULL)
		continue;

	//pModelInst  <- Model Information
}

Code:
class Link;

class CheapLink
{
public:
    Link* m_pPrev, * m_pNext;
};

class Link : public CheapLink
{
public:
    void* m_pData;
};

class List
{
public:
    unsigned long m_nElements;
    Link m_Head;
};

/*!
Different object types.  Some can only be created on the client.
*/
enum
{
//! Invisible object.  Note, client's aren't told about
    OT_NORMAL =           0,

//! Model object.
    OT_MODEL =            1,

//! WorldModel.
    OT_WORLDMODEL =       2,

//! Sprite.
    OT_SPRITE =           3,

//! Dynamic light.
    OT_LIGHT =            4,

//! Camera.
    OT_CAMERA =           5,

//! Particle system.
    OT_PARTICLESYSTEM =   6,

//! Poly grid.
    OT_POLYGRID =         7,

//! Line system.
    OT_LINESYSTEM =       8,

//! Container.
    OT_CONTAINER =        9,

//! Canvas (game code renders it).
    OT_CANVAS =           10,

//! Volume effect.
	OT_VOLUMEEFFECT =     11,

/*!
NOTE: the high bit of the object type is reserved
for the engine's networking.
ALSO NOTE: The networking assumes there are < 16 object types!
*/
    NUM_OBJECTTYPES =     12,
};
Alternatively, you can get the object count using:

Code:
gObjectMgr->m_ObjectLists[ OT_MODEL ]->m_nElements
And loop them using the same logic as jayjay's, just without using a function:

Code:
auto pListHead = gObjectMgr->m_ObjectLists[ OT_MODEL ].m_Head;

for (auto pCur = pListHead->m_pNext; pCur != pListHead; pCur = pCur->m_pNext)
{

}
Quote Originally Posted by TheGe2k View Post


Hi guys, I just need some help what is mistake i did with that ? ESP AI doesn't work...

Code:

void CObjectType::ESPZA(LPDIRECT3DDEVICE9 pDevice)
{
	auto ptr = *(DWORD*)(ObjectMgr_Addr);
	if (isBadPointer(ptr)) return;

	auto ObjCount = *(DWORD*)(ptr + 0xA18); 
	if (ObjCount < 0) return;

	POINT pt;
	D3DVIEWPORT9 viewP;
	pDevice->GetViewport(&viewP);
	float ScreenX = viewP.Width;
	float ScreenY = viewP.Height;

	D3DCOLOR ESP_Color = Red;

	for (uint16_t i = 0; i < ObjCount; i++)
	{
		auto ZombieObj = GetInstancesByIndex(i);

		D3DXVECTOR3 tBody = ZombieObj->GetObjectType()->GetBonePosition(6);
		D3DXVECTOR3 Foot = ZombieObj->GetObjectType()->GetBonePosition(28);

		if (ZombieObj != NULL)
		{
			if (ZombieObj->GetObjectType()->GetAIClient() != NULL)
			{
				if (ZombieObj->GetObjectType()->GetAIClient()->AIObject != NULL)
				{
					if (ZombieObj->GetObjectType()->GetAIClient()->AIHealth > 0)
					{
						if (Engine->WorldToScreen(pDevice, &tBody))
						{
							if (Bone)
							{
								this->DrawPlayer(pDevice, Red);
							}

							if (Line)
							{

								POINT pt;
								D3DVIEWPORT9 viewP;
								pDevice->GetViewport(&viewP);
								float ScreenX = viewP.Width;
								float ScreenY = viewP.Height;
								DWORD ScreenCenterX = viewP.Width / 2;
								DWORD ScreenCenterY = viewP.Height / 2;

								int LinesComeFrom_X = ScreenCenterX;
								int LinesComeFrom_Y = ScreenCenterX;

								DirectX->DrawLine(pDevice, LinesComeFrom_X, LinesComeFrom_Y, tBody.x, tBody.y, Red);
							}
						}
					}
				}
			}
		}
	}
	
}
I think mistake in ObjectCount maybe it's wrong because when i tried to Log code to find mistake it's shows nothing, i tried to get latest offset by reclass but i didn't find offset counting AIs

Thanks ALL .


you can share, Get Bone Position Function? xD
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?