From 3b9fcb668e14435083d8993005203af10e19c2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:19:37 +0800 Subject: [PATCH] tr --- LunaHook/engine32/TeethingRing.cpp | 40 +++++++++++++++++++++++++++++- LunaHook/engine32/TeethingRing.h | 2 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/LunaHook/engine32/TeethingRing.cpp b/LunaHook/engine32/TeethingRing.cpp index 94e3a0f..4e51020 100644 --- a/LunaHook/engine32/TeethingRing.cpp +++ b/LunaHook/engine32/TeethingRing.cpp @@ -1,6 +1,6 @@ #include "TeethingRing.h" -bool TeethingRing::attach_function() +bool TeethingRing_attach_function() { // https://vndb.org/v5635 // キミとボクとエデンの林檎 @@ -54,4 +54,42 @@ bool TeethingRing::attach_function() return write_string_overwrite(data,len,str); }; return NewHook(hp, "TeethingRing"); +} + + +bool TeethingRing_attach_function2() +{ + HookParam hp; + hp.address = 0x409A00;//0x84C70+(DWORD)GetModuleHandle(0); + hp.type=USING_STRING|NO_CONTEXT|FULL_STRING; + hp.text_fun = [](hook_stack *stack, HookParam *hp, uintptr_t *data, uintptr_t *split, size_t *len) + { + auto _this=(DWORD*)stack->THISCALLTHIS; + auto v13 = _this[6]; + auto v14 = _this + 1; + DWORD* v16; + if ( v13 < 0x10 ) + v16 = _this + 1; + else + v16 = (DWORD *)*v14; + auto a2=stack->ARG1; + *data=(DWORD)v16+a2; + *len=strlen((char*)*data); + *split=(DWORD)_this; + }; + hp.filter_fun=[](void* data, size_t* len, HookParam* hp){ + if(all_ascii((char*)data,*len))return false; + auto str=std::string((char*)data,*len); + strReplace(str,"#F",""); + //俺はこのアクシデントが、何か幸#<さい>先#<さき>のいいもののように思えて、鞄を抱え直してギルドへの階段を昇り始めた。 + str = std::regex_replace(str, std::regex("#<(.*?)>"), ""); + return write_string_overwrite(data,len,str); + }; + return NewHook(hp, "TeethingRing"); +} + + +bool TeethingRing::attach_function() +{ + return TeethingRing_attach_function()||TeethingRing_attach_function2(); } \ No newline at end of file diff --git a/LunaHook/engine32/TeethingRing.h b/LunaHook/engine32/TeethingRing.h index d52512d..3ab4d5d 100644 --- a/LunaHook/engine32/TeethingRing.h +++ b/LunaHook/engine32/TeethingRing.h @@ -3,7 +3,7 @@ class TeethingRing:public ENGINE{ public: TeethingRing(){ - + is_engine_certain=false; check_by=CHECK_BY::RESOURCE_STR; check_by_target=L"TeethingRing"; };