{"record":{"id":"afea74daeed4a81c","repo":"Perfare/Il2CppDumper","slug":"invalid-compressed-integer-format","errorCode":null,"errorMessage":"Invalid compressed integer format","messagePattern":"Invalid compressed integer format","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Il2CppDumper/Extensions/BinaryReaderExtensions.cs","lineNumber":80,"sourceCode":"            }\n            else if (read == 0xF0)\n            {\n                // 5 bytes written, we had a really large int32!\n                val = reader.ReadUInt32();\n            }\n            else if (read == 0xFE)\n            {\n                // Special encoding for Int32.MaxValue\n                val = uint.MaxValue - 1;\n            }\n            else if (read == 0xFF)\n            {\n                // Yes we treat UInt32.MaxValue (and Int32.MinValue, see ReadCompressedInt32) specially\n                val = uint.MaxValue;\n            }\n            else\n            {\n                throw new Exception(\"Invalid compressed integer format\");\n            }\n\n            return val;\n        }\n\n        public static int ReadCompressedInt32(this BinaryReader reader)\n        {\n            var encoded = reader.ReadCompressedUInt32();\n\n            // -UINT32_MAX can't be represted safely in an int32_t, so we treat it specially\n            if (encoded == uint.MaxValue)\n                return int.MinValue;\n\n            bool isNegative = (encoded & 1) != 0;\n            encoded >>= 1;\n            if (isNegative)\n                return -(int)(encoded + 1);\n            return (int)encoded;","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/Perfare/Il2CppDumper/blob/4741d46ba9cd6159c5d853eb9d6fc48b4bfa2b1a/Il2CppDumper/Extensions/BinaryReaderExtensions.cs#L62-L98","documentation":"Thrown by ReadCompressedUInt32 when the leading byte's high bits do not encode one of the valid compressed-integer layouts (1-byte <=0x7F, 2-byte 0x80..0xBF, 4-byte 0xC0..0xF7, special 0xF8/0xF9 forms). The byte stream is not a valid .NET-metadata-style compressed integer.","triggerScenarios":"Calling reader.ReadCompressedUInt32() when the reader is mispositioned in metadata tables (string/array data instead of a compressed integer), or reading a metadata blob whose encoding was corrupted.","commonSituations":"Version drift between the dumper's expected metadata layout and the actual file (unsupported game version), wrong offsets after a corrupted header, or manually patched metadata blobs.","solutions":["Confirm the metadata file version matches one the dumper supports (16-31) and that no offsets were hand-patched.","Check that the reader position is exactly at the start of a compressed-integer field before the call.","Re-extract global-metadata.dat from the APK/IPA; a corrupted blob produces bad leading bytes.","If the game uses a newer Unity/il2cpp version, update Il2CppDumper or dump with a matching tool version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Compressed int leading-byte classes:\n// b <= 0x7F (1B), 0x80-0xBF (2B), 0xC0-0xF7 (4B), 0xF8/0xF9 special\nbool LooksLikeCompressedInt(byte lead) => lead <= 0xF7 && lead >= 0x80 || lead <= 0x7F;","typeGuard":null,"tryCatchPattern":"try { uint v = reader.ReadCompressedUInt32(); }\ncatch (Exception ex) when (ex.Message == \"Invalid compressed integer format\") { /* reader mispositioned or corrupt blob */ }","preventionTips":["Ensure the metadata version is supported before parsing tables.","Never hand-patch metadata offsets; regenerate or re-extract instead.","Verify reader position against the header's table offsets before reads."],"tags":["metadata","binary-reader","corrupt-data"],"backgroundTag":"invalid-argument-format","analyzedSha":"4741d46ba9cd6159c5d853eb9d6fc48b4bfa2b1a","analyzedAt":"2026-09-11T16:52:42.117Z","contentChangedAt":"2026-09-11T16:52:42.117Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}