Created
August 28, 2017 14:08
-
-
Save secrary/c1983ef930d71d894025acd35c911b2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u_char middle_[17]{}; | |
u_char org_middle_[17]{}; | |
// Generate randomly | |
for (size_t i = 0; i < 17; i++) | |
{ | |
middle_[i] = 0x20 + rand() % (0x7F - 0x20); | |
} | |
std::copy(std::begin(middle_), std::end(middle_), org_middle_); | |
u_char last_[17]{}; | |
// loop_1 | |
__asm { | |
lea esi, middle_; | |
mov ecx, 13; | |
loop_1: | |
lodsd; | |
xor eax, 0x1BADC0DE; | |
bswap eax; | |
not al; | |
rol eax, cl; | |
inc ecx; | |
bswap eax; | |
ror eax, cl; | |
dec ecx; | |
not eax; | |
xor eax, 0x98765432; | |
xchg al, ah; | |
mov [esi - 4], eax; | |
sub esi, 3; | |
loop loop_1; | |
} | |
// loop_2 | |
for (size_t i = 0; i < 16; i++) | |
{ | |
middle_[i] ^= key[2]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment