LunaHook-mirror/LunaHook/engines/lua/lua51.cpp
恍兮惚兮 dbee45b343 lua
2024-06-24 19:09:54 +08:00

20 lines
737 B
C++

#include"lua51.h"
bool lua51::attach_function() {
//[180330][TOUCHABLE] 想聖天使クロスエモーション外伝5 (認証回避済)
auto hlua51=GetModuleHandleW(L"lua5.1.dll");
if(hlua51==0)
hlua51=GetModuleHandleW(L"lua51.dll");
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;
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);
};
return NewHook(hp,"lua51");
}