1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| package demo;
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 che extends AbstractJni { public static AndroidEmulator emulator; public static Memory memory; public static VM vm; public static DalvikModule dm; public static Module module;
public static final String processName = "com.che168.autotradercloud"; public static final String fileName = "unidbg-android/apks/che/atc241.apk"; public static final String libName = "unidbg-android/apks/che/libnative-lib.so";
che() {
emulator = AndroidEmulatorBuilder.for32Bit().setProcessName(getClass().getSimpleName()).build();
memory = emulator.getMemory();
memory.setLibraryResolver(new AndroidResolver(23));
vm = emulator.createDalvikVM(new File(fileName)); vm.setJni(this);
DalvikModule dm = vm.loadLibrary(new File(libName), false);
module = dm.getModule();
}
public static void main(String[] args) { che obj = new che(); obj.sign(); }
public void sign() { DvmClass checkSignUtil = vm.resolveClass("com/autohome/ahkit/jni/CheckSignUtil");
StringObject obj = checkSignUtil.callStaticJniMethodObject(emulator, "get3desKey(Landroid/content/Context)Ljava/lang/String", vm.resolveClass("android/content/Context").newObject(null) );
System.out.println(obj.getValue()); }
}
|