com.cmpware.elf
Class ProgramHeader

java.lang.Object
  extended by com.cmpware.elf.ProgramHeader

public class ProgramHeader
extends java.lang.Object

This describes the ELF Program Header.

Copyright (c) 2004 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
 byte[] data
          The program / segment data
 long p_align
          The data alignment in memory and in the file
 long p_filesz
          The file size of the image (in bytes)
 long p_flags
          The segment flags
 long p_memsz
          The memory size of the image (in bytes)
 long p_offset
          The program file offset (bytes)
 long p_paddr
          The physical address of the segment
 long p_type
          The program type
 long p_vaddr
          The virtual address of the segment
static int PF_R
          Readable segment
static int PF_W
          Writable segment
static int PF_X
          Executable segment
static int PT_DYNAMIC
          Dynamic linking information
static int PT_HIPROC
          High value for processor-specific semantics segment
static int PT_INTERP
          Pathg to program interpreter
static int PT_LOAD
          A loadable segment (code)
static int PT_LOPROC
          Low value for processor-specific semantics segment
static int PT_NOTE
          Auxiliary information
static int PT_NULL
          Null (inactive) segment
static int PT_PHDR
          Program header table
static int PT_SHLIB
          Reserved segment type
 
Constructor Summary
ProgramHeader()
           
 
Method Summary
 void read(ElfInputStream eis)
          This method fills in the ELF Program Header fields.
 java.lang.String toString()
          This method returns a string representation of the ELF program header.
 void write(ElfOutputStream eos)
          This method writes out the ELF Program Header fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

PT_NULL

public static final int PT_NULL
Null (inactive) segment

See Also:
Constant Field Values

PT_LOAD

public static final int PT_LOAD
A loadable segment (code)

See Also:
Constant Field Values

PT_DYNAMIC

public static final int PT_DYNAMIC
Dynamic linking information

See Also:
Constant Field Values

PT_INTERP

public static final int PT_INTERP
Pathg to program interpreter

See Also:
Constant Field Values

PT_NOTE

public static final int PT_NOTE
Auxiliary information

See Also:
Constant Field Values

PT_SHLIB

public static final int PT_SHLIB
Reserved segment type

See Also:
Constant Field Values

PT_PHDR

public static final int PT_PHDR
Program header table

See Also:
Constant Field Values

PT_LOPROC

public static final int PT_LOPROC
Low value for processor-specific semantics segment

See Also:
Constant Field Values

PT_HIPROC

public static final int PT_HIPROC
High value for processor-specific semantics segment

See Also:
Constant Field Values

PF_X

public static final int PF_X
Executable segment

See Also:
Constant Field Values

PF_W

public static final int PF_W
Writable segment

See Also:
Constant Field Values

PF_R

public static final int PF_R
Readable segment

See Also:
Constant Field Values

p_type

public long p_type
The program type


p_offset

public long p_offset
The program file offset (bytes)


p_vaddr

public long p_vaddr
The virtual address of the segment


p_paddr

public long p_paddr
The physical address of the segment


p_filesz

public long p_filesz
The file size of the image (in bytes)


p_memsz

public long p_memsz
The memory size of the image (in bytes)


p_flags

public long p_flags
The segment flags


p_align

public long p_align
The data alignment in memory and in the file


data

public byte[] data
The program / segment data

Constructor Detail

ProgramHeader

public ProgramHeader()
Method Detail

read

public void read(ElfInputStream eis)
          throws java.io.IOException
This method fills in the ELF Program Header fields.

Parameters:
eis - The ElfInputStream for the ELF file.
Throws:
java.io.IOException - if an error is encountered in reading the Data Input Stream.

write

public void write(ElfOutputStream eos)
           throws java.io.IOException
This method writes out the ELF Program Header fields.

Parameters:
eos - The ElfOutputStream for the ELF file.
Throws:
java.io.IOException - if an error is encountered in writing the Elf Output Stream.

toString

public java.lang.String toString()
This method returns a string representation of the ELF program header.

Overrides:
toString in class java.lang.Object
Returns:
This method returns a string representation of the ELF program header.