Answer the question
In order to leave comments, you need to log in
How to write "Hello World" in machine code?
Recently I came across a video where some crazy person wrote a program that prints the words "Hello World" in binary / machine code to the console (to be honest, I'm not sure what it is).
Link to video.
Please tell me how you can repeat the result (do not advise copying the code from the video, I want to understand exactly how to do this)? Is there any literature on this?
Answer the question
In order to leave comments, you need to log in
You just need to study the assembler and everything will become clear.
Each assembler instruction is translated "verbatim" into machine code.
Those. for example, the command pushl %edx
will turn into one byte 82
. For example, an assembler program:
push %ebp
mov %esp,%ebp
call 0x8048298
cmp $0x41,%eax
jne 0x80483ce
push $0x80484b0
call 0x80482c8
add $0x4,%esp
mov $0x0,%eax
mov %ebp,%esp
pop %ebp
ret
0x55 0x89 0xe5 0xe8 0xfc 0xff 0xff 0xff
0x83 0xf8 0x41 0x75 0x0d 0x68 0x00 0x00
0x00 0x00 0xe8 0xfc 0xff 0xff 0xff 0x83
0xc4 0x04 0xb8 0x00 0x00 0x00 0x00 0x89
0xec 0x5d 0xc3
"Stop the Earth - I'll get off.."
Do you know any programming language?
There is nothing special there. Take any program, open it in a hex editor, print out a hex or bin representation, open a new document in a hex editor, type the dump manually, save it, run it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question