like if then loops?
lolno. If then loops would be do while loops, which are a bad coding habit.
I'll list some inefficiencies and redundancies I've found:
- The function patchDword and patchRelativeAddress both attempt to use LE encoding
manually, when it is automatically done by a LE computer!
- When adding the bytes to a patch,
all of the patches use
{vector} += xx, xx, xx, xx, xx, yy, yy, yy, yy, yy;. This might force unneeded reallocation of memory when this piece of code that does exactly the same thing without the unneeded reallocations, and is faster because of less calls to push_back()
{vector}.reserve(10);
{array}[] = { xx, xx, xx, xx, xx, yy, yy, yy, yy, yy };
{vector}.assign({array}, {array}+10);
- There are lots of repetitive code in the individual patches that can be placed in to the base class such as patch checking and the actual patching