Dark Group sulton residual zero
The simple implementation of XOR dynamic encryption first of all, I would like to express my special thanks to Yan binlang's great guidance to me.
Then, simply put, the code is followed by comments, which should be detailed! 4-byte Encryption
The efficiency is good. In a loopd loop, an exclusive or encrypted Key is added with 2, so that each 4 bytes is converted into an exclusive or value.
My blog is http://hi.baidu.com/
Pushad // all registers into the stack
Call xxxxxxxx // The Next line of code in CALL is pop ebx.
Pop ebx // an EBX pop-up stack
Sub ebx, xxxxxxxx // xxxxxxxx represents the memory address of the last row, that is, the pop ebx row (before the relocation)
Add ebx, xxxxxxxx // xxxxxxxx indicates the address before the feature is relocated.
Mov ecx, 5 // 5 cycles
Mov edx, 12345678 // pass 12345678 to EDX as the initialization KEY of the first loop
Mov eax, dword ptr [ebx] // transfers the memory location of ebx to eax
Xor eax, edx // encrypt the result of XOR encryption between EDX and EAX in EAX
Mov dword ptr [ebx], eax // transfers encrypted content to ebx
Add ebx, 4 // The memory address of ebx plus 4 bytes
Add edx, 2 // dynamically encrypt the edx value plus 2 cycles plus 2 at a time
Loopd short xxxxxxxx // jump to mov eax, dword ptr [ebx]. This is a loop. The number of loops is shown in the figure above. 5 indicates 5 loops.
Popad // all register fetch Stack
Original jmp entry point // jump to the original entry point