private static void writeImageData(PE pe, DataEntry entry, IDataWriter dw)
throws IOException {
ImageDataDirectory idd = pe.getOptionalHeader().getDataDirectory(
entry.index);
RVAConverter rvc = pe.getSectionTable().getRVAConverter();
int prd = idd.getVirtualAddress();
if (entry.index != ImageDataDirectoryType.CERTIFICATE_TABLE)
prd = rvc.convertVirtualAddressToRawDataPointer(idd
.getVirtualAddress());
if (prd > dw.getPosition()) {
byte[] pa = pe.getImageData().getPreamble(entry.index);
if (pa != null)
dw.writeBytes(pa);