MCPcopy Create free account
hub / github.com/axhlzy/FridaDebugger / logArray

Function logArray

agent/unity-fields.ts:222–248  ·  view source on GitHub ↗
(array: Il2Cpp.Array)

Source from the content-addressed store, hash-verified

220}
221
222function logArray(array: Il2Cpp.Array): void {
223 const length = array.length;
224 const elementType = safeArrayElementType(array);
225 const elementSize = safeArrayElementSize(array);
226 log(`[lfs] array length=${length} elementType=${elementType} elementSize=${elementSize}`, "yellow");
227
228 if (length === 0) {
229 return;
230 }
231
232 const indices = getArrayDisplayIndices(length);
233 let omitted = false;
234 const indexWidth = Math.max(3, String(length - 1).length);
235 const typeWidth = clamp(elementType.length, 12, 44);
236
237 for (const index of indices) {
238 if (index === -1) {
239 if (!omitted) {
240 log(`[lfs] ... ${length - ARRAY_HEAD_ELEMENTS - ARRAY_TAIL_ELEMENTS} elements omitted ...`, "yellow");
241 omitted = true;
242 }
243 continue;
244 }
245
246 logArrayElement(array, index, indexWidth, typeWidth);
247 }
248}
249
250function logArrayElement(array: Il2Cpp.Array, index: number, indexWidth: number, typeWidth: number): void {
251 const pointer = getArrayElementPointer(array, index);

Callers 1

logIl2CppFieldsFunction · 0.85

Calls 6

safeArrayElementTypeFunction · 0.85
safeArrayElementSizeFunction · 0.85
logFunction · 0.85
getArrayDisplayIndicesFunction · 0.85
clampFunction · 0.85
logArrayElementFunction · 0.85

Tested by

no test coverage detected