MCPcopy Create free account
hub / github.com/IIIImmmyyy/frida-il2cppDumper / getCString

Method getCString

_agent.js:1304–1336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1302 return content;
1303 }
1304 getCString() {
1305 if (this.isNull()) {
1306 return "指针空";
1307 }
1308 let length = this.getLength();
1309 //长度4字节本身偏移16 从20位开始
1310 let il2cppStringChars = il2cppApi_1.il2cppApi.il2cpp_string_chars(this);
1311 let content = "";
1312 for (let i = 0; i < length; i++) {
1313 let offset = i * 2;
1314 let s = il2cppStringChars.add(offset).readU16().toString(16);
1315 // console.log("il2cppStringChars:" + s);
1316 //转unicode
1317 if (s.toString().length === 2) {
1318 let s2 = il2cppStringChars.add(offset).readCString();
1319 // log("s2:"+s2);
1320 content = content + s2;
1321 }
1322 else {
1323 //转换unicode
1324 let unicode = "\\u" + s.toString();
1325 // log("unicode:" + unicode);
1326 let decodeUnicode1 = this.decodeUnicode(unicode);
1327 content = content + decodeUnicode1;
1328 // log("s2:"+this.decodeUnicode(unicode));
1329 }
1330 // let s1 = String.fromCharCode(unicode);
1331 }
1332 if (content === undefined) {
1333 return "";
1334 }
1335 return content;
1336 }
1337 getLength() {
1338 return il2cppApi_1.il2cppApi.il2cpp_string_length(this);
1339 }

Callers

nothing calls this directly

Calls 2

getLengthMethod · 0.95
decodeUnicodeMethod · 0.95

Tested by

no test coverage detected