Пример #1
0
 protected bool IsLoadable(ulong p_pmemsz, ProgramHeaderType p_type)
 {
     if (p_pmemsz == 0)
     {
         return(false);
     }
     return(p_type == ProgramHeaderType.PT_LOAD ||
            p_type == ProgramHeaderType.PT_DYNAMIC);
 }
Пример #2
0
 public void Read(Stream stream)
 {
     P_TYPE   = stream.ReadWord <ProgramHeaderType>(ProgramHeaderType.PT_NULL);
     P_OFFSET = stream.ReadOffset32();
     P_VADDR  = stream.ReadAddress32();
     P_PADDR  = stream.ReadAddress32();
     P_FILESZ = stream.ReadUInt32();
     P_MEMSZ  = stream.ReadUInt32();
     P_FLAGS  = stream.ReadUInt32();
     P_ALIGN  = stream.ReadUInt32();
 }
Пример #3
0
 private void Given_ProgramHeader(
     ProgramHeaderType type,
     uint imageOffset,
     uint virtualAddress,
     uint fileSize,
     uint loadedSize)
 {
     programHeaders.Add(new Elf64_PHdr
     {
         p_type   = type,
         p_offset = imageOffset,
         p_vaddr  = virtualAddress,
         p_filesz = fileSize,
         p_pmemsz = loadedSize,
     });
 }
Пример #4
0
 private void Given_ProgramHeader(
     ProgramHeaderType type,
     uint imageOffset,
     uint virtualAddress,
     uint fileSize,
     uint loadedSize)
 {
     programHeaders.Add(new Elf64_PHdr
     {
         p_type = type,
         p_offset = imageOffset,
         p_vaddr = virtualAddress,
         p_filesz = fileSize,
         p_pmemsz = loadedSize,
     });
 }
Пример #5
0
 protected bool IsLoadable(ulong p_vaddr, ProgramHeaderType p_type)
 {
     if (p_vaddr == 0)
         return false;
     return (p_type == ProgramHeaderType.PT_LOAD ||
             p_type == ProgramHeaderType.PT_DYNAMIC);
 }