Advertisement
hugol

zad 5

Jan 14th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .686
  2. .model flat
  3.  
  4. public _szyfruj
  5.  
  6. extern _malloc : PROC
  7.  
  8. .data
  9.  
  10. .code
  11.  
  12. _szyfruj PROC
  13.  
  14.  push ebp
  15.  mov ebp, esp
  16.  push ebx
  17.  push edx
  18.  push ecx
  19.  push esi
  20.  
  21.  mov esi, [ebp+8]
  22.  mov eax, 52525252h
  23.  
  24. szyfruj:
  25.  mov cl, [esi]
  26.  test cl, cl
  27.  jz koniec
  28.  
  29.  xor cl, al
  30.  mov byte ptr [esi], cl
  31.  
  32.  mov ebx, eax
  33.  and ebx, 80000000h ;bity 31
  34.  mov edx, eax
  35.  and edx, 40000000h ;bity 30
  36.  shl edx, 1
  37.  
  38.  xor ebx, edx ; w ebx suma modulo2 2 najstarszych bitow
  39.  rol ebx, 1
  40.  
  41.  shl eax, 1
  42.  add eax, ebx
  43.  
  44.  add esi, 1
  45. jmp szyfruj
  46.  
  47. koniec:
  48.  
  49.  pop esi
  50.  pop ecx
  51.  pop edx
  52.  pop ebx
  53.  pop ebp
  54.  
  55.  ret
  56.  
  57. _szyfruj  ENDP
  58.  
  59.  
  60. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement