|
|
|
|
Title: C Programming, Disassembly, Debugging, Linux, GDB
Added: Mar 12, 2009
Author: themanyone
Duration: 9:56
Description:
A brief introduction to GDB and Assembly Language on Intel processors using the venerable C language and GCC compiler toolchain. This is probably more fun than it is informative (and not even all that fun), but maybe it will give somebody ideas... Documentation:man wprintfman gdbman objdumpman hexdumpUse pinfo -m instead of man for a nice, colorful interface that can be navigated by clicking or using the arrow keys.The IDE used in this video is actually the SciTE text editor. http://www.youtube.com/watch?v=OWYdVmULKW0&feature=relatedMaking simple programs and analysing them with a debugger such as GDB is a great way to learn a little bit about assembly language and machine code. Why delve into machine code during an introductory video? Do we realy need to know that the stack grows downward in memory or that the arguments to a function are pushed onto the stack in reverse order, so they can pop back off in the right order? What's with the wide characters? Why complicate things by adding a function? First of all, functions and assembly are not that hard to grasp. It's just a push and call. We push an address to something onto the stack and call a function. What's so difficult about that? I'm sick of people trying to insulate us from the details. Besides, knowing a little bit about what goes on under the hood makes better hackers and better programmers. That's what we do while learning. We build things and we take them apart to see how they work. I know there is no compelling reason to use wide characters (C90 spec), but I just want to be prepared to understand them when I see them. Yes, it is probably better to use utf-8 and char now that most platforms support it. You can find simple "hello world" programs anywhere that use printf. I wanted my video to be different.And I wanted to let everyone know I'm OK. I haven't died. I've just been busy learning a little C.Oh, and I'll show you why I used a function in a little bit. There is a reason.We have used up nearly the full 10 minutes and it is still just a brief tour. We were only able to cover a small handful of the tools I wanted to demonstrate. Oh well, Linux is so full of toys that it even has a tool to help find them. Type "man apropos" or "pinfo -m apropos" in a terminal for details.Yes, GDB sucks at printing wide character strings, as this video shamelessly points out. It can do it if you include debugging symbols in your program, though, by compiling with gcc -g -o hi hi.c and by downloading a special script for GDB (http://www.linux.com/feature/51836) and putting it in your .gdbrc file. Great.Wide characters of type wchar_t are not necessarily unicode, but, depending on the implementation, do often represent unicode strings. See:http://en.wikipedia.org/wiki/Wide_characterhttp://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8Resources:http://www.iso-9899.info/wiki/Main_Pagehttp://www.cs.princeton.edu/~benjasik/gdb/gdbtut.htmlhttp://en.wikibooks.org/wiki/Category:X86_Disassemblyhttp://en.wikipedia.org/wiki/X86_calling_conventions#cdeclhttp://www.linux.com/feature/51836This video contains parts or visuals of a free software program. You may use it freely according to its particular license:This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Related Videos:
Videos related to 'C Programming, Disassembly, Debugging, Linux, GDB'
Channel: Tech
Tags: programming linux gdb debugging hacking disassembly objdump hexdump tutorial introductory video wide characters unicode utf8 utf16 utf32 utf-8 utf-16 utf-32 international internationalization nationalization character sets wchar_t wprintf pointer values text ide fork web lua return writing process windows child debugger parent code main scite instructions programs howto software tips & tricks computers computer hacks
programming linux gdb debugging hacking disassembly objdump hexdump tutorial introductory video wide characters unicode utf8 utf16 utf32 utf-8 utf-16 utf-32 international internationalization nationalization character sets wchar_t wprintf pointer values text ide fork web lua return writing process windows child debugger parent code main scite instructions programs howto software tips & tricks computers computer hacks
Youtube Comments: 63
keirzev Says:
Dec 8, 2010 - Thank you for posting such an interesting and inspiring tutorial! I am just getting back into programming and want to experiment with C. You have definitely given me some inspiration to actually learn curiously instead of seriously :). (The former seems to always get me so much further!) Thank you!!!!!!
learnwithtechies Says:
Dec 19, 2010 - For the first question: who calls main: learnwithtechies(dot)com/index.php/component/content/article/4-c/25-who-calls-main-in-c-program
kotapaka Says:
Dec 23, 2010 - what an idiot. Yeah, looking at the asm is very useful for a 5 line program and a tutorial on gdb for beginners
pithikoulis Says:
Jan 26, 2011 - Java? C is the mother language of all.
jivealways Says:
Mar 20, 2011 - Thanks for this, really helped me transition to gdb
themanyone Says:
May 19, 2011 - @KiranaForever Good analogy. =D
lukmackul Says:
Jun 4, 2011 - what is the cool editor with auto completion feature?
AlphaNorcalli Says:
Jul 9, 2011 - Emacs for the wolf.
geomorillo Says:
Sep 23, 2011 - aaaah dissasembling i remember those times.... thanks for this, have to read a lot now...
MotaPratik Says:
Oct 7, 2011 - Hii,Which IDE is this ? during writing program its showing Intelligence also..
themanyone Says:
Oct 7, 2011 - It is the SciTE text editor. I have just now added that info to the video description.
sebster3gmail Says:
Nov 2, 2011 - this is a great video and well explained. thank you very much.
yullashu Says:
Dec 12, 2011 - I subbed, good information mate.
2012goingNutz Says:
Dec 27, 2011 - is that how you get all the women? LMAO loser!
mykebulvai Says:
Jan 21, 2012 - It's nerds who created youtube so that LOSERS like yourself can post stupid comments on how much nerds suck. Pathetic. Oh and yeah most rich folk are nerds and statistically speaking nerds get more women than the high school jocks who picked on them. Losers like yourself end up slaving away a dead end job with a fat beer gut and a saggy bitch for a wife.
57373732 Says:
Feb 18, 2012 - plzzz attack this IP Address for bad server for XXX children Terror108.163.213.198:2010
Uberware Says:
Mar 7, 2012 - Lol 2012goingnutz...you think everybody in life is motivated only by having sex with wimen? There are much more fulfilling things in life. Like programming. :)
Uberware Says:
Mar 7, 2012 - I enjoyed it, thank you. :)
sodafountan Says:
Mar 9, 2012 - step 1: watch this videostep 2: program the next stuxnetstep 3: defeat Iran and become an American herostep 4: profit!!!!HA I figured it out! See you on the other side suckers
bondservant4Him Says:
Apr 16, 2012 - Why are you adding 4 to the addresses, I thought that chars were 1 byte not 4
andyknock123 Says:
May 6, 2012 - very interesting.
inanme Says:
May 19, 2012 - not too bad...












bblokar1 Says:
Nov 27, 2010 - Enjoy your bloated jre.