}
public ELF(Object img) throws IOException, ELFException {
- if (img instanceof String) image = new MyRandomAccessFile((String)img,"r");
- image = img;
+ if (img instanceof String) {
+ image = fd = new MyRandomAccessFile((String)img, "r");
+ } else {
+ image = img;
+ }
seek(0);
header = new ELFHeader();
pheaders = new PHeader[header.phnum];
public class ELFException extends IOException { ELFException(String s) { super(s); } }
private class MyRandomAccessFile extends RandomAccessFile {
- MyRandomAccessFile(String f,String m) throws FileNotFoundException { super(f,m); }
+ MyRandomAccessFile(String f,String m) throws IOException { super(f,m); }
}
private class SectionInputStream extends InputStream {