JAR magic value: 'J'=0x4A, 'A'=0x41, 'R'=0x52, 0x02.
9.9. JAR Blob Format
jar1 uses a custom blob format with a magic header, capability entries, and sub-blobs for CODE caps.
def
Jar.JAVM.jarMagic : NatJar.JAVM.jarMagic : Nat
structure
Jar.JAVM.JarHeader : TypeJar.JAVM.JarHeader : Type
JAR header (10 bytes).
Constructor
Jar.JAVM.JarHeader.mk
Fields
memoryPages : Nat
capCount : Nat
invokeCap : Nat
structure
Jar.JAVM.JarCapEntry : TypeJar.JAVM.JarCapEntry : Type
JAR capability entry (19 bytes).
Constructor
Jar.JAVM.JarCapEntry.mk
Fields
capIndex : Nat
isCode : Bool
basePage : Nat
pageCount : Nat
isRW : Bool
dataOffset : Nat
dataLen : Nat
def
Parse a JAR header (11 bytes). Returns header + offset after header.
def
Parse a JAR capability entry (19 bytes) at the given offset.
def
Jar.JAVM.parseCodeSubBlob (blob : ByteArray) (dataOffset dataLen : Nat) : Option Jar.JAVM.ProgramBlobJar.JAVM.parseCodeSubBlob (blob : ByteArray) (dataOffset dataLen : Nat) : Option Jar.JAVM.ProgramBlob
Parse a CODE cap's sub-blob into a ProgramBlob. Format: jump_len(4) + entry_size(1) + code_len(4) + jt + code + bitmask.