Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[L4D2/Any] 07_LUMP_FACES can be zeroed to protect from decompilation #131

Closed
Tsuey opened this issue Jul 6, 2021 · 1 comment
Closed
Assignees

Comments

@Tsuey
Copy link

Tsuey commented Jul 6, 2021

I've only noticed this in L4D2 but any game where you can compile in HDR would likely be vulnerable, too.

As a form of "protection" against decompiles, you can use VBSPINFO to extract 07_LUMP_FACES, create a *.lmp file for it, then zero the data there and the map will still work perfectly. You can also apply this directly to the BSP file and the map will still work perfectly.

Why the map still works:

BSPSource only checks 07_LUMP_FACES. This lump is always created, regardless of compile settings.

If the map is compiled with VRAD+HDR, then 53_LUMP_LIGHTING_HDR becomes non-0, which means 58_LUMP_FACES_HDR is then used by the engine instead.

At least in L4D2, 58_LUMP_FACES_HDR is always prioritized -- if it's empty, it falls back to 07_LUMP_FACES. If both are empty, the map will fail to load.

End result: 07_LUMP_FACES can be zeroed, BSPSource decompiles break, but the engine reads from 58_LUMP_FACES_HDR as if nothing had happened.

Background info: https://github.com/Tsuey/L4D2-BSP-Lump-Editing

@rihi rihi self-assigned this Jan 22, 2022
@rihi
Copy link
Collaborator

rihi commented Feb 13, 2022

I've fixed this with c4987a9, 3126531. We now first check for the hdr lump and fall back to the normal lump if it's empty.

@rihi rihi closed this as completed Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants