Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<Item> GetSlowAnimals() {
- std::vector<Item> ret;
- ULONG64 gTable;
- DWORD Size;
- ULONG64 gEntity;
- ULONG64 gEntityType;
- ULONG64 gModelName;
- ULONG64 gCleanName;
- ULONG64 gVisualState;
- ReadMemory((ULONG64)(World + OFFSET_WORLD_SLOWANIMALTABLE), &gTable);
- if (IsValid(gTable)) {
- ReadMemory((ULONG64)(World + OFFSET_WORLD_SLOWANIMALTABLE + 0x8), &Size);
- DWORD HasItem;
- for (size_t i = 0; i < Size; i++) {
- ReadMemory((ULONG64)(gTable + (i * 0x18)), &HasItem);
- if (HasItem == 1) {
- Item item;
- ZeroMemory(item.name, sizeof(item.name));
- ZeroMemory(item.model, sizeof(item.model));
- ReadMemory((ULONG64)((gTable + (i * 0x18) + 0x10)), &gEntity);
- ReadMemory((ULONG64)((gEntity + OFFSET_ENTITY_RENDERERVISUALSTATE)), &gVisualState);
- ReadMemory((ULONG64)((gVisualState + OFFSET_VISUALSTATE_POSITION)), &item.Position);
- item.w2s = WorldToScreen(&VM, item.Position);
- if (item.w2s.z <= 0.0f)
- continue;
- ReadMemory((ULONG64)((gEntity + OFFSET_ENTITY_RENDERERENTITYTYPE)), &gEntityType);
- ReadMemory((ULONG64)((gEntityType + OFFSET_ENTITYTYPE_MODELNAME)), &gModelName);
- ReadMemory((ULONG64)((gEntityType + OFFSET_ENTITYTYPE_CLEANNAME)), &gCleanName);
- uint32_t modelSize;
- ReadMemory((ULONG64)(gModelName + 0x8), &modelSize);
- if (modelSize > 0) {
- ReadMemory((ULONG64)(gModelName + 0x10), &item.model);
- }
- else {
- continue;
- }
- ReadMemory((ULONG64)(gCleanName + 0x8), &modelSize);
- if (modelSize > 0) {
- ReadMemory((ULONG64)(gCleanName + 0x10), &item.name);
- if (strncmp("$UNT$", item.name, 3) == 0) {
- std::string s(item.name);
- s.erase(0, 5);
- ZeroMemory(item.name, sizeof(item.name));
- CopyMemory(item.name, s.c_str(), s.size());
- }
- char *p = strchr(item.name, '\n');
- if (p != NULL) {
- *p = ' ';
- }
- }
- else {
- continue;
- }
- if (strcmp(item.name, "Infected") == 0)
- continue;
- //if (modelSize == 0)
- // continue;
- ret.push_back(item);
- }
- }
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement