mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-10-22 23:18:16 +08:00
jf
This commit is contained in:
parent
d420d175f7
commit
d30a9cfbd8
@ -41,7 +41,7 @@ class CaramelBox2:public ENGINE{
|
||||
|
||||
check_by=CHECK_BY::CUSTOM;
|
||||
check_by_target=[](){
|
||||
if(!Util::CheckFile(L"*.mpg"))return true;
|
||||
if(!Util::CheckFile(L"*.mpg"))return false;
|
||||
char copyright[]="OTOBOKU-CaramelBox";//OTOBOKU-CaramelBox //Software\Caramel-Box\OTOMEHABOKUNIKOISHITERU
|
||||
return 0!=MemDbg::findBytes(copyright,sizeof(copyright),processStartAddress,min(processStopAddress,processStartAddress+0x200000));
|
||||
};
|
||||
|
@ -30,8 +30,47 @@ bool Jellyfish_attach_function() {
|
||||
return write_string_overwrite(data,size,std::regex_replace(std::string(reinterpret_cast<char*>(data),*size), std::regex("\\\\[0-7a-zA-Z]"), ""));
|
||||
};
|
||||
|
||||
return NewHook(hp, "Jellyfish");
|
||||
}
|
||||
|
||||
bool Jellyfish_attach_function2() {
|
||||
//https://vndb.org/r109826
|
||||
//Sisters: Last Day of Summer
|
||||
|
||||
|
||||
auto ism=GetModuleHandle(L"ism.dll");
|
||||
if(ism==0)return false;
|
||||
auto [minaddr,maxaddr]=Util::QueryModuleLimits(ism);
|
||||
const BYTE bytes[] = {
|
||||
0x68,0xB0,0x04,0x00,0x00,0x68,0x40,0x06,0x00,0x00
|
||||
};
|
||||
std::map<DWORD,int>count;
|
||||
DWORD maxa=0;int maxi=0;
|
||||
for(auto _:Util::SearchMemory(bytes,sizeof(bytes),PAGE_EXECUTE,minaddr,maxaddr)){
|
||||
_ = findfuncstart(_);
|
||||
if(_==0)continue;
|
||||
if(count.find(_)==count.end())
|
||||
count[_]=0;
|
||||
count[_]+=1;
|
||||
if(count[_]>=maxi){
|
||||
maxi=count[_];
|
||||
maxa=_;
|
||||
}
|
||||
}
|
||||
if (maxa == 0)return false;
|
||||
HookParam hp;
|
||||
hp.address = maxa;//0x2F2E1+(DWORD)ism;
|
||||
hp.type =USING_CHAR|CODEC_UTF16;
|
||||
hp.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){
|
||||
if(stack->ARG3==3)return;
|
||||
*split=(stack->ARG3)!=0;//多行文本
|
||||
*data=stack->ARG1;
|
||||
*len=2;
|
||||
//不可以快进,否则会有重复
|
||||
};
|
||||
|
||||
return NewHook(hp, "Jellyfish");
|
||||
}
|
||||
bool Jellyfish::attach_function(){
|
||||
return Jellyfish_attach_function();
|
||||
return Jellyfish_attach_function()||Jellyfish_attach_function2();
|
||||
}
|
@ -4,8 +4,9 @@ class Jellyfish:public ENGINE{
|
||||
public:
|
||||
Jellyfish(){
|
||||
|
||||
is_engine_certain=false;
|
||||
check_by=CHECK_BY::FILE_ALL;
|
||||
check_by_target=check_by_list{L"ism.dll",L"data.isa"};
|
||||
check_by_target=check_by_list{L"ism.dll"};//,L"data.isa"};
|
||||
};
|
||||
bool attach_function();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user