@oggzee
I just tested with wbfs_file_1.2 and it behaves exactly like my app. ie. I converted to .wbfs then back to .iso and the file size was 4,685,037,568 like Tristar mentioned.
Did you add the file allocation stuff in a later version?
Yes:
v1.3:
* Fixed extracted iso size on Windows
* Fixed ETA info for iso extraction
So to be more precise, i only fixed it so it works correctly on windows, on linux it was working right also in 1.2, the problem was with the fruncate function used on windows/mingw, which i replaced it with proper win32 apis in 1.3.
fig2k4 said:
Also, I think I've found a way to determine if it should be dual or single layered. Basically, count the used blocks for the disc and check to see if the used data is larger than the single layer size.
It doesn't determine if the original disc was dual layered, but at least the ISO sizes will be correct.
The Delphi code...
[ CUT ]
Then in the ExtractISO() function you can calculate the file size to allocate.
[ CUT ]
I changed the variable names to be more readable in my code, but I'm sure you can see what I mean.
I have that implemented too:
CODE
libwbfs.c:
u32 wbfs_sector_used2(wbfs_t *p,wbfs_disc_info_t *di, u32 *last_blk)
{
ÂÂÂÂÂÂÂÂu32 tot_blk=0,j;
ÂÂÂÂÂÂÂÂfor(j=0;jn_wbfs_sec_per_disc;j++)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif(wbfs_ntohs(di->wlba_table[j])) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*last_blk = j;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtot_blk++;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂreturn tot_blk;
}
wbfs.c:
ÂÂÂÂ// check if the game is DVD9..
ÂÂÂÂ/*
ÂÂÂÂÂÂ u32 comp_blk;
ÂÂÂÂÂÂ u32 last_blk;
ÂÂÂÂÂÂ comp_blk = wbfs_sector_used2(d->p, d->header, &last_blk);
ÂÂÂÂÂÂ u64 real_size = (u64)last_blk * (u64)d->p->wbfs_sec_sz;
ÂÂÂÂÂÂ u64 dual_size = (d->p->n_wii_sec_per_disc)*0x8000ULL;
ÂÂÂÂÂÂ */
ÂÂÂÂÂÂÂÂu64 single_size = (d->p->n_wii_sec_per_disc/2)*0x8000ULL;
ÂÂÂÂÂÂÂÂu64 size = single_size;
ÂÂÂÂÂÂÂÂ//if (real_size > single_size) size = dual_size;