本文仅供学习交流,严禁用于非法用途,拒绝转载,若有侵权请联系我删除!
加密跟踪
unidbg调用测试
import com.github.unidbg.AndroidEmulator;
import com.github.unidbg.Module;
import com.github.unidbg.linux.android.AndroidEmulatorBuilder;
import com.github.unidbg.linux.android.AndroidResolver;
import com.github.unidbg.linux.android.dvm.*;
import com.github.unidbg.memory.Memory;
import java.io.File;
public class Eid extends AbstractJni {
private final AndroidEmulator emulator;
private final VM vm;
private final Module module;
public static String pkgName = "com.jingdong.app.mall";
public static String apkPath = "src/main/resources/data/apks/jd/jd.apk";
public static String soPath = "src/main/resources/data/apks/jd/libbiometric.so";
private static final String APK_PATH = "/data/app/com.jingdong.app.mall.apk";
Eid() {
emulator = AndroidEmulatorBuilder.for32Bit().setProcessName(pkgName).build();
final Memory memory = emulator.getMemory();
memory.setLibraryResolver(new AndroidResolver(23));
vm = emulator.createDalvikVM(new File(apkPath));
DalvikModule dm = vm.loadLibrary(new File(soPath), false);
vm.setJni(this);
vm.setVerbose(true);
dm.callJNI_OnLoad(emulator);
module = dm.getModule();
}
public void callSign() {
DvmClass LoadDoor = vm.resolveClass("com/jdcn/risk/cpp/LoadDoor");
StringObject ret = LoadDoor.callStaticJniMethodObject(emulator, "getEid(Ljava/lang/Object;)Ljava/lang/String;",
vm.resolveClass("android/content/Context").newObject(null));
System.out.println(ret.getValue().substring(0, 116));
}
public static void main(String[] args) {
Eid test = new Eid();
test.callSign();
}
}
结果如下: