This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
112 changed files
with
2,928 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include "getinstancesmulti.h" | ||
#include "../message.h" | ||
#include "../../injector.h" | ||
#include "../../UE425/uobjectarray.h" | ||
#include "../../UE425/uobject.h" | ||
|
||
GetInstancesMultiRequest::GetInstancesMultiRequest(Buffer& data) : Request(data), names() { | ||
uint64_t namesSize = data.Read<uint64_t>(); | ||
for (uint64_t i =0; i < namesSize; i++) | ||
{ | ||
names.push_back(data.Read()); | ||
} | ||
|
||
count = data.Read<uint32_t>(); | ||
deep = data.Read<bool>(); | ||
} | ||
|
||
void GetInstancesMultiRequest::Process() { | ||
GetInstancesMultiResponse res; | ||
|
||
std::unordered_map<UObject*, uint32_t> indices; | ||
std::vector<UObject*> objects; | ||
uint32_t index = 0; | ||
for (auto name : names) { | ||
FUObjectItem* item = injector.memory.getSymbol<FUObjectArray>()->FindObject(name); | ||
if (item && item->Object) { | ||
objects.push_back(item->Object); | ||
indices.insert({ item->Object, index }); | ||
} | ||
index++; | ||
} | ||
|
||
std::vector<std::tuple<UObject*, FUObjectItem*>> found = injector.memory.getSymbol<FUObjectArray>()->FindInstances(objects, count, deep); | ||
for (auto tuple : found) { | ||
UObject* type = std::get<0>(tuple); | ||
FUObjectItem* item = std::get<1>(tuple); | ||
std::unordered_map<UObject*, uint32_t>::const_iterator index = indices.find(type); | ||
|
||
if (!item || !item->Object || index == indices.end()) | ||
continue; | ||
|
||
res.data.push_back({ index->second, item->Object->GetFullName() }); | ||
} | ||
|
||
ProcessResponse(res); | ||
} | ||
|
||
void GetInstancesMultiResponse::Process(Buffer& buffer) { | ||
Response::Process(buffer); | ||
|
||
buffer.Write(data.size()); | ||
for (auto& item : data) | ||
{ | ||
buffer.Write(std::get<0>(item)); | ||
buffer.Write(std::get<1>(item)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
#pragma once | ||
#include <string> | ||
#include "../message.h" | ||
#include "../../generator.h" | ||
|
||
class GetInstancesMultiRequest : public Request { | ||
public: | ||
std::vector<std::string> names; | ||
uint32_t count; | ||
bool deep; | ||
|
||
GetInstancesMultiRequest(Buffer& data); | ||
|
||
void Process() override; | ||
}; | ||
|
||
class GetInstancesMultiResponse : public Response { | ||
public: | ||
std::vector<std::tuple<uint32_t, std::string>> data; | ||
|
||
GetInstancesMultiResponse() : Response(MessageType::GET_INSTANCES_MULTI) {}; | ||
GetInstancesMultiResponse(std::vector<std::tuple<uint32_t, std::string>> data) : data(data), Response(MessageType::GET_INSTANCES_MULTI) {}; | ||
|
||
void Process(Buffer& data) override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.