Quote:
Originally Posted by Spirit_12
Why part of code are you rewriting? Also can we change the DIV signatures to offsets ?
|
Just small refactoring.
No, we can't. Cause we change one block of asm code to the new one.
I will explain.
See the screenshot. Actually we need replace only one instruction is `sar eax, 2` which means bit shift and it's short notation for dividing by 4: maxCharacterCompletionScore / 4
But our instructions set is bigger than 3 bytes cause we want customize player count, e.g 10 instead 4.
We patch bit shifting and other commands, but copy them to our memory block to ensure flow still be correct.
More info about what really happend you can see in file:
https://github.com/spumer/Left4Fix/b...escription.txt
So, on screenshot you also can see instructions for 2.2.1.2 and 2.2.1.3 versions have different order and we can't just move by offset and apply patch. Instruction can be reordered.
Offsets cool thing when you change one byte or constant sequence. Here we have non-constant sequence.
----
Other idea to simplify all of that is store original memsig and patch bytes in gamedata. It's really good, but taking into other trouble - we need include TEAM_SIZE into patch bytes.
Idk how to make it clear and comfortable to use. This is why we have TEAM_SIZE defined on build stage.
----
With fixes for 2.2.1.3 update i will migrate project to ambuild and anyone can build it for windows and linux as well ;)