Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- msg db 'Hello world' ,10
- len equ $-msg ; Длина вычитанием
- msg1 db 'Hello worl' ,10
- section .bss
- encrypted resb len
- decrypted resb len
- section .text
- GLOBAL _start
- _start:
- mov ecx, len
- _encrypt:
- add [msg1 + ecx - 1], byte 3
- mov eax, [msg1 + ecx]
- mov [encrypted], eax
- loop _encrypt ; уменьшит ecx на 1, если рег-тр не равен 0
- mov eax, 4
- mov ebx, 1
- mov ecx, msg
- mov edx, len
- int 80h
- _reverse:
- mov ecx, len
- _decrypt:
- sub [msg + ecx - 1], byte 3
- mov eax, [msg + ecx]
- mov [decrypted], eax
- loop _decrypt
- ;sys_write(1, hello, hello_len)
- mov eax, 4
- mov ebx, 1
- mov ecx, msg
- mov edx, len
- int 80h
- mov eax, 1
- mov ebx, 0
- int 80h
- mov eax, 4
- mov ebx, 1
- mov ecx, msg
- mov edx, len
- int 80h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement