MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / CopyProtection_EncodeInput

Method CopyProtection_EncodeInput

Source/CopyProtection.cpp:202–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void cFodder::CopyProtection_EncodeInput() {
203 int16 bx = mInput[0] & 0xFF;
204 int16 cx = 0;
205
206 for (auto& Character : mInput) {
207 cx -= bx;
208
209 if (Character == -1)
210 return;
211
212 rollLoop:;
213
214 bx = (bx << 8) | (bx >> 8);
215
216 Character ^= (bx & 0xFF);
217 Character ^= (cx & 0xFF);
218 --Character;
219
220 if (Character == -1)
221 goto rollLoop;
222 }
223}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected