Hi,
I am trying to write a simple program that will extract all used textures from either the .map or the compiled .bsp file.
So far, the .bsp file looks to be the best candidate, since each texture is actually preceded by the string “textures/” which makes them easy to extract.
However, the files are really large and contain loads of NULL characters. When I try to load them into my application, it stops reading as soon as it hits a NULL character, and so most of the information is lost…
One possible solution to this is to replace each NULL character by a different character (like a space). Unfortunately, since the files are so large and contain so many null characters, this takes AGES to complete…
Now after looking at a few random BSP files in Wordpad, I found that the textures are only in the first few (10-20?) lines, and the rest of the BSP file (99.9999% or something
) is garbage for me. If I would only use the first few relevant lines that would make my application so much faster…
But the problem ofcourse, is that I don’t know how many lines to look for!
I don’t think so, but is there maybe some kind of ‘rule’ that tells me how many lines contain the texture information? Is there any way I can get my program to only read the texture information, not the rest of the file?
Thanks!!


But seriously you need a program for couple things that would take only a few minutes, lol. 
