Advertisement
dllbridge

Untitled

Jul 22nd, 2023
1,696
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. section '.data' data readable writeable
  12.  
  13.  
  14.            n     dd  99  ; Переменная n (4 байта)
  15.  
  16.     sz_Hello     db  'Hello world ! n = %d', 10, 10, 0
  17. ;------------------------------------------------                   Код программы:
  18. section '.code' code readable executable
  19.  
  20.  
  21.  start:    push [n]
  22.  
  23.            push sz_Hello
  24.  
  25.            call [printf]
  26.  
  27.            mov eax, 15
  28.  
  29.            add eax, [n]
  30.  
  31.            cmp eax, 100
  32.            jz  L_03             ; Если eax == 100
  33.            jg  L_02             ; Если eax  > 100
  34.  
  35.            cinvoke  printf, <"eax = %3d < 100", 10, 0>, eax
  36.            jmp L_04
  37.  L_02:     cinvoke  printf, <"eax = %3d > 100", 10, 0>, eax
  38.            jmp L_04
  39.  L_03:     cinvoke  printf, <"eax = %3d = 100", 10, 0>, eax
  40.  
  41.  L_04:     cinvoke  scanf, <"%d", 10, 0>, n
  42.            invoke   ExitProcess, 0
  43.  
  44.  
  45.  
  46. ;------------------------------------------------           Подключение библиотек:
  47. section '.idata' import data readable
  48. library kernel32, 'kernel32.dll',\
  49.         msvcrt,   'msvcrt.dll'
  50.  
  51. import msvcrt,\
  52.        printf, 'printf',\
  53.        scanf,  'scanf'
  54.  
  55.  
  56.  
  57.                    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement