Advertisement
dllbridge

Untitled

Nov 20th, 2022
1,260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. format  PE console
  4. entry   start
  5. include 'win32ax.inc'
  6. include 'api\kernel32.inc'
  7.  
  8.  
  9.  
  10. ;------------------------------------------------
  11. ;
  12. ;
  13. ;    Создание переменных !
  14. ;
  15. ;------------------------------------------------
  16. section '.data' data readable writeable
  17.  
  18.            x     db  45
  19.            y     db  50
  20.            n     dd  92
  21.            r_1   dw  ?
  22.            r_2   dw  ?
  23. ;------------------------------------------------
  24. ;
  25. ;
  26. ;    Код программы
  27. ;
  28. ;------------------------------------------------
  29. section '.code' code readable executable
  30.  
  31.  
  32.    start:  mov eax, 1
  33.  
  34.            add eax, [n]
  35.  
  36.            cmp eax, 100
  37.            jz  L_03
  38.            jg  L_02
  39.  
  40.            cinvoke  printf, <"eax = %3d < 100", 10, 0>, eax
  41.            jmp L_04
  42.  L_02:     cinvoke  printf, <"eax = %3d > 100", 10, 0>, eax
  43.            jmp L_04
  44.  L_03:     cinvoke  printf, <"eax = %3d = 100", 10, 0>, eax
  45.  
  46.  L_04:     cinvoke  scanf, <"%d", 10, 0>, n
  47.            invoke   ExitProcess, 0
  48.  
  49.  
  50. ;------------------------------------------------
  51. ;
  52. ;
  53. ;    Подключение библиотек
  54. ;
  55. ;------------------------------------------------
  56.  
  57. ; CINVOKE макрос в составе FASM.  Позволяет вызывать CDECL-функции.
  58.  
  59.  
  60.  
  61.  
  62.  
  63. section '.idata' import data readable
  64. library kernel32, 'kernel32.dll',\
  65.         msvcrt,   'msvcrt.dll'
  66.  
  67. import msvcrt,\
  68.        printf, 'printf',\
  69.        scanf, 'scanf'
  70.  
  71.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement