speige / WC3MapDeprotector

Warcraft 3 Custom Map deprotector
https://www.youtube.com/@ai-gamer
MIT License
21 stars 3 forks source link

Units duplicated (example: last mission from resurrection of the scourge.) #13

Closed speige closed 4 months ago

speige commented 9 months ago

Can be fixed by deleting these methods:

call CreateNeutralPassiveBuildings_old() call CreatePlayerBuildings_old() call CreateNeutralPassive_old() call CreatePlayerUnits_old()

speige commented 8 months ago

For now, it has to be fixed by hand. Add an explanation of that in the program log.

The issue is with a protected map they take EVERY function called inside function main, inline them all, change the order around, and obfuscate things. So, I have to parse it back to the original. But, all of that code is auto-generated by the editor, so it really needs to be in native editor files like war3mapunits.doo, but in a proprietary binary format instead of jass. So, that recovery is complicated & not perfect yet. If I only recover part of the data, when you save in the editor, it'll regenerate function main & anything missing will be lost permanently. For that reason, I take the original function main & rename it to main2 so that it won't get overwritten. Then as a deprotector your job is to figure out what parts of main2 are duplicate & can be deleted and which parts to keep. It's kind of a pain unfortunately. The alternative is if I don't call main2 you won't have duplicate units, but you could have missing units instead (or missing sounds/etc).

speige commented 4 months ago

Fixed