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. <br><br>Please download the JustExit.s and HelloWorldProgram.s code before you begin with the tutorial. <br><br><br><style type="text/css">body { background: #FFF; } </style>
Tags: programming ,
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.
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
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 :)
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.
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"
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!
Really appreciate the time you took to put this series together.
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! :)
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.
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?
I am very much enjoying these videos. Thank you!
Awesome Video...
Just wrote my first assemply program in years. Thanks!!
yo..nice video :)
Awesome! You got my point 11 out of 10 :-)
Thank you.
Really enjoying these videos, thanks a lot for making them :)
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.
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.
Great man...n thanx for such a valuable path to Assembly....
Great series so far! I just watched it once through, and then tried to work ahead of the video the second time.
Thanks!
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.
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.
I agree with everyone else you're doing an excellent job this is awesome thanx
Whent i try to run this command /usr/include/asm-generic/unistd.h it print some errors
./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
please help me
As always! Another great movie! Thank you Vivek!
Nice!!!
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
Thank U Vivek But , I use Windows the instrcution for programming with Nasm in windows and gnu assembler in Linux it s Diffrent
you did awesome jobs thanksssssssss for such video .
well it was speechless ..................... love that it was spicy and very great for sort of knowledge for hungry hackers
great movie..
in the slides (approx @ 7:00 mins) shouldn't it be $0x80?
Great video. Everything was very well explained and simple to follow.
ttttthhhhhannnnkkkkkkk yyyyyoooouuuuuu
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.
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
Love this video Vivek!
I especially like how you walk through using 'as' and 'ld' :)
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.
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?
Excellent tutoriharrilsonwood
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
Fantastic video, thanks Vivek.
In this video you use as file.s -o file.o in later video you add -ggstabs what does this do ?
What a fantasic series this is becoming! Amazing! Your a great teacher
Great video.
I am running ubuntu inside virutalBox on MacOX host
Here is a /usr/include/asm-generic/unistd.h file which has different syscall number. Is here another location where standard syscall are defined in ubuntu.
Thanks.
Great video.
I am running ubuntu inside virutalBox on MacOX host
Here is a /usr/include/asm-generic/unistd.h file which has different syscall number. Is here another location where standard syscall are defined in ubuntu.
Thanks.
Great video.
I am running ubuntu inside virutalBox on MacOX host
Here is a /usr/include/asm-generic/unistd.h file which has different syscall number. Is here another location where standard syscall are defined in ubuntu.
Thanks.
Hi,
Thanks for great video, I know this Is the assembly language tutorial for Linux,
But I tried On mac os x, 10.7.3 It compiles and links fine but My problem is
When I run ./HelloWorldProgram It doesn't give any output,
I mean No hello world is shown on my screen,
I think this has something to do with
movl $HelloWorldString, %ecx
My question is, "is there any way to represent this string in HEX" ?
Or how to make this hello world to work on mac os x ?, thanks
Awesome! Your explanation was very clear and helpful.
Please make more videos, they are SO useful!
Great work Vivek,
I've read about assembly previously but never has it been made so clear, that it seems easy. Now I've even written two programs in assembly, one that exits and one that says "Hello World" awesome!!!
Many thanks :)
As a beginner, I'm finding this to be a great video series. Vivek presents the material in a great way.
I am using NASM, so I converted the source code to the NASM format. I've made it available here: http://www.fritzmahnke.com/2012/04/13/assembly-language-megaprimer-hello-world/
You're awesome!
Awesome video. Really puts an understanding on Assembly.
Great vids - but maybe u could get a better mic ^^
Amazing tutorials!
Amazing tutorials!
Amazing tutorials!
Great work thanks for ur patient , Wen i finished writing the program as shown in the video i found it very difficult to exit from that page in backtrack, from there i lost my direction .pls how i do i go about it encase of next time ..thanks
i register especially to thank you to give us (people in morocco ) the possibility to learn for free courses like this one .
i'am respecting you
keep going please
Go to www.securitytubeforums.net to ask questions about this video and to learn more about all of Vivek's amazing series! We are forming a great community of infosec experts
It was fun to make my first assembly "Hello world\n".
Thank you Vivek!
A suggestion would be better quality videos. 420p is too low to read clearly from.
Thanks anyway!
Amazing Tutorials.....
Very easily taught the hardest . Thanks for this amazing video.
Is it different to deal with registers rax, rbx, rcx, and rdx in 64-bit computer???
And Thanx for the tutorials :D
hi thanks for your great video but when i try to run the program you do it gives me an error message : unknown psuedo-op 'global_start'
i love your accent!!
i'm very happy that i've found this site. Finally found interesting video tutorials about assembly, reverse engineering and more!
I agree...this site has been a fantastic resource. Thanks Vivek
Very simple and complete .. Thanks for the super video series.
Great Thanks vivek.
Ok so the Problem that i am having is when i pull up the Syscalls from unistd. they are a lot different than what your getting... I am running i686 architecture with 32-bit and 64-bit CPU op-modes.. my directory is actually /usr/include/asm-generic. It says that the file contains the system call numbers for the layout of the x86 - 64 architecture... I get.... #define _NR_io_setup 0 & #define _NR_io_destroy 1. I followed along up till this point and everything has executed fine.. with the same results that you got.. I am going to hold off for now and wait for a reply from you. Thank you so much for any assistance you can offer.. I am learning a lot from your videos... The best tuts I have found!!
the lists with the system calls are in:
/usr/include/i386-linux-gnu/asm
the file with list is:
unistd_32.h