Advertise

Monday, 16 September 2013

Assembly Language Primer For Hackers (Part 8) Unconditional Branching



Description: This is Part 8 of the "
Assembly Language Primer for Hackers" video series. Please begin here, by watching Part 1, if you have not already done so. In this video we will look at how to alter the program execution flow using unconditional branching. We will look at how to use the JMP instruction to make an unconditional branching to a new location in the code segment and how to use the CALL statement in conjunction with RET to save the program execution state. We will demonstrate all the concepts using very simple code snippets to aid understanding. Please download UnconditionalBranching.s to try out the various exercises discussed in this video.

Code:
.data

    HelloWorld:
        .asciz "Hello World!"

    CallDemo:
        .asciz "Call works!"

.text

    .globl _start

    _start:
        nop  

        call CallMe
        # Write  HelloWorld

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



  
    ExitProgram:
        # Exit the program
        movl $1, %eax
        movl $10, %ebx
        int $0x80

    CallMe:
        movl $4, %eax
        movl $1, %ebx
        movl $CallDemo, %ecx
        movl $11, %edx
        int $0x80
        ret

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.