I am using JNI to call function from Java. Then, java will return a jstring. I still not know how to convert jstring back to std:string to use in C++
One more thing here is my example code:
std::string valueAttriButeConverted = "\x64\x90\xa0\xe3";
my_cool_Patches.temp= MemoryPatch("il2cpp.so", 0x19E7CD0,
&valueAttriButeConverted, 4);
my_cool_Patches.temp.Modify();
I Used LGL Mod menu to make mod menu for game. It used KittyMemory. In MemoryPatch, the 3rd argument must be a void*.
After running that code, memory will be patched with these bytes: "08 64 90 a0"
, instead of "64 90 a0 e3"
. I do not know why and where is the byte "08"
. Please help me correct it.
Here is code which will run perfectly:
my_cool_Patches.temp= MemoryPatch("il2cpp.so", 0x19E7CD0,
"\x64\x90\xa0\xe3", 4);
my_cool_Patches.temp.Modify();
But if i change the String to variable, it will be wrong value.
And I want to make the custom value which run in runtime, let user choose the value and then convert to hex and put to MemoryPatch.
For now, JNI call java and return jstring perfectly.
Thanks and Regards,