LunaHook-mirror/LunaHook/engines/lua/lua51.cpp

20 lines
737 B
C++
Raw Normal View History

2024-02-07 20:59:24 +08:00
#include"lua51.h"
bool lua51::attach_function() {
//[180330][TOUCHABLE] 想聖天使クロスエモーション外伝5 (認証回避済)
auto hlua51=GetModuleHandleW(L"lua5.1.dll");
2024-06-24 19:04:59 +08:00
if(hlua51==0)
hlua51=GetModuleHandleW(L"lua51.dll");
2024-02-07 20:59:24 +08:00
if(hlua51==0)return false;
auto lua_pushstring=GetProcAddress(hlua51,"lua_pushstring");
if(lua_pushstring==0)return false;
HookParam hp;
hp.address =(uintptr_t) lua_pushstring;
hp.type = CODEC_UTF8 | USING_STRING;
2024-06-24 19:04:59 +08:00
hp.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){
*data=stack->ARG2;
*len=strlen((char*)*data);
*split=all_ascii((char*)*data,*len);
};
2024-02-07 20:59:24 +08:00
return NewHook(hp,"lua51");
}