diff --git a/libisoburn/isofs_wrap.c b/libisoburn/isofs_wrap.c index 1b093255..3dd140fc 100644 --- a/libisoburn/isofs_wrap.c +++ b/libisoburn/isofs_wrap.c @@ -670,11 +670,32 @@ ex:; */ int isoburn_invalidate_iso(struct isoburn *o, int flag) { + int end_ed_found= 0, i; + char *head; + + head= (char *) o->target_iso_head; /* * replace CD001 with CDXX1 in PVM. * I think this is enought for invalidating an iso image */ - strncpy((char*)o->target_iso_head + 16 * 2048 + 1, "CDXX1", 5); + strncpy(head + 16 * 2048 + 1, "CDXX1", 5); + + /* Look for UDF volume recognition sequence and invalidate */ + for(i= 17 * 2048; i < 32 * 2048; i+= 2048) { + if(end_ed_found) { + if(head[i] == 0 && strncmp(head + i + 1, "BEA01", 5) == 0) + strncpy(head + i + 1, "BEAX1", 5); + else if(head[i] == 0 && strncmp(head + i + 1, "NSR", 3) == 0) + strncpy(head + i + 1, "NSRX", 4); + else if(head[i] == 0 && strncmp(head + i + 1, "TEA", 3) == 0) + strncpy(head + i + 1, "TEAX", 4); + } else { + if(((unsigned char *) head)[i] == 0xff && + strncmp(head + i + 1, "CD001", 5) == 0) + end_ed_found= 1; + } + } + return isoburn_activate_session(o->drive); } diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 59410405..0a4d155d 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2016.04.27.092902" +#define Xorriso_timestamP "2016.05.03.075722"