This commit is contained in:
HolographicHat
2024-04-29 14:38:13 +08:00
parent faee6f6121
commit 520167ef85
11 changed files with 33 additions and 89 deletions

View File

@@ -12,24 +12,12 @@ VOID DisableVMProtect() {
VirtualProtect(pNtProtectVirtualMemory, 1, old, &old);
}
#pragma region StringConvert
string ToString(Il2CppString* str, UINT codePage) {
auto chars = reinterpret_cast<const wchar_t*>(str->chars);
auto len = WideCharToMultiByte(codePage, 0, chars, -1, nullptr, 0, nullptr, nullptr);
auto buffer = new char[len];
WideCharToMultiByte(codePage, 0, chars, -1, buffer, len, nullptr, nullptr);
return string(buffer);
}
#pragma endregion
#pragma region ByteUtils
bool IsLittleEndian() {
UINT i = 1;
char* c = (char*)&i;
return (*c);
return *c;
}
#pragma endregion