diff options
| author | auth12 <[email protected]> | 2020-07-24 10:56:14 -0700 |
|---|---|---|
| committer | auth12 <[email protected]> | 2020-07-24 10:56:14 -0700 |
| commit | e487ffe1671ba807528d4039ef66f8f8f7eeb853 (patch) | |
| tree | c65cc4dd529f8e37f9cca81d38c749dece13a574 /server | |
| parent | Injection and server changes. (diff) | |
| download | loader-e487ffe1671ba807528d4039ef66f8f8f7eeb853.tar.xz loader-e487ffe1671ba807528d4039ef66f8f8f7eeb853.zip | |
Injection process changes and server improvements.
Diffstat (limited to 'server')
| -rw-r--r-- | server/src/image/pe.h | 2 | ||||
| -rw-r--r-- | server/src/main.cpp | 8 | ||||
| -rw-r--r-- | server/src/util/io.cpp | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/server/src/image/pe.h b/server/src/image/pe.h index fdd8a97..d1a78cc 100644 --- a/server/src/image/pe.h +++ b/server/src/image/pe.h @@ -114,6 +114,8 @@ class image { data.name = reinterpret_cast<const char *>(named_import->name); data.rva = table->rva_first_thunk + index; + std::transform(mod_name.begin(), mod_name.end(), mod_name.begin(), ::tolower); + m_imports[mod_name].emplace_back(std::move(data)); } } diff --git a/server/src/main.cpp b/server/src/main.cpp index 8db6f87..7f9d166 100644 --- a/server/src/main.cpp +++ b/server/src/main.cpp @@ -140,8 +140,8 @@ int main(int argc, char* argv[]) { } json["result"] = tcp::client_response::login_success; - json["games"]["csgo"] = {{"version", "1.2"}, {"id", 0}}; - json["games"]["csgo beta"] = {{"version", "1.2"}, {"id", 1}}; + json["games"]["csgo"] = {{"version", "1.2"}, {"id", 0}, {"process":"csgo.exe"}}; + json["games"]["csgo beta"] = {{"version", "1.2"}, {"id", 1}, {"process":"csgo.exe"}}; client.write(tcp::packet_t(json.dump(), tcp::packet_type::write, session, tcp::packet_id::login_resp)); @@ -237,7 +237,7 @@ int main(int argc, char* argv[]) { client.write(tcp::packet_t("ready", tcp::packet_type::write, session, tcp::packet_id::image)); - if(client.stream(image)) { + if(client.stream(image) == image.size()) { io::logger->info("sent image to {}.", client.username); } @@ -248,7 +248,7 @@ int main(int argc, char* argv[]) { // set client status or just drop them } - client.write(tcp::packet_t(message, tcp::packet_type::write, session)); + //client.write(tcp::packet_t(message, tcp::packet_type::write, session)); }); client_server.timeout_event.add([&](tcp::client& client) { diff --git a/server/src/util/io.cpp b/server/src/util/io.cpp index 8d74cd4..09dd6ce 100644 --- a/server/src/util/io.cpp +++ b/server/src/util/io.cpp @@ -23,7 +23,7 @@ void io::init(const bool& to_file) { } bool io::read_file(const std::string_view name, std::vector<char>& out) { - std::ifstream file(name.data()); + std::ifstream file(name.data(), std::ios::binary); if (!file.good()) { return false; } |