Assembly Primer For Hackers (Part 4) Hello World

Posted By: SecurityTube_Bot
Posted On: Mon 21 Feb 2011
Views: 28297
Share this video:
Share it on Facebook Share it on Twitter Share it on Reddit Share it on Digg Share it on Stumbleupon
Support SecurityTube:


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 and HelloWorldProgram.s code before you begin with the tutorial.  


Tags: programming ,

This video is part of the following groups:

1. Assembly Language Megaprimer for Linux ( 11 videos)


Comments (44)

starofale on Tue 08 Mar 2011

Excellent assembly language tutorial! I'm working my way through your videos and they've all been great so far. Keep up the good work.

Thanks :D

dimpavloff on Sun 13 Mar 2011

A really useful video collection, your pace is really spot on, and your a good presenter - you seem well prepared for what you're about to say and you're recapping in the end what you've showed us. Thanks! and keep up the good work :)

dave on Tue 15 Mar 2011

great videos. I've tried several different assembly tutorials and yours is by far the best I have seen, very easy to follow and understand.

KINGSABRI on Sun 20 Mar 2011

Thanks
People Who using fedora Will find the "unistd.h" file contains includes for
unistd_32.h and unistd_64.h

ls /usr/include/asm/unistd*
/usr/include/asm/unistd_32.h /usr/include/asm/unistd_64.h /usr/include/asm/unistd.h

so our "call" file is "unistd_32.h"

Tim on Mon 21 Mar 2011

Thank you so much for this!! I'm a student at UCLA studying computer science, and I learn so much watching your videos. I just thought I'd leave a comment to let you know how much I appreciate you taking the time to put together these excellent lectures, which supplement what I'm learning at school perfectly!

gnalsa on Sat 02 Apr 2011

Really appreciate the time you took to put this series together.

Zukin on Wed 06 Apr 2011

Vivek,

This is amazing. You have such a fine talent of guiding students through a meaningful comprehension of programming concepts & methods! I had a lot of "Aha!" moments watching this video. I've been taking notes, writing down everything you say, and doing the coding with you step-by-step. You're fantastic. PLEASE produce more videos, for the rest of your life. You're awesome! :)

kjbbb on Sun 10 Apr 2011

great intro. these videos are baller, thanks for taking the time. they have thus far been the most helpful source for me. the pace is good too.

kenshin777 on Sun 10 Apr 2011

Excelent tutorial, thanks for sharing your knowledge, I got 2 questions:

is necessary declare .globl _start ?, or the program can just start with _start method?

it's because if I don't declare .globl _start, the system can't see _start?

hubritic on Tue 12 Apr 2011

I am very much enjoying these videos. Thank you!

Immense on Sat 23 Apr 2011

Awesome Video...

Col_Loki on Fri 29 Apr 2011

Just wrote my first assemply program in years. Thanks!!

ran on Tue 03 May 2011

yo..nice video :)

albay on Tue 10 May 2011

Awesome! You got my point 11 out of 10 :-)

Thank you.

Gripen on Fri 20 May 2011

Really enjoying these videos, thanks a lot for making them :)

Joey on Wed 25 May 2011

Another high quality video! Not that this is necessary however putting a few challenge questions/exercises at the end of each learning section to help reinforce the topic covered would be greatly welcome.

Please continue to do the amazing work you have started.

JohnM on Sat 28 May 2011

Yeah, these are good, I haven't assembled for almost 10 years, and these videos are getting me back into the swing. Good pace, covering the right details.

praveenarena on Sun 29 May 2011

Great man...n thanx for such a valuable path to Assembly....

Sir_Willard on Sun 05 Jun 2011

Great series so far! I just watched it once through, and then tried to work ahead of the video the second time.
Thanks!

cyruslok on Sun 12 Jun 2011

Great video. You have compacted complicated theory with this short video through demonstration, it is easier to digest than reading the whole text book. Each video i have to watch it twice because i cannot remember them, and i also pause and do the lab base on your demonstration. Hope to see more of your video series.

3ntropy on Mon 13 Jun 2011

You are the best! Keep up the good work, and f**ck some of the courses that gov. offers and you come out with sh*tty knowledge. Thank you.

redBandit on Wed 22 Jun 2011

I agree with everyone else you're doing an excellent job this is awesome thanx

nijat11 on Sat 25 Jun 2011

Whent i try to run this command /usr/include/asm-generic/unistd.h it print some errors

