diff options
| author | boris <wzn@moneybot.cc> | 2018-12-12 12:30:44 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-12 12:30:44 +1300 |
| commit | ec4ad61acbe9e67c5e803e0549841dc5ef5cef2a (patch) | |
| tree | f30480f8c0e45b0cd2e0c5cd2f2dbccd54ec70ae /loader/server/manual_map.hpp | |
| parent | a25b6f6b11a3ae44d0c3b19ba8081a3d9eb1ac5f (diff) | |
yas
Diffstat (limited to 'loader/server/manual_map.hpp')
| -rw-r--r-- | loader/server/manual_map.hpp | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/loader/server/manual_map.hpp b/loader/server/manual_map.hpp deleted file mode 100644 index 34159da..0000000 --- a/loader/server/manual_map.hpp +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once
-
-// TODO: get stripped down version of what we need and shove it in here
-#include <windows.h>
-
-#include <cstdint>
-#include <cstdio>
-#include <fstream>
-#include <iterator>
-#include <vector>
-
-#include "fnv.hpp"
-
-// here's the game plan:
-// - client runs, waits for game to start and whatnot
-// - we wait for serverbrowser.dll to load (if source game, we should have an option in the game struct to wait for module)
-// - client walks peb of process, dumps exports and packs them into { fnv, addy }, sends to server
-// - server sends module size, client allocates and replies back with module address
-// - server resolves imports through { fnv, addy } that were networked to us
-// - server fixes reloc
-// - we send back addy, then section data to client
-// - server packs shellcode with data from client, sends to client
-// - client runs shellcode, we're injected
-namespace inject {
- // used as generic wrapper for pe, tells client how much to allocate, etc.
- class c_pe_file {
- protected:
- std::vector< uint8_t > m_file;
- public:
- c_pe_file() = default;
- c_pe_file(const char *file);
- bool valid();
- uint8_t *data();
- size_t size() const;
- };
-
- // used for fixing imports
- struct process_export_t {
- uint32_t m_hash;
- uint32_t m_ordinal;
- uint32_t m_address;
- };
-
- // used for writing memory in client
- struct memory_page_t {
- uint32_t m_address;
- uint32_t m_protection;
- };
-
- // container for sections
- using byte_array_t = std::vector<uint8_t>;
- using memory_section_t = std::pair<memory_page_t, byte_array_t>;
-
- // used as server wrapper for the manual mapper
- class c_mapper {
- protected:
- std::vector<process_export_t> m_exports;
- std::vector<memory_section_t> m_sections;
-
- c_pe_file m_pe;
-
- private:
- bool process_reloc(uint32_t remote_address);
- bool process_imports(uint32_t remote_address);
-
- public:
- c_mapper() = default;
- c_mapper(c_pe_file &pe_file);
-
- // returns size of module to allocate on client
- size_t initialise(std::vector<process_export_t> &exports);
-
- // handles reloc and fixing imports
- bool process_pe_file(uint32_t remote_address);
-
- // returns all sections
- std::vector<memory_section_t> get_pe_sections();
- };
-}
\ No newline at end of file |
