Author Topic: Hello World  (Read 326 times)

sinsi

  • Member
  • *****
  • Posts: 1187
Hello World
« on: August 11, 2019, 07:23:12 PM »
Code: [Select]
.assembly PrintString {}
 
.method static public void main() il managed
{
    .entrypoint
    .maxstack 8
 
    ldstr   "Hello, World"
    call    void [mscorlib]System.Console::WriteLine(class System.String)
    ldstr   "Press Enter to continue"
    call    void [mscorlib]System.Console::WriteLine(class System.String)
    call    int32 [mscorlib]System.Console::Read()
    pop
    ret
}
I can walk on water but stagger on beer bourbon.

jj2007

  • Member
  • *****
  • Posts: 9794
  • Assembler is fun ;-)
    • MasmBasic
Re: Hello World
« Reply #1 on: August 11, 2019, 08:41:26 PM »
Which language is that, Sinsi?

Vortex

  • Member
  • *****
  • Posts: 2030
Re: Hello World
« Reply #2 on: August 11, 2019, 08:55:41 PM »
It must be C#

sinsi

  • Member
  • *****
  • Posts: 1187
Re: Hello World
« Reply #3 on: August 11, 2019, 09:04:59 PM »
ilasm

Quote
Microsoft Intermediate Language (MSIL) is a language used as the output of a number of compilers (C#, VB, .NET, and so forth).
Ten points to Vortex.
I can walk on water but stagger on beer bourbon.

felipe

  • Member
  • *****
  • Posts: 1249
  • Eagles are just great!
Re: Hello World
« Reply #4 on: August 12, 2019, 12:26:14 AM »
I can understand the load string, the call procedure and the return from procedure, but what kind of high level pop is that? I mean what are you popping with it?  Maybe the stack pointer was pushed (and it's a qword in size) with the .maxstack 8 directive and the pop instruction without arguments uses the stack pointer as default destination operand? :icon_idea:
You know i'm trying to get some points as vortex did here... :eusa_dance:
Felipe.

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: Hello World
« Reply #5 on: August 12, 2019, 12:33:52 AM »
Code: [Select]
SET Path=C:\Windows\Microsoft.NET\Framework64\v2.0.50727
ilasm.exe Hello.ilasm
:wink2:
helper:
Code: [Select]
ECHO SET Path= > test1.cmd
dir /B c:\windows\Microsoft.NET\Framework\v2* >> test1.cmd
dir /B c:\windows\Microsoft.NET\Framework\v4* >> test1.cmd
ECHO PAUSE >> test1.cmd

Getting Started With .NET IL
May the source be with you