dw.writeBytes(pa);
else
dw.writeByte(0, prd - dw.getPosition());
}
ImageData id = pe.getImageData();
switch (entry.index) {
case ImageDataDirectoryType.EXPORT_TABLE:
dw.writeBytes(id.getExportTable().get());
break;
case ImageDataDirectoryType.IMPORT_TABLE:
dw.writeBytes(id.getImportTable().get());
break;
case ImageDataDirectoryType.RESOURCE_TABLE:
dw.writeBytes(id.getResourceTable().get());
break;
case ImageDataDirectoryType.EXCEPTION_TABLE:
dw.writeBytes(id.getExceptionTable());
break;
case ImageDataDirectoryType.CERTIFICATE_TABLE:
dw.writeBytes(id.getCertificateTable());
break;
case ImageDataDirectoryType.BASE_RELOCATION_TABLE:
dw.writeBytes(id.getBaseRelocationTable());
break;
case ImageDataDirectoryType.DEBUG:
dw.writeBytes(id.getDebug().get());
break;
case ImageDataDirectoryType.ARCHITECTURE:
dw.writeBytes(id.getArchitecture());
break;
case ImageDataDirectoryType.GLOBAL_PTR:
dw.writeBytes(id.getGlobalPtr());
break;
case ImageDataDirectoryType.TLS_TABLE:
dw.writeBytes(id.getTlsTable());
break;
case ImageDataDirectoryType.LOAD_CONFIG_TABLE:
break;
case ImageDataDirectoryType.BOUND_IMPORT:
write(pe, id.getBoundImports(), dw);
break;
case ImageDataDirectoryType.IAT:
dw.writeBytes(id.getIat());
break;
case ImageDataDirectoryType.DELAY_IMPORT_DESCRIPTOR:
dw.writeBytes(id.getDelayImportDescriptor());
break;
case ImageDataDirectoryType.CLR_RUNTIME_HEADER:
dw.writeBytes(id.getClrRuntimeHeader());
break;
case ImageDataDirectoryType.RESERVED:
dw.writeBytes(id.getReserved());
break;
}
}