Advertisement
Guest User

Untitled

a guest
Sep 27th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2.         msg db 'Hello world' ,10
  3.         len equ $-msg ; Длина вычитанием
  4.  
  5.         msg1 db 'Hello worl' ,10
  6.  
  7. section .bss        
  8.         encrypted resb len
  9.         decrypted resb len
  10.  
  11.  
  12. section .text
  13.         GLOBAL _start
  14.  
  15. _start:
  16.    
  17.     mov ecx, len   
  18.     _encrypt:
  19.         add [msg1 + ecx - 1], byte 3
  20.                 mov eax, [msg1 + ecx]
  21.                 mov [encrypted], eax
  22.     loop _encrypt ; уменьшит ecx на 1, если рег-тр не равен 0
  23.  
  24.  
  25.         mov eax, 4
  26.         mov ebx, 1
  27.         mov ecx, msg
  28.         mov edx, len
  29.         int 80h
  30.  
  31.         _reverse:
  32.  
  33.  
  34.  
  35.  
  36.  
  37.         mov ecx, len
  38.         _decrypt:
  39.                 sub [msg + ecx - 1], byte 3
  40.                 mov eax, [msg + ecx]
  41.                 mov [decrypted], eax
  42.         loop _decrypt        
  43.  
  44.         ;sys_write(1, hello, hello_len)
  45.  
  46.         mov eax, 4
  47.         mov ebx, 1
  48.         mov ecx, msg
  49.         mov edx, len
  50.         int 80h
  51.  
  52.  
  53.         mov eax, 1
  54.         mov ebx, 0
  55.         int 80h
  56.  
  57.         mov eax, 4
  58.         mov ebx, 1
  59.         mov ecx, msg
  60.         mov edx, len
  61.         int 80h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement