逆向教程 unidbg调用so中函数完成签名

unidbg可以直接调用app中的so函数,可以不使用模拟器和frida的组合.因此可以节约很多资源,并且部署到服务器中,下面是执行代码,分别对应源码中的add,md5,encode函数

源码

package com.xiaojianbang.ndk;

public class NativeHelper {
    public static native int add(int a, int b, int c);

    public static native String encode();

    public static native String md5(String str);

    public static native void readSomething();

    static {
        System.loadLibrary("xiaojianbang");
    }
}

unidbg代码

 int call_add() {

        int result = NativeHelperUtils.callStaticJniMethodInt(emulator, "add(III)I", 0x1, 0x2,0x3); // 执行Jni方法
        return result;
    }
    //这里报错,上面使用vm.setJni(new AbstractJni() {}); 解决
     String call_md5(String str){
       StringObject result =NativeHelperUtils.callStaticJniMethodObject(emulator, "md5(Ljava/lang/String;)Ljava/lang/String;", str);
       return result.getValue();
    }
    //报错,没有找到encode()Ljava/lang/String;
    //原因是原始代码里没有注册encode()方法
    //动态注册在导出表里找不到对应函数名
    String call_encode(){
        StringObject result =NativeHelperUtils.callStaticJniMethodObject(emulator, "encode()Ljava/lang/String;");
        return result.getValue();
    }
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值