Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't find class System.AppDomain in assembly null #539

Open
logwlogw opened this issue Aug 17, 2024 · 9 comments
Open

Couldn't find class System.AppDomain in assembly null #539

logwlogw opened this issue Aug 17, 2024 · 9 comments
Labels
bug Something isn't working game specific Likely to be an issue related to a specific game needs triage This issue or pull request isn't verified yet

Comments

@logwlogw
Copy link

Hello,
I can't solve the problem.

-------------Code-------------
console.log(Il2Cpp.unityVersion);
console.log(Il2Cpp.domain.assemblies);
-------------Code-------------

Result:

2022.3.19f1
�[0m�[38;5;9mil2cpp�[0m: �[0mcouldn't find class System.AppDomain in assembly null�[3m�[2m
at class (/node_modules/frida-il2cpp-bridge/dist/index.js:2152)
at get object (/node_modules/frida-il2cpp-bridge/dist/index.js:1918)
at call (native)
at (/node_modules/frida-il2cpp-bridge/dist/index.js:67)
at get assemblies (/node_modules/frida-il2cpp-bridge/dist/index.js:1909)
at call (native)
at (/node_modules/frida-il2cpp-bridge/dist/index.js:67)
at (index.ts:11)
at perform (/node_modules/frida-il2cpp-bridge/dist/index.js:1058)�[0m

@logwlogw
Copy link
Author

logwlogw commented Aug 19, 2024

Also, couldn't find class System.Reflection.Module in assembly null

function Test() {
const AssemblySharp = Il2Cpp.domain.assembly("Assembly-CSharp").image;
var MainClass = AssemblySharp.class("ZXX.XX");

if (MainClass.parent != null)
{
    var method=MainClass.parent.methods[24];

    if (method != null)
    {
        method.implementation = function (p0: any, p1: any)
        {
        }
    }

}

}

il2cpp: couldn't find class System.Reflection.Module in assembly null
at class (/node_modules/frida-il2cpp-bridge/dist/index.js:2152)
at get virtualAddress (/node_modules/frida-il2cpp-bridge/dist/index.js:2334)
at set implementation (/node_modules/frida-il2cpp-bridge/dist/index.js:2371)
at Test (index.ts:80)
at (index.ts:39)
at perform (/node_modules/frida-il2cpp-bridge/dist/index.js:1058)

@logwlogw
Copy link
Author

logwlogw commented Aug 23, 2024

Main problem -violation accessing!

-------------Code-------------
console.log(Il2Cpp.unityVersion);
console.log(Il2Cpp.corlib.classes.length);
console.log(Il2Cpp.corlib.classes[0].name);
-------------Code-------------

2022.3.19f1
1750
Error: access violation accessing 0x10
at get name (/node_modules/frida-il2cpp-bridge/dist/index.js:1653)
at call (native)
at (/node_modules/frida-il2cpp-bridge/dist/index.js:67)
at (index.ts:23)
at perform (/node_modules/frida-il2cpp-bridge/dist/index.js:1058)

@vfsfitvnm
Copy link
Owner

Interesting. What's your platform and app name? So that I can take a look

@vfsfitvnm vfsfitvnm added bug Something isn't working game specific Likely to be an issue related to a specific game needs triage This issue or pull request isn't verified yet labels Aug 24, 2024
@vfsfitvnm vfsfitvnm changed the title il2cpp: couldn't find class System.AppDomain in assembly null Couldn't find class System.AppDomain in assembly null Aug 24, 2024
@logwlogw
Copy link
Author

logwlogw commented Aug 24, 2024

app standoff2, ldplayer
It worked in previous standoff2 versions, apparently some kind of protection
Thank you

@namtacs
Copy link

namtacs commented Sep 10, 2024

It looks like il2cpp.so is heavily modified. Calling .classes on any assembly gives:

{
    "handle": "0x0"
},

6363 times
And while you can't find AppDomain, you can find String? This is madness.

@namtacs
Copy link

namtacs commented Sep 11, 2024

Big find. They somehow stripped all exports that aren't actually used for the game.
How it should look like:
Screenshot from 2024-09-11 19-44-23
Stripped methods:
Screenshot from 2024-09-11 19-44-00
And it's not just these.
Patching the assembly is, of course, not an option.
I guess this is just like #300 and you need to match signatures yourself (i tested and it works).

@logwlogw
Copy link
Author

logwlogw commented Sep 13, 2024

Thank you. So far I have solved my problem simply using ghidra+frida Interceptor.attach without frida-il2cpp-bridge :(

@namtacs
Copy link

namtacs commented Sep 13, 2024

а ты читы делаешь или просто поиграться?

@vfsfitvnm
Copy link
Owner

Thank you guys for the update.

As a gentle reminder, you can provide different handles to the IL2CPP exports using the global variable IL2CPP_EXPORTS (reference) so that you can still use frida-il2cpp-bridge if exports are elided.

However, no automatic IL2CPP exports detection is currently implemented, unfortunately. Signature pattern matching is a big feature that I'd be glad to implement in the future.

As of now, I could simply raise an meaningful error in case the export handle is NULL 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working game specific Likely to be an issue related to a specific game needs triage This issue or pull request isn't verified yet
Projects
None yet
Development

No branches or pull requests

3 participants