From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:RFF (Blood resource file)" |
|---|
| claim | "RFF encryption is Crypt(p, length, key): byte i is XORed with ((unsigned short)(key + i)) >> 1; the directory of a version 0x300 file uses key header.offset + (header.version & 0xff) * header.offset, and a file whose entry has flag 0x10 is decrypted over its first min(size, 0x100) bytes with key 0." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Blood RFF as read by NBlood (Resource::Init, Resource::Load, Resource::Crypt)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "opening an RFF with version 0x300, or loading a resource whose flags have DICT_CRYPT" |
|---|
| effect | "in-place XOR of the directory or the first 0x100 bytes" |
|---|
| condition | "the key parameter is an unsigned short, so the key arithmetic is truncated to 16 bits and wraps; version 0x200 files have a plain directory" |
|---|
| function | "Resource::Crypt" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "Crypt loop cp[i] ^= (key >> 1) with key++, key declared unsigned short" |
|---|
| repo | "https://github.com/NBlood/NBlood" |
|---|
| commit | "497385d64b97f4fd13b6efb3929df0f2ab3adc87" |
|---|
| path | "source/blood/src/resource.cpp" |
|---|
| lines | "929-936" |
|---|
|
| type | "source" |
|---|
| detail | "Init calls Crypt on the directory with the offset-based key when crypt is set; Load decrypts the first 0x100 bytes with key 0 for DICT_CRYPT" |
|---|
| repo | "https://github.com/NBlood/NBlood" |
|---|
| commit | "497385d64b97f4fd13b6efb3929df0f2ab3adc87" |
|---|
| path | "source/blood/src/resource.cpp" |
|---|
| lines | "144-148, 768-780" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "RFF XOR cipher" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T09:33:51.159Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T11:48:55.269Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read NBlood resource.cpp (497385d) Init (header version switch, directory Crypt with offset-based key), Read (DICT_CRYPT=16, first min(size,0x100) bytes, key 0) and Crypt. Note: decryption happens only in the file-backed branch of Read, not for external or buffer resources." |
|---|
|
|
|---|