@@ -72,7 +72,7 @@ def ELFHeader.ph_end [ELFHeader α] (eh : α) :=
7272
7373instance [ELFHeader α] : ToString α where
7474 toString eh :=
75- let ident (i : Fin 16 ) := (ELFHeader.e_ident eh).bytes.get ⟨ i, by simp [(ELFHeader.e_ident eh).sized] ⟩
75+ let ident (i : Fin 16 ) := (ELFHeader.e_ident eh).bytes[i]'( by simp [(ELFHeader.e_ident eh).sized])
7676 let identAsHex (i: Fin 16 ) := toHex (ident i).toNat
7777 let identAsHexLength2 (i: Fin 16 ) := toHexMinLength (ident i).toNat 2
7878 "ElfHeader {\n " ++
@@ -149,7 +149,7 @@ def mkELF64Header (bs : ByteArray) (h : bs.size ≥ 0x40) : ELF64Header := {
149149 e_shnum := getUInt16from 0x3C (by omega),
150150 e_shstrndx := getUInt16from 0x3E (by omega),
151151} where
152- isBigEndian := bs.get ⟨ 0x5 , by omega⟩ == 2
152+ isBigEndian := bs[ 0x5 ] == 2
153153 getUInt16from := if isBigEndian then bs.getUInt16BEfrom else bs.getUInt16LEfrom
154154 getUInt32from := if isBigEndian then bs.getUInt32BEfrom else bs.getUInt32LEfrom
155155 getUInt64from := if isBigEndian then bs.getUInt64BEfrom else bs.getUInt64LEfrom
@@ -243,7 +243,7 @@ def mkELF32Header (bs : ByteArray) (h : bs.size ≥ 0x34) : ELF32Header := {
243243 e_shnum := getUInt16from 0x30 (by omega),
244244 e_shstrndx := getUInt16from 0x32 (by omega),
245245} where
246- isBigEndian := bs.get ⟨ 0x5 , by omega⟩ == 2
246+ isBigEndian := bs[ 0x5 ] == 2
247247 getUInt16from := if isBigEndian then bs.getUInt16BEfrom else bs.getUInt16LEfrom
248248 getUInt32from := if isBigEndian then bs.getUInt32BEfrom else bs.getUInt32LEfrom
249249
@@ -311,7 +311,7 @@ instance : ELFHeader RawELFHeader where
311311
312312def mkRawELFHeader? (bs : ByteArray) : Except String RawELFHeader :=
313313 if h : bs.size < 5 then throw "Can't determine if this is a 32 or 64 bit binary (not enough bytes)."
314- else match bs.get ⟨ 0x4 , by omega⟩ with
314+ else match bs[ 0x4 ] with
315315 | 1 => .elf32 <$> mkELF32Header? bs
316316 | 2 => .elf64 <$> mkELF64Header? bs
317317 | _ => throw "Can't determine if this is a 32 of 64 bit binary (byte 0x5 of the elf header is bad)"
0 commit comments