Code Monkey home page Code Monkey logo

Comments (3)

Austin1 avatar Austin1 commented on September 2, 2024 1

I did some more digging and I'm not a developer so this is me trying to understand something that I dont,

Appears that something around here is causing the issue:

locals_line_bit = text[idx + 1].split(".locals ")

I had CHATGPT try to analyze this and it said this might work. I dont have time to figure out how to fork/modify/compile and run this, so figured I'd share here in case someone could help and validate that the error is not user error and that the injection can be modified somehow to work?

for entrypoint in entrypoints:
    idx = 0
    while idx != len(text):
        line = text[idx].strip()
        if line.startswith('.method') and entrypoint in line:
            if ".locals " in text[idx + 1]:
                locals_line_bit = text[idx + 1].split(".locals ")
                if len(locals_line_bit) > 1:
                    try:
                        locals_variable_count = min(int(locals_line_bit[1]), 15)
                        locals_line_bit[1] = str(locals_variable_count + 1)
                        if load_library_name.startswith('lib'):
                            load_library_name = load_library_name[3:]
                        text[idx + 1] = ".locals ".join(locals_line_bit)
                        text.insert(idx + 2,
                                    f"    invoke-static {{v{locals_variable_count}}}, "
                                    "Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V")
                        text.insert(idx + 2,
                                    f"    const-string v{locals_variable_count}, "
                                    f"\"{load_library_name}\"")
                        status = True
                    except ValueError:
                        # Handle the case where conversion to int fails
                        pass
                break
            idx += 1

Here is the decompiled code that it seems to be trying to inject into, if helpful context:

package crc642612969569d7a084;

import android.os.Bundle;
import java.util.ArrayList;
import mono.android.IGCUserPeer;
import mono.android.Runtime;
import mono.android.TypeManager;

/* loaded from: classes.dex */
public class WelcomeActivity extends SussmanActivity implements IGCUserPeer {
    public static final String __md_methods = "n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\nn_onResume:()V:GetOnResumeHandler\n";
    private ArrayList refList;

    private native void n_onCreate(Bundle bundle);

    private native void n_onResume();

    static {
        Runtime.register("Sussman.Droid.WelcomeActivity, Sussman.Droid", WelcomeActivity.class, __md_methods);
    }

    public WelcomeActivity() {
        if (getClass() == WelcomeActivity.class) {
            TypeManager.Activate("Sussman.Droid.WelcomeActivity, Sussman.Droid", "", this, new Object[0]);
        }
    }

    public WelcomeActivity(int i) {
        super(i);
        if (getClass() == WelcomeActivity.class) {
            TypeManager.Activate("Sussman.Droid.WelcomeActivity, Sussman.Droid", "System.Int32, mscorlib", this, new Object[]{Integer.valueOf(i)});
        }
    }

    @Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
    public void onCreate(Bundle bundle) {
        n_onCreate(bundle);
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onResume() {
        n_onResume();
    }

    @Override // crc642612969569d7a084.SussmanActivity, mono.android.IGCUserPeer
    public void monodroidAddReference(Object obj) {
        if (this.refList == null) {
            this.refList = new ArrayList();
        }
        this.refList.add(obj);
    }

    @Override // crc642612969569d7a084.SussmanActivity, mono.android.IGCUserPeer
    public void monodroidClearReferences() {
        ArrayList arrayList = this.refList;
        if (arrayList != null) {
            arrayList.clear();
        }
    }
}

from frida-gadget.

Austin1 avatar Austin1 commented on September 2, 2024

APK i'm trying to figure out how it interfaces with a Steam Generator in my home. https://m.apkpure.com/mrsteam-steamlinx-mobile-app/com.geckoportal.mrsteam

from frida-gadget.

ksg97031 avatar ksg97031 commented on September 2, 2024

@Austin1
Thanks for providing detailed bug reports! 👍
I fixed the issue and deployed version 1.3.5 now.
Kindly update to the latest version and verify its functionality:
pip install frida-gadget --upgrade

from frida-gadget.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.