(value: Il2Cpp.Field.Type)
| 167 | } |
| 168 | |
| 169 | function 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 | |
| 195 | function formatObjectSummary(object: Il2Cpp.Object): string { |
| 196 | const className = getClassName(object.class); |
no test coverage detected