Skip to content

Instantly share code, notes, and snippets.

@msm-code
Created October 21, 2016 09:35
Show Gist options
  • Save msm-code/80f647153cd0735165056a58785fecaf to your computer and use it in GitHub Desktop.
Save msm-code/80f647153cd0735165056a58785fecaf to your computer and use it in GitHub Desktop.
paper.cpp.9fe969957d8333124adfd59d98c59b29
void encrypted_memcpy(char *to, char *from, int len) {
if (is_in_encrypted_section(to)) {
if (is_in_encrypted_section(from)) {
memcpy(to, from, len);
} else {
memcpy_and_encrypt(to, from, len);
}
} else {
if (is_in_encrypted_section(from)) {
memcpy_and_decrypt(to, from, len);
} else {
memcpy(to, from, len);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment