eg:
话不多说,这个apk如果是用unidbg调用的话,那就很简单,而且so层没有调用java层一些东西,都不用补环境。
上图吧:
init:
decrypt:
文章来源:https://www.toymoban.com/news/detail-523282.html
encrypt:
文章来源地址https://www.toymoban.com/news/detail-523282.html
package com.sougou;
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.linux.android.dvm.jni.ProxyDvmObject;
import com.github.unidbg.memory.Memory;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class Sougou extends AbstractJni {
private final AndroidEmulator emulator;
private final VM vm;
private final Memory memory;
private final Module module;
public Sougou() {
emulator = AndroidEmulatorBuilder
.for32Bit()
// .setRootDir(new File("target/rootfs/default"))
// .addBackendFactory(new DynarmicFactory(true))
.build();
memory = emulator.getMemory();
memory.setLibraryResolver(new AndroidResolver(23));
vm = emulator.createDalvikVM(new File("unidbg-android/src/test/java/com/sougou/sougou.apk"));
vm.setJni(this);
//加载so
// DalvikModule dalvikModule = vm.loadLibrary("SCoreTools", true);
DalvikModule dalvikModule = vm.loadLibrary(new File("unidbg-android/src/test/java/com/sougou/libSCoreTools.so"), true);
module = dalvikModule.getModule();
// vm.callJNI_OnLoad(emulator, module);
}
public void init() {
DvmClass Context = vm.resolveClass("android/content/Context");
List<Object> list = new ArrayList<>(10);
list.add(vm.getJNIEnv());
list.add(0);
list.add(vm.addLocalObject(Context.newObject(null)));
this.module.callFunction(this.emulator, 0x009565, list.toArray()).intValue();
}
public String decrypt(String data) {
List<Object> list = new ArrayList<>(10);
list.add(vm.getJNIEnv());
list.add(0);
list.add(vm.addLocalObject(new StringObject(vm, data)));
return new String((byte[]) vm.getObject(this.module.callFunction(this.emulator, 0x009DA1, list.toArray()).intValue()).getValue());
}
public String encrypt(String param1, String param2) {
List<Object> list = new ArrayList<>(10);
list.add(vm.getJNIEnv());
list.add(0);
list.add(vm.addLocalObject(new StringObject(vm, param1)));
list.add(vm.addLocalObject(new StringObject(vm, param2)));
list.add(vm.addLocalObject(new StringObject(vm, "")));
return vm.getObject(this.module.callFunction(this.emulator, 0x009CA1, list.toArray()).intValue()).getValue().toString();
}
public static void callEncrypt(String param1, String param2) {
Sougou Sougou = new Sougou();
Sougou.init();
String value = Sougou.encrypt(param1, param2);
System.out.println("参数解密 -callEncrypt===result ==> " + value);
}
public static void callDecrypt(String data) {
Sougou Sougou = new Sougou();
Sougou.init();
String param1 = "http://app.weixin.sogou.com/api/searchapp";
String param2 = "type=2&ie=utf8&page=1&query=55&select_count=1&tsn=1&usip=";
Sougou.encrypt(param1, param2);
String value = Sougou.decrypt(data);
System.out.println("响应解密 - callDecrypt===result ==> " + value);
}
public static void main(String[] args) {
//参数生成解密
String param1 = "http://app.weixin.sogou.com/api/searchapp";
String param2 = "type=2&ie=utf8&page=1&query=55&select_count=1&tsn=1&usip=";
callEncrypt(param1, param2);
//响应体解密
String data = "FziUpGpg35FYuX5hsvaMF3L74X1ZD0rytAFfrZLBAVUkDv8Tmg12eHi/9Khkb/rYokCb2YsX9EhIQJJWK/8KZbo7e3ndkXPLwhTTzBLO6qZNDQivbP9lm8gNBBLLJmL4ii6aOzpwTonRmDYXriflYei+E3CUR+2BpphmTgiQmz2J0Kq2je50rHvlCnpmJudiMUge37BC2f91Qx40s3HNL3cLNrL9eboG6ukUQBhO9apoRoUBpVkr4vr5k98UtriopfbHzuWq4ME5eGY3Dnkv0RfeHV4+Y0VGnjCoZOU9RJiTVq595XqRCxKNahpg4ANYQdg+6q6CWgMlF5BUARVGxSCbDfKgkPb392dX44hdr3LZsriVxcjNxLADPddQJDlDMYbFauXmiYoFalSR7kQ6Mr50Q/Ne7SoSlvgH6V6t4habFdAfT8FuKWuN6ywBr+IBb/sB9hiGN3CgIF+KOOFHakmN6O7Ydj62+won5SQ/LfytbuMP+v+L5MrVg7lJpxNFcIqLjRRhaDCd0r4x4g+pzHqsup+t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qvD33N86X+0n+edPCaZsnSD1+IFEdKMiWIELdaGXFFxObG0Bt8pOcVXdlhCxtXjhZ6nANWkTFxBDReTKP+DG6CegA6QBMKBeHgzeJdWd0FPPzuMcJnVDxuR/y7vx3glyOAtE5BhO5fSwLE//esNmTs9SLnMYjV/Lr2uZrQJ38uVPpifq94duFG42nK7oqRSg7fjYeOOCPAqMCzgLk2qRJjnRk/4UdGXIR5cysgu6rQZY9WtD2Apjd5PAZSoVt3UdUCuJOSkP6uNmQxRYLFYYQcGIas0SNZ0BhP1BJgttO/Qk6xiSnC9fMC3Ok013dxEAHsLWF5W+OadmZZVm6dCcMBa9NvZPuk6YxGVmyDJxa4DrCQ8bLzK4JwDM9JMXlyaq8hL99BFMwtkK24FEOReApAtFzKXbEa9LHsORS2qd762m28Z9ESHDqIpzgLLxesO7uikhA4Af8TH0lllF";
callDecrypt(data);
}
}
到了这里,关于搜狗微信APP逆向(三)unidbg的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!