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

do_matchV2_byDataDecryptCommand_model.js fix #28

Open
taotao5 opened this issue Oct 13, 2024 · 1 comment
Open

do_matchV2_byDataDecryptCommand_model.js fix #28

taotao5 opened this issue Oct 13, 2024 · 1 comment

Comments

@taotao5
Copy link

taotao5 commented Oct 13, 2024

解决:
var decrypted = R2Class["b"](decoded);
应修改为
var decrypted = R2Class["a"](decoded);

@Nullable
    public final byte[] a(@Nullable byte[] data) throws IOException {
        boolean z11;
        if (data != null) {
            if (data.length == 0) {
                z11 = true;
            } else {
                z11 = false;
            }
            if (!z11) {
                return kotlin.io.a.c(new GZIPInputStream(new ByteArrayInputStream(c(data))));
            }
            return null;
        }
        return null;
    }

hook kotlin.io.a.c方法可获得解密后的答题数据

Java.perform(function () {
    // 获取 'kotlin.io.a' 类
    var aClass = Java.use('kotlin.io.a');

    // 获取 Java 的 String 类,便于处理 UTF-8 编码
    var StringClass = Java.use('java.lang.String');

    // Hook 静态方法 c(InputStream inputStream)
    aClass.c.overload('java.io.InputStream').implementation = function (inputStream) {
        // 打印传入的 InputStream 对象
        console.log("InputStream passed to c()");

        // 调用原始的静态方法 c
        var result = this.c(inputStream);

        // 将返回的 byte[] 转换为 UTF-8 编码的字符串
        if (result !== null) {
            var utf8String = Java.use('java.lang.String').$new(result, 'UTF-8');
            console.log("Result from c() as UTF-8 string: " + utf8String);
        } else {
            console.log("Result from c() is null.");
        }

        return result; // 返回原始结果
    };
});

@xmexg

@xmexg
Copy link
Owner

xmexg commented Oct 14, 2024

非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants