R
application/octet-stream
Magic Bytes
Offset: 0
52 45 47 45 44 49 54
RData is a binary data storage format maintained by the R Foundation for Statistical Computing for preserving workspace variables and datasets. It is the primary method for exporting and importing complex statistical objects, models, and data frames across different R sessions and computing platforms. While these files are generally considered safe for analysis, the deserialization process used to reconstruct objects can potentially execute embedded malicious code if the file is sourced from an unverified or hostile origin.
Validation Code
How to validate .rdata files in Python
Python
def is_rdata(file_path: str) -> bool:
"""Check if file is a valid RDATA by magic bytes."""
signature = bytes([0x52, 0x45, 0x47, 0x45, 0x44, 0x49, 0x54])
with open(file_path, "rb") as f:
return f.read(7) == signature
How to validate .rdata files in Node.js
Node.js
function isRDATA(buffer: Buffer): boolean {
const signature = Buffer.from([0x52, 0x45, 0x47, 0x45, 0x44, 0x49, 0x54]);
return buffer.subarray(0, 7).equals(signature);
}
Go
func IsRDATA(data []byte) bool {
signature := []byte{0x52, 0x45, 0x47, 0x45, 0x44, 0x49, 0x54}
if len(data) < 7 {
return false
}
return bytes.Equal(data[:7], signature)
}
API Endpoint
GET
/api/v1/rdata
curl https://filesignature.org/api/v1/rdata