Advertise

Monday, 16 September 2013

Assembly Language Primer For Hackers (Part 4) Hello World



Description
: This is Part 4 of the "Assembly Language Primer for Hackers" video series. Please begin here with Part 1, if you have not already done so. In this video we will look at the structure of assembly language programs - .data, .bss, .text segments, how to pass arguments to linux system calls in assembly, using GAS and LD to assemble and link code and finally in the end we go through a step by step approach to create our first "Hello World" program. Please download the JustExit.s andHelloWorldProgram.s code before you begin with the tutorial. 

Justexit.s code
Code:
.text

.globl _start

_start:
    movl $1, %eax
    movl $0, %ebx
    int $0x80

HelloWorldProgram.s Code
Code:
# My first Assembly program

.data

HelloWorldString:
    .ascii "Hello World\n"

.text

.globl _start

_start:
    # Load all the arguments for write ()

    movl $4, %eax
    movl $1, %ebx
    movl $HelloWorldString, %ecx
    movl $12, %edx
    int $0x80

    # Need to exit the program

    movl $1, %eax
    movl $0, %ebx
    int $0x80


Disclaimer: We are a infosec video aggregator and this video is linked from an external website. The original author may be different from the user re-posting/linking it here. Please do not assume the authors to be same without verifying. 

Security tube is also providing linux Assembly course for 99$ here -> http://securitytube-training.com/online-...ly-expert/
 
World of Hacker © 2011 Creative Commons License
World of Hacker by KroKite is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at http://www.worldofhacker.com.
Permissions beyond the scope of this license may be available at https://groups.google.com/forum/#!newtopic/hackerforum.