mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-30 17:15:38 +08:00
fix
This commit is contained in:
parent
1c60d6c4cc
commit
7c7fbd45c7
@ -26,9 +26,10 @@ void commonsolvemonostring(uintptr_t offset,uintptr_t *data, size_t*len){
|
|||||||
auto sw_v=sw.value();
|
auto sw_v=sw.value();
|
||||||
*data=(uintptr_t)sw_v.data();
|
*data=(uintptr_t)sw_v.data();
|
||||||
*len=sw_v.length()*sizeof(wchar_t);
|
*len=sw_v.length()*sizeof(wchar_t);
|
||||||
//tostring|substring有时会会崩,非法指针或者长度爆炸
|
if(*len>TEXT_BUFFER_SIZE){
|
||||||
if(wcslen(sw_v.data())!=sw_v.size())
|
|
||||||
*len=0;
|
*len=0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void unity_ui_string_hook_after(uintptr_t *offset,void* data, size_t len)
|
void unity_ui_string_hook_after(uintptr_t *offset,void* data, size_t len)
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
enum { TEXT_BUFFER_SIZE = PIPE_BUFFER_SIZE - sizeof(TextOutput_T) };
|
enum { TEXT_BUFFER_SIZE = PIPE_BUFFER_SIZE - sizeof(TextOutput_T) };
|
||||||
|
|
||||||
#define wcslen(XX) wcsnlen((XX), TEXT_BUFFER_SIZE*2)
|
//#define wcslen(XX) wcsnlen((XX), TEXT_BUFFER_SIZE*2)
|
||||||
#define strlen(XX) strnlen((XX), TEXT_BUFFER_SIZE*2)
|
//#define strlen(XX) strnlen((XX), TEXT_BUFFER_SIZE*2)
|
||||||
|
|
||||||
|
|
||||||
#include"main.h"
|
#include"main.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user