From a0d35c1d5e7d2a9f61aad013d601a0fe66f4a90d Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Sat, 9 Apr 2022 00:31:10 -0700 Subject: [PATCH] i need to rewrite how i get routine bytes since each funtion doesnt nesscarly get its own section... --- src/tests/demo/main.cpp | 2 ++ src/theo/theo.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/tests/demo/main.cpp b/src/tests/demo/main.cpp index 66f13a8..579a091 100644 --- a/src/tests/demo/main.cpp +++ b/src/tests/demo/main.cpp @@ -66,7 +66,9 @@ int main(int argc, char* argv[]) { spdlog::info("decomposed {} symbols...", res.value()); auto entry_pnt = t.compose(); + auto winproc = t.resolve("?GetIO@ImGui@@YAAEAUImGuiIO@@XZ"); spdlog::info("entry point address: {:X}", entry_pnt); + spdlog::info("?GetIO@ImGui@@YAAEAUImGuiIO@@XZ: {:X}", winproc); std::getchar(); reinterpret_cast(entry_pnt)(); } \ No newline at end of file diff --git a/src/theo/theo.cpp b/src/theo/theo.cpp index 97d7a30..e5fc55d 100644 --- a/src/theo/theo.cpp +++ b/src/theo/theo.cpp @@ -46,4 +46,10 @@ std::uintptr_t theo_t::compose() { m_recmp.copy_syms(); return m_recmp.resolve(m_entry_sym.data()); } + +std::uintptr_t theo_t::resolve(const std::string&& sym) { + return m_sym_tbl.sym_from_hash(decomp::symbol_t::hash(sym)) + .value() + ->allocated_at(); +} } // namespace theo \ No newline at end of file