// 获取ArrayList和Integer类的引用
var ArrayListClass = Java.use("java.util.ArrayList");
var IntegerClass = Java.use("java.lang.Integer");
----------------
// 创建一个ArrayList实例 var arrayList = ArrayListClass.$new(); // 遍历字节数组,将每个字节添加到ArrayList中 for (var i = 0; i < bArr.length; i++) { arrayList.add(IntegerClass.$new(bArr[i])); } // 添加128 arrayList.add(IntegerClass.$new(128)); // 填充0直到ArrayList的大小加上64后是512的倍数 var size = arrayList.size(); while ((size * 8 + 64) % 512 !== 0) { arrayList.add(IntegerClass.$new(0)); size++; } // 计算length并添加到ArrayList中 var length = bArr.length * 8; for (var i = 0; i < 8; i++) { //console.log("i:",i,"len:",length,">>>",(length >>> (i * 8)) & 255); arrayList.add(IntegerClass.$new((length >>> (i * 8)) & 255)); }
标签:ArrayList,IntegerClass,length,实例,new,var,frida,arrayList From: https://www.cnblogs.com/angdh/p/18521889