-
-
未解决
[求助]安卓逆向 找不到base64EncodeChars?
-
发表于:
2020-7-12 13:44
2504
-
未解决 [求助]安卓逆向 找不到base64EncodeChars?
我定位到了一款app的MyBase64的代码,里面的encode代码是这样的
private static final byte[] base64DecodeChars = null;
private static final char[] base64EncodeChars = null;
private MyBase64() {
}
public static byte[] decode(java.lang.String r10) {
...省略
}
public static String encode(byte[] bArr) {
StringBuffer stringBuffer = new StringBuffer();
int length = bArr.length;
int i = 0;
while (true) {
if (i >= length) {
break;
}
int i2 = i + 1;
byte b = bArr[i] & 255;
if (i2 == length) {
stringBuffer.append(base64EncodeChars[b >>> 2]);
stringBuffer.append(base64EncodeChars[(b & 3) << 4]);
stringBuffer.append("==");
break;
}
int i3 = i2 + 1;
byte b2 = bArr[i2] & 255;
if (i3 == length) {
stringBuffer.append(base64EncodeChars[b >>> 2]);
stringBuffer.append(base64EncodeChars[((b & 3) << 4) | ((b2 & 240) >>> 4)]);
stringBuffer.append(base64EncodeChars[(b2 & ao.m) << 2]);
stringBuffer.append("=");
break;
}
int i4 = i3 + 1;
byte b3 = bArr[i3] & 255;
stringBuffer.append(base64EncodeChars[b >>> 2]);
stringBuffer.append(base64EncodeChars[((b & 3) << 4) | ((b2 & 240) >>> 4)]);
stringBuffer.append(base64EncodeChars[((b2 & ao.m) << 2) | ((b3 & 192) >>> 6)]);
stringBuffer.append(base64EncodeChars[b3 & 63]);
i = i4;
}
return stringBuffer.toString();
}
我通过frida调用decode函数,输出base64EncodeChars,和base64DecodeChars分别是
{"_p":["<class: com.hh.DG11.utils.MyBase64>",1,{"className":"[C","name":"[C","type":"pointer","size":1,"defaultValue":"0x0"},"0xaec301a8","0xb48b9f41","0xb48b0605"]}
{"_p":["<class: com.hh.DG11.utils.MyBase64>",1,{"className":"[B","name":"[B","type":"pointer","size":1,"defaultValue":"0x0"},"0xaec30198","0xb48b9f41","0xb48b0605"]}
正常来说base64EncodeChars应该是数字字母的组合的字符串,怎样获取正确的base64EncodeChars呢
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课