mirror of
https://git.chinosk6.cn/chinosk/gkms-localify-dmm.git
synced 2026-07-01 14:02:58 +07:00
fixed wide string adapt
This commit is contained in:
@@ -1512,6 +1512,13 @@ public:
|
|||||||
if (mode_ == Mode::Il2Cpp) return UnityResolve::Invoke<String*, const char*>("il2cpp_string_new", str.c_str());
|
if (mode_ == Mode::Il2Cpp) return UnityResolve::Invoke<String*, const char*>("il2cpp_string_new", str.c_str());
|
||||||
return UnityResolve::Invoke<String*, void*, const char*>("mono_string_new", UnityResolve::Invoke<void*>("mono_get_root_domain"), str.c_str());
|
return UnityResolve::Invoke<String*, void*, const char*>("mono_string_new", UnityResolve::Invoke<void*>("mono_get_root_domain"), str.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static auto New(const std::wstring& str) -> String* {
|
||||||
|
auto len = static_cast<int32_t>(str.length());
|
||||||
|
|
||||||
|
if (mode_ == Mode::Il2Cpp) return UnityResolve::Invoke<String*, const wchar_t*, int32_t>("il2cpp_string_new_utf16", str.c_str(), len);
|
||||||
|
return UnityResolve::Invoke<String*, void*, const wchar_t*, int32_t>("mono_string_new_utf16", UnityResolve::Invoke<void*>("mono_get_root_domain"), str.c_str(), len);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ namespace GakumasLocal::WinHooks {
|
|||||||
|
|
||||||
void* LoadAssetBundle(const std::string& path) {
|
void* LoadAssetBundle(const std::string& path) {
|
||||||
std::filesystem::path abs_path = std::filesystem::absolute(path).lexically_normal();
|
std::filesystem::path abs_path = std::filesystem::absolute(path).lexically_normal();
|
||||||
Il2cppString* bundlePath = Il2cppString::New(abs_path.string());
|
Il2cppString* bundlePath = Il2cppString::New(abs_path.wstring());
|
||||||
|
|
||||||
static auto LoadFromFileAsync = Il2cppUtils::GetMethod("UnityEngine.AssetBundleModule.dll", "UnityEngine", "AssetBundle", "LoadFromFileAsync");
|
static auto LoadFromFileAsync = Il2cppUtils::GetMethod("UnityEngine.AssetBundleModule.dll", "UnityEngine", "AssetBundle", "LoadFromFileAsync");
|
||||||
static auto get_assetBundle = Il2cppUtils::GetMethod("UnityEngine.AssetBundleModule.dll", "UnityEngine", "AssetBundleCreateRequest", "get_assetBundle");
|
static auto get_assetBundle = Il2cppUtils::GetMethod("UnityEngine.AssetBundleModule.dll", "UnityEngine", "AssetBundleCreateRequest", "get_assetBundle");
|
||||||
|
|||||||
Reference in New Issue
Block a user