daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest Aug 12th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use32
  2.  
  3. ; rc4_decrypt (uint8_t i, uint8_t j, uint8_t *const key, uint8_t *data_decrypt, uint8_t *data_encrypt, uint length)
  4. ; ebx: key
  5. ; ecx: length
  6. ; ebp: i
  7. ; edx: j
  8. ; edi: data_decrypt
  9. ; esi: data_encrypt
  10.  
  11. @@rc4_decrypt_loop:
  12. ; i++;
  13. inc   ebp
  14. and   ebp,0xFF
  15. ; a = key[i];
  16. ; (gleichzeitig werden die höherwertigen drei Byte von eax auf 0 gesetzt)
  17. movzx eax,byte [ebx+ebp]
  18. ; j += a;
  19. add   dl,al
  20. ; b = key[j]
  21. mov   ah,[ebx+edx]
  22. ; key[i] = b;
  23. mov   [ebx+ebp],ah
  24. ; key[j] = a;
  25. mov   [ebx+edx],al
  26.  
  27. ; k = [(a + b) & 0xFF]
  28. add   al,ah
  29. xor   ah,ah ; Da das Highword immer noch 0 ist (wegen movzx) entspricht dies
  30.             ; einem and eax,0xFF
  31. mov   ah,[ebx+eax]
  32. ; t = *(data_encrypt++)
  33. lodsb
  34. ; t ^= k
  35. xor   al,ah
  36. ; *(data_decrypt++) = t
  37. stosb
  38.  
  39. ; while (length--)
  40. @@rc4_decrypt:
  41. @@loop  rc4_decrypt_loop
  42.  
  43. rc4_decrypt_return:
  44. ; return
  45. ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top