MAPIProperty prop = MAPIProperty.get(id);
if(id >= 0x8000 && id <= 0xFFFF) {
// TODO
- throw new UnsupportedOperationException("Not yet implemented for id " + id);
+ System.err.println("Not yet implemented for id " + id);
+ break;
}
// Now read in the value(s)
// Data is always padded out to a 4 byte boundary
if(len % 4 != 0) {
- byte[] padding = new byte[len % 4];
+ byte[] padding = new byte[4 - (len % 4)];
IOUtils.readFully(inp, padding);
}
}
- break;
}
// All done
throw new IllegalArgumentException("Filename must be given");
}
- for(String filename : args) {
+ boolean truncatePropData = true;
+ for(int i=0; i<args.length; i++) {
+ if(args[i].equalsIgnoreCase("--full")) {
+ truncatePropData = false;
+ continue;
+ }
+
HMEFDumper dumper = new HMEFDumper(
- new FileInputStream(filename)
+ new FileInputStream(args[i])
);
+ dumper.setTruncatePropertyData(truncatePropData);
dumper.dump();
}
}
private InputStream inp;
+ private boolean truncatePropertyData;
+
public HMEFDumper(InputStream inp) throws IOException {
this.inp = inp;
LittleEndian.readUShort(inp);
}
+ public void setTruncatePropertyData(boolean truncate) {
+ truncatePropertyData = truncate;
+ }
+
private void dump() throws IOException {
int level;
String indent = " ";
System.out.println(indent + "Data of length " + attr.getData().length);
if(attr.getData().length > 0) {
- int len = Math.min( attr.getData().length, 48 );
+ int len = attr.getData().length;
+ if(truncatePropertyData) {
+ len = Math.min( attr.getData().length, 48 );
+ }
+
int loops = len/16;
if(loops == 0) loops = 1;