Add missing copy constructors

This commit is contained in:
Maschell 2020-05-17 20:43:04 +02:00
parent 7247ad3093
commit 3b9f4a9a51
7 changed files with 49 additions and 0 deletions

View File

@ -23,6 +23,12 @@
class PluginContainer {
public:
PluginContainer(const PluginContainer& other) {
this->pluginData = other.pluginData;
this->pluginInformation = other.pluginInformation;
this->metaInformation = other.metaInformation;
}
PluginContainer() {
}

View File

@ -1,5 +1,14 @@
#include "PluginData.h"
PluginData::PluginData(const PluginData &obj) {
this->buffer = obj.buffer;
this->heapHandle = obj.heapHandle;
this->memoryType = obj.memoryType;
this->length = obj.length;
loadReader();
}
void PluginData::freeMemory() {
if (buffer == NULL) {
return;

View File

@ -48,6 +48,8 @@ public:
void freeMemory();
private:
PluginData(const PluginData &obj);
PluginData() {
}

View File

@ -0,0 +1,17 @@
#include "PluginInformation.h"
PluginInformation::PluginInformation(const PluginInformation& other) {
for (size_t i=0; i<other.hook_data_list.size(); i++){
hook_data_list.push_back(other.hook_data_list[i]);
}
for (size_t i=0; i<other.function_data_list.size(); i++){
function_data_list.push_back(other.function_data_list[i]);
}
for (size_t i=0; i<other.relocation_data_list.size(); i++){
relocation_data_list.push_back(other.relocation_data_list[i]);
}
section_info_list = other.section_info_list;
trampolinId = other.trampolinId;
allocatedTextMemoryAddress = other.allocatedTextMemoryAddress;
allocatedDataMemoryAddress = other.allocatedDataMemoryAddress;
}

View File

@ -29,6 +29,8 @@
class PluginInformation {
public:
PluginInformation(const PluginInformation& other);
PluginInformation() {
}

View File

@ -0,0 +1,11 @@
#include "PluginMetaInformation.h"
PluginMetaInformation::PluginMetaInformation(const PluginMetaInformation& other) {
this->name = other.name;
this->author = other.author;
this->version = other.version;
this->license = other.license;
this->buildtimestamp = other.buildtimestamp;
this->description = other.description;
this->size = other.size;
}

View File

@ -22,6 +22,8 @@
class PluginMetaInformation {
public:
PluginMetaInformation(const PluginMetaInformation& other);
const std::string getName() const {
return name;
}