YYY的c#定义:
public static byte[] YYY(ref string contentFile)
下面这样执行会报错 Error: expected a pointer
Error: expected a pointer
import
"frida-il2cpp-bridge"
;
Il2Cpp.perform(()
=
> {
console.log(
"Unity version: "
+
Il2Cpp.unityVersion);
const XXX
Il2Cpp.domain.assembly(
'Assembly-CSharp'
).image.
class
(
'XXX'
);
const YYY
XXX.method(
"YYY"
YYY.implementation
function (item): Uint8Array {
var result
this.method<Uint8Array>(
).invoke(item);
var
file
new
File
"text.txt"
,
"r"
return
.readBytes();
/
<
-
};
});
换下面则会卡住,应该是被hook的无法读取到这个内存地址
var byteArray
.readBytes()
console.log(hexdump(byteArray, {
offset:
0
length: byteArray.length,
header: true,
ansi: true,
}));
console.log(byteArray.byteLength);
var memAllocate
Memory.alloc(byteArray.byteLength);
Memory.writeByteArray(memAllocate, byteArray);
memAllocate;
使用 Il2Cpp.array 下面代码
Il2Cpp.array
const SystemByte
Il2Cpp.corlib.
"System.Byte"
var byteArray;
byteArray
var bytePointer
Il2Cpp.array(SystemByte, byteArray);
bytePointer;
报错:
Error: expected an unsigned integer
at array (il2cpp
structs
array.ts:
92
)
at <anonymous> (index.ts:xx) <
bytePointer line
at call (native)
at <anonymous> (il2cpp
method.ts:
354
自己解决了
var byteArray;
result.handle
byteArray.unwrap();
result;
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课