The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.

Assembly - Guest

  • 6th May 2025 10:01:35 PM
  • TEXT
  • 57 views
  1. %include "../include/io.mac"
  2.  
  3. extern printf
  4. global base64
  5.  
  6. section .data
  7.         alphabet db 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
  8.         fmt db "%d", 10, 0
  9.  
  10. section .text
  11.  
  12. base64:
  13.         ;; DO NOT MODIFY
  14.  
  15.     push ebp
  16.     mov ebp, esp
  17.         pusha
  18.  
  19.         mov esi, [ebp + 8] ; source array
  20.         mov ebx, [ebp + 12] ; n
  21.         mov edi, [ebp + 16] ; dest array
  22.         mov edx, [ebp + 20] ; pointer to dest length
  23.  
  24.         ;; DO NOT MODIFY
  25.  
  26.  
  27.         ; -- Your code starts here --
  28.         xor ecx, ecx
  29. loop:
  30.         mov ebx, [ebp + 12]
  31.         cmp ecx, ebx
  32.         jge gata
  33.  
  34. ;; iau fiecare caracter si traduc octetul lu    i in binar
  35.  
  36. tradu_char:
  37.         mov al, [esi + ecx]
  38.  
  39.         xor ebx, ebx
  40.         mov ebx, 8
  41.  
  42.         loop_tradus:
  43.                 cmp ebx, 0
  44.                 jle tradus
  45.  
  46.                 shl al, 1       ;     esi:Man      edi: 101010101010101010101010
  47.                 jc pune_unu
  48.  
  49.                 mov byte [edi], '0'
  50.                 jmp repeta
  51.  
  52.         pune_unu:
  53.                 mov byte [edi], '1'
  54.  
  55.         repeta:
  56.                 inc edi
  57.                 dec ebx
  58.                 jmp loop_tradus
  59.  
  60.         tradus:
  61.  
  62. inc ecx
  63. jmp loop
  64.  
  65.  
  66. ;; acum in edi este un sir de 1 si 0
  67. ;; acest sir reprezinta sirul esi in binar
  68.  
  69. ;; parcurg sirul de 1 si 0 si transform inapoi in caractere
  70.  
  71. gata:
  72. mov ecx, edi              ; ecx = pointer la sir binar
  73. xor edi, edi
  74. mov edi, [ebp + 16]       ; resetezi edi la începutul dest
  75. mov ebx, [ebp + 12]
  76.  
  77. jmp final
  78. mov eax, ebx
  79. imul eax, 8
  80. mov ebx, eax
  81. xor eax, eax                ; număr total de biți abcd: a:10101010
  82. xor edx, edx
  83.  
  84. loop_scriere:
  85.  
  86.     jmp final
  87.  
  88.     xor ah, ah            ; valoare de 6 biți
  89.  
  90.                                                         ;ecx: 101010 101010 101010 101010
  91.     mov al, 6
  92.  
  93. loop_biti:
  94.     cmp al, 0                    
  95.     jle convertit
  96.  
  97.     shl ah, 1                    ;  0|00101010
  98.     cmp byte [ecx], '1'
  99.     jne zero
  100.     or ah, 1
  101.  
  102. zero:
  103.     inc ecx
  104.     dec al
  105.     jmp loop_biti
  106.  
  107. convertit:
  108.         movzx eax, ah
  109.     mov al, [alphabet + eax]
  110.         mov [edi], al
  111.     inc edi
  112.     sub ebx, 6
  113.         inc edx
  114.     jmp loop_scriere
  115. final:
  116.  
  117.         mov ebx, [ebp + 12]
  118.         mov esi, [ebp + 8]
  119.  
  120.         ; -- Your code ends here --
  121.  
  122.  
  123.         ;; DO NOT MODIFY
  124.  
  125.         popa
  126.         leave
  127.         ret
  128.  
  129.         ;; DO NOT MODIFY

Raw Paste
Recent Pastes
NEW UPDATED 07.05.25 ÇP FOLDERS
  • 20 mins
  • 53
  • secs ago

A
  • 50 mins
  • 46
  • secs ago

Assembly
  • 2 hours
  • 44 mins
  • 36

TEEN GIRLS CP PACK
  • 3 hours
  • 34 mins
  • 37

T33n collection Cute
  • 3 hours
  • 51 mins
  • 54

About Us - Terms of Use