nijat11 on Sat 25 Jun 2011

./unistd.h: line 6: /bin: This is directory
./unistd.h: line 7: auxvec.h: comand not found
./unistd.h: line 8: auxvec.h: comand not found
./unistd.h: line 9: auxvec.h: comand not found
./unistd.h: line 10: auxvec.h: comand not found
./unistd.h: line 11: auxvec.h: comand not found
./unistd.h: line 12: unexpected EOF while searching the corresponding `''
./unistd.h: line 861: syntax error: unexpected end of file

nijat11 on Tue 28 Jun 2011

please help me

xplt on Fri 08 Jul 2011

As always! Another great movie! Thank you Vivek!

in0cula on Fri 08 Jul 2011

Nice!!!

in0cula on Mon 18 Jul 2011

I have backtrak 5 but there isn't the list of calling numbers in the file:

vim /usr/include/unistd.h

the program run, all worked

the-joker on Wed 20 Jul 2011

Thank U Vivek But , I use Windows the instrcution for programming with Nasm in windows and gnu assembler in Linux it s Diffrent

security123 on Thu 21 Jul 2011

you did awesome jobs thanksssssssss for such video .

mac on Wed 27 Jul 2011

well it was speechless ..................... love that it was spicy and very great for sort of knowledge for hungry hackers

Ente on Sat 30 Jul 2011

great movie..
in the slides (approx @ 7:00 mins) shouldn't it be $0x80?

HBG on Tue 16 Aug 2011

Great video. Everything was very well explained and simple to follow.

Sceleratus on Tue 30 Aug 2011

ttttthhhhhannnnkkkkkkk yyyyyoooouuuuuu

Clint on Tue 13 Sep 2011

Excellent videos.

To those wanting to quickly pull up the Syscalls from unistd.h I use cat /usr/include/asm/unistd_32.h | grep "__NR_exit" to get the syscall for exit.

I am on backtrack 4 and when I check the unistd.h it simply defines unistd_32.h and unistd_64.h.

The above cat and grep combo I use is for convenience. If you were on a system where all were defined in unistd.h you would simply do cat /usr/include/asm/unistd.h | grep "syscall" where syscall is the one you wish to view.

d4lt3r.12 on Wed 14 Sep 2011

root@bt:~/asm/file# gdb ./HelloWorldProgram
GNU gdb (GDB) 7.1-ubuntu

Reading symbols from /root/asm/file/HelloWorldProgram...(no debugging symbols found)...done.

So while using list command i get following:
(gdb) list
No symbol table is loaded. Use the "file" command.

Can Anyone tell me how to list the program!! is it a problem or probably a bug!!


While disassembling this program on gdb i got the above

p0djackel on Wed 21 Sep 2011

Love this video Vivek!

I especially like how you walk through using 'as' and 'ld' :)

stonemerc on Sat 15 Oct 2011

Sorry for the ignorance. I am very new to this. Which assembler are we using, is it gdb. If so would I have to load this module to linux? Thanks for your help in advance.

proff_g33k on Sun 04 Dec 2011

awesome tutorial...

as in /usr/include/asm-generic/unistd.h file,i have sys call values are different as for exit is 93,for write is 64 etc

so should i pass all these values when i write assembly program?
however when i write values(such as 1 for exit)according to this video ,program runs succesfully..so what's those different values for?

curious1 on Wed 07 Dec 2011

Excellent tutoriharrilsonwood

curious1 on Wed 07 Dec 2011

previous post is fail post what i meant to post was

Excellent tutorial. The files for the syscall numbers in ubuntu are a litle differrent

user@ubuntu:~/assembly$ ls -lh /usr/include/asm/uni*
-rw-r--r-- 1 root root 9.7K 2011-11-08 18:34 /usr/include/asm/unistd_32.h
-rw-r--r-- 1 root root 22K 2011-11-08 18:34 /usr/include/asm/unistd_64.h
-rw-r--r-- 1 root root 82 2011-11-08 18:34 /usr/include/asm/unistd.h

tecuani on Tue 27 Dec 2011

Fantastic video, thanks Vivek.

Jamie.R on Thu 12 Jan 2012

In this video you use as file.s -o file.o in later video you add -ggstabs what does this do ?

ReDeeM on Mon 30 Jan 2012

What a fantasic series this is becoming! Amazing! Your a great teacher

Login to post a comment