Advertisement
Guest User

Untitled

a guest
Nov 14th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. format PE console
  2. entry main
  3.  
  4. include 'macro/import32.inc'
  5. include 'macro/proc32.inc'
  6.  
  7. section '.data' data readable writeable
  8.  
  9. formatas dd '%d',0
  10. msg1 db 'Iveskite skaiciu: ',0
  11. msg2 db 'Iveskite daugikli: ',0
  12. msg3 db 'Iveskite sekos ilgi: ',0
  13. msg db '%d ',0
  14. num dd ?
  15. multi dd ?
  16. len dd ?
  17. p db "pause>nul",0
  18.  
  19. section '.code' code readable executable
  20. main:
  21.  
  22. push msg1
  23. call [printf]
  24. push num
  25. push formatas
  26. call [scanf]
  27.  
  28. push msg2
  29. call [printf]
  30. push multi
  31. push formatas
  32. call [scanf]
  33.  
  34. push msg3
  35. call [printf]
  36. push len
  37. push formatas
  38. call [scanf]
  39.  
  40. push [num]
  41. push msg
  42. call [printf]
  43.  
  44. mov eax, [len]
  45.  
  46. @multi:
  47.         mov ebx, [num]
  48.         imul ebx, [multi]
  49.         mov [num], ebx
  50.         dec [len]
  51.         push [num]
  52.         push msg
  53.         call [printf]
  54. cmp [len], 0
  55. jg @multi
  56.  
  57. invoke system, p ;Calling function with invoke command
  58. invoke exit, 0
  59.  
  60. section '.idata' import data readable
  61. library msvcrt,'msvcrt.dll'
  62. import msvcrt,\
  63. printf,'printf',\
  64. scanf, 'scanf',\
  65. system,'system',\
  66. exit,'exit'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement