Csabo
Moderator
Posts: 541
Registered: 02-02 |
Just debug your code, you should see if all the values you are reading are correct. Anyway, something like this should work:
AssignFile ( f, 'filename.wad' );
Reset ( f, 1 );
Seek ( f, 8 );
BlockRead ( f, intPosition, 4 );
Seek ( f, intPosition + intEntry * 16 );
BlockRead ( f, intPosition, 4 );
BlockRead ( f, intLength, 4 );
You should have the position and length of entry number 'iEntry' (0 based) in the respective variables. 16 is the length of the directory entry, as I mentioned it my previous post.
Of course you'd want to verify that the file is infact a WAD file (has IWAD or PWAD signature), and that the value on pos 8 is within the file, etc.
|