Hey all, just occurred to me that I have not actually posted anything or really given anything back so I decided I wanted to post some simple code I have been using.
First Id like you to note its kinda messy, but it puts the basic idea out there. Its basically a replica of how you would get an object by GUID from object manager except I moved it over to check the Display ID as well. This way I can find anything in Object Manager by Model - This specific piece of code was used in my fishing program but with minor tweaking could be easily used to check for anything via Display ID.
Edit: Just noticed I ****ed up on title. Its meant to be GetObjectbydisplay
Edit: Removed a silly mistake I just noticed 
Code:
DWORD ObjectManager::GetObjectByDisplay(HANDLE hProcess, DWORD BaseAddress, int DisplayId, DWORD s_curMgr, UINT64 localGUID)
{
// The code below finds the object based on its display id and returns its object base.
DWORD BytesRead;
DWORD cObj, lObj, nObj;
UINT64 cGUID;
DWORD DescriptorFields;
//DWORD ObjectEnd =0x20;
DWORD Object_CreatedByOffset = 0x20;
DWORD DisplayId_Offset = 0x28;
int count = 0;
ReadProcessMemory(hProcess, (LPCVOID)(s_curMgr + 0xC0), &cObj, 4, &BytesRead);
while (cObj != 0 && (cObj & 1) == 0)
{
ReadProcessMemory(hProcess, (LPCVOID)(cObj + 0xC), &DescriptorFields, 4, &BytesRead);
ReadProcessMemory(hProcess, (LPCVOID)(DescriptorFields + Object_CreatedByOffset), &cGUID, 8, &BytesRead);
ReadProcessMemory(hProcess, (LPCVOID)(DescriptorFields + DisplayId_Offset), &DisplayId, 4, &BytesRead);
if (cGUID == localGUID)
{
count = count + 1;
if(DisplayId == 668)
{
lObj = cObj; // lObj is our fishing bobbers object.
return lObj;
break;
}
}
ReadProcessMemory(hProcess, (LPCVOID)(cObj + 0x3C), &nObj, 4, &BytesRead);
if (nObj == cObj)
{
//std::cout << "returned";
return -1;
}
else
{
cObj = nObj;
}
}
return -1;
}
I hope this is helpful to someone. Feel free to comment on the code, or anything - I'm always open to constructive criticism and want to improve because I understand I am far from perfect. Just keep in mind that the main point of this is to point out the idea, and show a way to do it.
Note no real error checking.