0

Using Il2CppDumper, I have dumped my files and am perusing the methods and their arguments using dnSpy. Some methods take string arguments like this one:

[Token(Token = "0x6000338")]
[Address(RVA = "0xE89871", Offset = "0xE88671", VA = "0x180E89871", Slot = "5")]
public Task<GameObject> SpawnPhoto(string photo)
{
    return null;
}

Hooking into this function using Minhook, I cannot simply intercept the function, and then modify the string like this before executing the function:

void(__fastcall* spawn_photo)(const char*);
void __stdcall spawn_photo_hook(const char* photo)
{
    photo = "some string";
    
    return spawn_photo(photo);
}

This causes the application to crash when the function is called. What is the minimal code that I need to construct an Il2Cpp string that I can pass to the function before executing it?

1
  • I have dumped my files .. are you sure these are your files? I would argue that in that case it would be easier to modify the method in the source code before compiling it ;) .. anyway this might point you into the right direction stackoverflow.com/q/67464201/7111561 .. I think you will rather want to go through Il2CppString* instead of a simple char* Commented Oct 15 at 5:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.