Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. format PE console
  2. entry s_start
  3.  
  4. include 'C:/Users/User Account/Documents/AJ/FASM/INCLUDE/macro/import32.inc'
  5.  
  6. section '.data' data readable writeable
  7. ; local
  8. _str_title db "X-Board for console 1.0", 0
  9. _str_guide db "Guide:", 0
  10. _str_board db "Board:", 0
  11. _str_play db "play: ", 0
  12. ; console system
  13. _scan db "%31s", 0
  14. _endl db 10, 0
  15. _c_pause db "pause>nul", 0
  16. _c_clear db "cls", 0
  17.  
  18. section '.code' code readable executable
  19.  
  20. s_start:
  21.  
  22. ; store base pointer
  23. mov ebp, esp
  24.  
  25. ; print title
  26. push _str_title
  27. call [printf]
  28. add esp, 4
  29.  
  30. ; pause
  31. push _c_pause
  32. call [system]
  33. add esp, 4
  34.  
  35. ; create board
  36. ; 2 bytes = board data
  37. ; 100 bytes = board print
  38. ; total = 102 bytes
  39. sub esp, 104
  40. ; initiate board data
  41. mov word [ebp-2], 0
  42. ; paste "Guide:" at the beginning
  43. mov esp, _str_guide
  44. ; null terminate
  45. mov byte [ebp-96], 0
  46.  
  47. ; print data
  48. push esp
  49. call [printf]
  50.  
  51. ; free memory
  52. pop esp
  53. add esp, 104
  54.  
  55. ; pause
  56. push _c_pause
  57. call [system]
  58. add esp, 4
  59.  
  60.  
  61. ; main loop
  62. .loc_main:
  63.  
  64.  
  65.  
  66. ; exit
  67. push 0
  68. call [exit]
  69.  
  70.  
  71. section '.idata' import data readable
  72.  
  73. library msvcrt, 'msvcrt.dll'
  74.  
  75. import msvcrt,\
  76. printf, 'printf',\
  77. scanf, 'scanf',\
  78. system, 'system',\
  79. exit, 'exit'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement