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

Function formatFieldValue

agent/unity-fields.ts:169–193  ·  view source on GitHub ↗
(value: Il2Cpp.Field.Type)

Source from the content-addressed store, hash-verified

167}
168
169function formatFieldValue(value: Il2Cpp.Field.Type): string {
170 if (value instanceof NativePointer) {
171 const resolved = resolveAddress(value);
172 const pointerText = colorize(padRight(value, 20), resolved.length > 0 ? "green" : "gray");
173 return resolved.length > 0 ? `${pointerText} ${colorize(resolved, "magenta")}` : pointerText;
174 }
175
176 if (value instanceof Il2Cpp.String) {
177 return colorize(JSON.stringify(value.content), "gray");
178 }
179
180 if (value instanceof Il2Cpp.Object) {
181 return `${colorize(padRight(value.handle, 20), "green")} ${formatObjectSummary(value)}`;
182 }
183
184 if (value instanceof Il2Cpp.Array) {
185 return `${colorize(padRight(value.handle, 20), "green")} ${formatArraySummary(value)}`;
186 }
187
188 if (value instanceof Il2Cpp.ValueType) {
189 return colorize(sanitizeText(value.toString()), "green");
190 }
191
192 return colorize(String(value), "green");
193}
194
195function formatObjectSummary(object: Il2Cpp.Object): string {
196 const className = getClassName(object.class);

Callers 2

readFieldRowFunction · 0.85
logArrayElementFunction · 0.85

Calls 6

resolveAddressFunction · 0.85
colorizeFunction · 0.85
padRightFunction · 0.85
formatObjectSummaryFunction · 0.85
formatArraySummaryFunction · 0.85
sanitizeTextFunction · 0.85

Tested by

no test coverage detected