Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char temp_char;
- int i;
- __asm
- {
- // for loop starts
- mov i, 0
- jmp checkend
- forloop1:
- mov eax,i
- add eax, 1
- mov i, eax
- checkend:
- cmp i, [ebp+8]
- jge endfor1
- mov ecx, i
- //og code
- push eax // Save values contained within register to stack
- push ecx
- movzx ecx, temp_char
- push ecx // Push argument #2
- lea eax, EKey
- push eax // Push argument #1
- call encrypt4
- add esp, 8 // Clean parameters of stack
- mov temp_char, al // Move the temp character into a register
- pop ecx
- pop eax
- // end of og code
- mov temp_char, ecx
- endfor1:
- mov eax, temp_char
- mov EChars, temp_char
- }
- return;
- __asm
- {
- encrypt4:
- push ebp // Set stack
- mov ebp, esp // Set up the base pointer
- mov eax, [ebp + 8] // Move value of parameter 1 into EAX
- mov ecx, [ebp + 12] // Move value of parameter 2 into ECX
- push edi // Used for string and memory array copying
- push ecx // Loop counter for pushing character onto stack
- not byte ptr[eax] // Negation
- add byte ptr[eax], 0x04 // Adds hex 4 to EKey
- movzx edi, byte ptr[eax] // Moves value of EKey into EDI using zeroes
- pop eax // Pop the character value from stack
- xor eax, edi // XOR character to give encrypted value of source
- pop edi // Pop original address of EDI from the stack
- rol al, 1 // Rotates the encrypted value of source by 1 bit (left)
- rol al, 1 // Rotates the encrypted value of source by 1 bit (left) again
- add al, 0x04 // Adds hex 4 to encrypted value of source
- mov esp, ebp // Deallocate values
- pop ebp // Restore the base pointer
- ret
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement