benilla-re systems structs docs

s_wardenModulus

global · warden

Address
0x811330 · 256 bytes, up to 0x81142f
Type
const uint8_t[256]
Meaning
Holds the RSA modulus, little-endian, that the module signature is checked against
Confidence
verified, proof two
Finding
warden/modules#the-signature-check

Finding: The signature check in warden: module decoding and loading

The decrypted copy must end with 260 bytes: the four bytes NGIS and a 256-byte signature. SHA-1 of the copy less those 260 bytes, followed by the upper-cased name MAIEV.MOD, is signed with RSA: the signature to the power 65537 modulo the 256-byte modulus at 0x811330 (both little-endian) must equal the digest, then 235 bytes 0xbb, then 0x0b. A failure frees the copy and returns null. The name is built at run time: M, then each byte of the table 0x811320 after its first times 0xb9 modulo 256, until a product is 0.

The derivation is in the doc.