File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 88#define KCD2_ENV_IMPORT
99#include " db/Database.h"
1010#include " kcd2/env.h"
11- #include " kcd2/IConsole.h"
1211#include " log/log.h"
1312#include " lua/db.h"
1413
15-
1614std::optional<uintptr_t > find_env_addr ()
1715{
1816 lm_module_t module ;
@@ -22,8 +20,8 @@ std::optional<uintptr_t> find_env_addr()
2220 {
2321 std::this_thread::sleep_for (std::chrono::milliseconds (100 ));
2422 }
25-
26- const auto pattern = " 48 8B 0D ?? ?? ?? ?? 48 8D 15 ?? ?? ?? ?? 45 33 C9 45 33 C0 4C 8B 11 41 FF 92 ?? ?? ?? ?? 48 85 FF " ;
23+ // 通常会找到两个地址,不过两个地址其实通过RIP之后的偏移是一样的,都是指向 gEnv->pConsole 的 qword_1848A7C68
24+ const auto pattern = " 48 8B 0D ?? ?? ?? ?? 48 8D 15 ?? ?? ?? ?? 45 33 C9 45 33 C0 4C 8B 11" ;
2725 const auto scan_address = LM_SigScan (pattern, module .base , module .size );
2826 if (!scan_address)
2927 {
You can’t perform that action at this time.
0 commit comments