mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-12-27 05:34:14 +08:00
18 lines
456 B
C++
18 lines
456 B
C++
#include"Suika2.h"
|
|
|
|
bool Suika2_msvcrt() {
|
|
auto msvcrt=GetModuleHandle(L"msvcrt.dll");
|
|
if(msvcrt==0)return 0;
|
|
auto _strdup=GetProcAddress(msvcrt,"_strdup");
|
|
if(_strdup==0)return 0;
|
|
HookParam hp;
|
|
hp.address=(uintptr_t)_strdup;
|
|
hp.type=USING_STRING|CODEC_UTF8;
|
|
hp.offset=get_reg(regs::rcx);
|
|
return NewHook(hp,"Suika2_msvcrt");
|
|
|
|
}
|
|
bool Suika2::attach_function() {
|
|
auto _1=Suika2_msvcrt();
|
|
return _1 ;
|
|
} |