bspsrc icon indicating copy to clipboard operation
bspsrc copied to clipboard

Cannot decompile a certain map file.

Open ghost opened this issue 5 years ago • 2 comments

I have no idea what's causing it to fail, but I know that It is some kind of new type of "anti-decompile" involving hex-editing. The map is attached here.

TheMapFile.zip

ghost avatar Feb 13 '20 22:02 ghost

Here is the error

[info] BSP version: 20

[info] Game: Team Fortress 2
[info] Map comment: OwO
[info] No areaportals to reallocate...
[info] No occluders to reallocate...
[info] Writing brushes and planes
[warning] VmfWriter: Unclosed VMF chunk: world
[error] BspSource: Decompiling error, caused by java.lang.IndexOutOfBoundsException: Index: 31066, Size: 31066
	at java.util.ArrayList.rangeCheck(Unknown Source)
	at java.util.ArrayList.get(Unknown Source)
	at info.ata4.bspsrc.util.WindingFactory.fromSide(WindingFactory.java:129)
	at info.ata4.bspsrc.modules.geom.BrushSource.writeBrush(BrushSource.java:197)
	at info.ata4.bspsrc.modules.geom.BrushSource.writeBrush(BrushSource.java:305)
	at info.ata4.bspsrc.modules.geom.BrushSource.writeBrushes(BrushSource.java:172)
	at info.ata4.bspsrc.modules.BspDecompiler.writeBrushes(BspDecompiler.java:134)
	at info.ata4.bspsrc.modules.BspDecompiler.start(BspDecompiler.java:94)
	at info.ata4.bspsrc.BspSource.decompile(BspSource.java:164)
	at info.ata4.bspsrc.BspSource.run(BspSource.java:72)
	at info.ata4.bspsrc.gui.BspSourceFrame$4.run(BspSourceFrame.java:359)

[info] Processed 1 file(s) in 0.6210 seconds

R60D avatar Feb 13 '20 22:02 R60D

I had a look at the bsp and you're right that it has to do with some kind of anti decompilation method. It's abusing that in a lot of places, bspsrc isn't expecting "invalid" values and consequently not error checking these. I never got around to fixing this yet because, the error handling as a whole should really be looked at and updated.

rihi avatar Feb 05 '23 02:02 rihi