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;
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)