Tutorial How to modify Unity's Il2cpp String method's

ini membuat game saya crash? apakah yg salah??

C++:
monoString *(*String_CreateString)(void *instance, const char *str);


monoString* (*old_getLanguage)(void *instance);
monoString* get_String(void *instance) {
    if(instance != NULL && editText) {
    
      
   return String_CreateString(instance, "JP");
  
    
    }
    return old_getLanguage(instance);
}


[CODE]A64HookFunction((void *)getAbsoluteAddress(targetLibName, 0x9FF3D4), (void *)get_String, (void **)&old_getLanguage);

String_CreateString = (monoString*(*)(void *,const char *))getAbsoluteAddress(targetLibName, 0x14EE690);[/CODE]
 
ini membuat game saya crash? apakah yg salah??

C++:
monoString *(*String_CreateString)(void *instance, const char *str);


monoString* (*old_getLanguage)(void *instance);
monoString* get_String(void *instance) {
    if(instance != NULL && editText) {
   
     
   return String_CreateString(instance, "JP");
 
   
    }
    return old_getLanguage(instance);
}


[CODE]A64HookFunction((void *)getAbsoluteAddress(targetLibName, 0x9FF3D4), (void *)get_String, (void **)&old_getLanguage);

String_CreateString = (monoString*(*)(void *,const char *))getAbsoluteAddress(targetLibName, 0x14EE690);[/CODE]
This is an error you have to fix yourselves. You have to configure and change the files more. I suggest using LGL's latest template or another mod menu that is simple and plain
 
Ini adalah kesalahan yang harus Anda perbaiki sendiri. Anda harus mengonfigurasi dan mengubah file lebih banyak. Saya sarankan menggunakan template terbaru LGL atau menu mod lain yang sederhana dan polos
[/MENGUTIP]
finally i fixed it and it works
 
Hey i just found CreateString on //RVA
C++:
private string CreateString(sbyte* value) { }
Is that can be use? Is not void, the others not similar.
Btw the game can't create name, just picking of list names
 
Hey i just found CreateString on //RVA
C++:
private string CreateString(sbyte* value) { }
Is that can be use? Is not void, the others not similar.
Btw the game can't create name, just picking of list names
Yes, use it then declare a pointer in ur main and include the header
 
first of all sorry for the bad english

I added the mono String files given above to my project.
I hooked creatString from libil2cpp.so file with MSHookFunction

when i run the code the first char is null.
then second char and null again and then 3rd char and null again.
it goes this way.

I am working on armv7 (32 bit).

what could be the cause of the problem


//sample;
monoString * mName;
myName = createString("MYNAME");

char[] mResult="MyResult123456789")
for(int i=0; i<mName->getLengt(); i++){
char j=mName->getChars;
if(j==NULL)
j="n";
mResult=j;
}
printf(mResult)

result= nYnNnAnMnE;
 

Attachments

  • 1654469320017.png
    1654469320017.png
    326 bytes · Views: 129
How to hooking this bro? please help me


C++:
// Namespace:
public class CustomizeViewController : MonoBehaviour // TypeDefIndex: 7985
{
    // Fields
        private string skinID; // 0x18


    // RVA: 0x6A987C Offset: 0x6A987C VA: 0x6A987C
    public void OnSkinUseButton() { }
 
Thanks a lot, but I can't find CreateString in Polywars. All of the methods have return type of string, not public void. Could you help me find this method?
 
Nevermind i found a fix.

and what is the fix?

C++:
    // RVA: 0x2CDD134 Offset: 0x2CDD134 VA: 0x2CDD134
    private string CreateString(sbyte* value, int startIndex, int length) { }

    // RVA: 0x2CDEC74 Offset: 0x2CDEC74 VA: 0x2CDEC74
    private string CreateString(char* value, int startIndex, int length) { }

    // RVA: 0x2CDEC84 Offset: 0x2CDEC84 VA: 0x2CDEC84
    private string CreateString(char[] val, int startIndex, int length) { }

    // RVA: 0x2CD3458 Offset: 0x2CD3458 VA: 0x2CD3458
    private string CreateString(char[] val) { }

    // RVA: 0x2CDEC94 Offset: 0x2CDEC94 VA: 0x2CDEC94
    private string CreateString(char c, int count) { }

    // RVA: 0x2CDECA0 Offset: 0x2CDECA0 VA: 0x2CDECA0
    private string CreateString(sbyte* value, int startIndex, int length, Encoding enc) { }
 
How to hook this

// RVA: 0x39072C Offset: 0x39072C VA: 0x39072C
private void SpawnObj(string _name, Vector3 _pos, Vector3 _rot, Vector3 _scale, int _ID, string _customData, bool _duplicated) { }
 
Спасибо, задавайте мне любые вопросы, касающиеся только этой темы. Я буду здесь, если вам что-то понадобится.
Я уже перепробовал кучу способов, ошибка та же.
 

Attachments

  • Screenshot_2024-08-27-01-43-50-804_com.aide.clone.jpg
    Screenshot_2024-08-27-01-43-50-804_com.aide.clone.jpg
    104.2 KB · Views: 58
Back
Top Bottom