Advertisement
Guest User

MSIL Boilerplate Snippet

a guest
Nov 17th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. 'source.ilasm':
  2. 'New Program Boilerplate':
  3. 'prefix': 'boilerplate'
  4. 'body': """.assembly extern mscorlib {}
  5. .assembly Program {}
  6. .module Program.exe
  7.  
  8. .class public auto ansi beforefieldinit Program extends [mscorlib]System.Object
  9. {
  10. .method public static void Main(string[] args) cil managed
  11. {
  12. .entrypoint
  13. newobj instance void Program::.ctor()
  14. call instance void Program::Run()
  15. ret
  16. }
  17.  
  18. .method public hidebysig specialname instance void .ctor() cil managed
  19. {
  20. // This is the constructor
  21. ret
  22. }
  23.  
  24. .method public instance void Run() cil managed
  25. {
  26. // This is the Run() method. Effectively main().
  27. ldstr "Hello world!"
  28. call void [mscorlib]System.Console::WriteLine(string)
  29. ret
  30. }
  31. }
  32. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement