LunaHook-mirror/LunaHook/engine64/5pb.cpp

29 lines
940 B
C++
Raw Normal View History

2024-02-07 20:59:24 +08:00
#include"5pb.h"
2024-03-21 17:57:04 +08:00
#include"mages/mages.h"
2024-05-24 19:07:16 +08:00
namespace{
//https://vndb.org/v46553
//新宿葬命
bool _strncat(){
HookParam hp;
hp.address=(uintptr_t)GetProcAddress(GetModuleHandleA("ucrtbase.dll"),"strncat");
hp.type=USING_STRING|CODEC_UTF8|NO_CONTEXT;
hp.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){
*data=stack->ARG2;
*len=stack->ARG3;
*split=stack->ARG1;
};
hp.filter_fun=[](void* data, size_t* len, HookParam* hp){
auto s=std::string((char*)data,*len);
strReplace(s,"%N","\n");
//sub_140096E80
//%I %B %C %R( %Z %%
return write_string_overwrite(data,len,s);
};
return NewHook(hp,"strncat");
}
}
2024-02-07 20:59:24 +08:00
bool _5pb::attach_function() {
//CHAOS;HEAD_NOAH
2024-03-21 17:57:04 +08:00
bool b3=hookmages::MAGES();
2024-05-24 19:07:16 +08:00
return b3||_strncat();
}