Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .686
- .model flat
- public _szyfruj
- .code
- _szyfruj PROC
- push ebp
- mov ebp, esp
- push esi
- push ebx
- mov esi, [ebp+8]
- mov ebx, 52525252H
- mov edx, 0
- szyfrowanie:
- mov al, [esi+edx]
- cmp al, 0
- je koniec
- xor al, bl
- mov [esi+edx], al
- inc edx
- mov ecx, ebx
- shr ecx, 30
- bt ecx, 1
- adc ecx, 0 ;dodajemy bit z rozkazu wyzej ; propsy za `adc`
- bt ecx, 0 ;wynik tego dodawania modulo 2 jesyt na tym bicie
- mov ecx, 0
- adc ecx, 0
- shl ebx, 1
- or ebx, ecx
- jmp szyfrowanie
- koniec:
- pop ebx
- pop esi
- pop ebp
- ret
- _szyfruj ENDP
- END
- c:
- #include <stdio.h>
- int main()
- {
- char tekst[] = "chuj";
- printf("%s", tekst);
- printf("\n");
- szyfruj(tekst);
- printf("%s", tekst);
- getchar();
- getchar();
- getchar();
- getchar();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement