private void loadFromBuffer() { if (buff.length != BUFFER_SIZE) { throw new IllegalArgumentException("Illegal Image File Header buffer size: " + buff.length); } machine = LittleEndian.getUShort(buff, 0); numberOfSections = LittleEndian.getUShort(buff, 2); timeDateStamp = (long) LittleEndian.getUInt(buff, 4) * 1000; // val is in secs since 1970 pointerToSymbolTable = LittleEndian.getUInt(buff, 8); numberOfSymbols = LittleEndian.getUInt(buff, 12); sizeOfOptionalHeader = LittleEndian.getUShort(buff, 16); characteristics = LittleEndian.getUShort(buff, 18); }
public void debugPrint(PrintStream out) { out.println("RAW Buffer for IMAGE_FILE_HEADER:"); Streams.hexDump(buff, out); out.println("IMAGE_FILE_HEADER:"); out.println(" machine: " + LittleEndian.toHexString(machine)); out.println(" numberOfSections: " + LittleEndian.toHexString(numberOfSections)); out.println(" timeDateStame: " + new Date(timeDateStamp).toString()); out.println(" pointerToSymbolTable: " + LittleEndian.toHexString(pointerToSymbolTable)); out.println(" numberOfSymbols: " + LittleEndian.toHexString(numberOfSymbols)); out.println(" sizeOfOptionalHeader: " + LittleEndian.toHexString(sizeOfOptionalHeader)); out.println(" characteristics: " + LittleEndian.toHexString(characteristics)); }