Description: This is Part 3 of the "Assembly Primer for Hackers" video series. Please begin watching from Part 1 if you have not already done so. <br><br>GDB (GNU Debugger) is probably one of the most important tools one needs to be familiar with in order to be a good assembly language programmer. In this video we go through a quick primer on how to use GDB to disassemble code, set breakpoints, trace through code, examine CPU registers and memory locations, examine the program stack and many other important use cases which will help us in later videos when we actually start coding in Assembly and want to debug our code. We use SimpleDemo.c as the program in this video. <br><br> <br><style type="text/css">body { background: #FFF; } </style> </div>
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.
nice vdo
thank you!
Thanks man
Review:
#--> To Attaching an Application in GDB
gdb ./ApplicationPath
#--> To find farther information about a command
help command
#--> To List the Application Code w/ Specific line
list LineNumber
#--> To Run the Application
run
-> if application needs argument(s)/input(s)
run arg1 arg2 argx
#--> To Disassemble a particular function
disassemble FunctionName
#--> To make Break Point in Particular Line
break LineNumber
#--> To Step forward into application - Step One instruction exactly
s
--> of
stepi
#--> To Show current Registers' information
info registers
#--> To Examine the Value in Particular Address (by hex)
x/10xw 0xMemoryAddr
Thanks a lot. Step by step guide is really nice.
Really appreciate your work.
I am running Dev C++ and I included the C compliler with the package. I cannot get Dev to compile. The compiler gets to the atoi line and halts. I get the error message invalide conversion from char to const char. I ran another program (simple one of averaging two numbers) and asked it to debug. While it is in a Windows environment (I know, that is the next vid), I can still see what is happening and understand a little what is going on.
Being a newbie I really appreciate your work here and the increased knowledge you have given me.
I like your style of teaching you present the material in clear language and i like the way you do a recap at the end as well . I think it would be cool if you could have a bullet point power point at the end to abstract the concepts covered.
This is a complicated subject, but you work very hard at making it approachable. Even with a programming background - assembly feels like Mars :')
Thank you!
Thanks for the videos! I'm really enjoying this and learning a lot.
As always! Another great movie! Thank you Vivek!
Thank you so much for taking the time to make these videos. College Course < Your Videos
Sir well your lecture's are pretty cool,and every new episode is such a importance in itself typically good for newbies. I 'm enjoying a lot. One thing i like most as you know where to stress at topics
thanx to you
too good..thanks a lot for such a clear video..
wow u r amazing ... Jahapana..thusi great hu..
please create and upload a seriers on SQL injection please please please
@manikanth..if you want to learn sql i guess you might know it probably but check the papers available on exploit-db.com its a very good website to find tools and exploits
absolutely quality. thank you very very much
When you print the stack you decide to print 10 words, how do you know whats the stack length ? Maybe this is explained on later videos but couldnt resis to ask. Apart from this question i cannot be more gratefull with the work you had/are doing with this videos.
Ive tried several times to start lerning asm, but i allways ended leaving the books apart
by its long and boring introductions, you give a direct and easy to understand explanatins that are great, and that are making myself and much other finally getting to asm world.
Thank you so much vivek !!!
Ok got it, ill answer myself this time .-)
I guess you print the stack 10 times because when you disassembled the add function it contains 10 operations ?
Am i correct ?
When we display ESP using x/10xw it gives
0xbffff450:
0xbffff460:
why the range is 450 and then 460 can you explain?
In a 32bit system how a program stores values in to stack, suppose char buf[4], how the four bytes memory is stored in stack of 32 bit?
This is SO AWESOME! I have tried to understand debuggers and assembly before on my own, but failed miserably! After this primer, I may actually have a chance! You sir, ROCK!
Simple and concise.. I am impressed.. hope to enroll with the rest of the courses.. but I have to finish all the videos first.
Thank you so much
@abhilash;
1 byte = 8 bits
4 bytes = 32 bits
1 word = 4 bytes = 32 bits
When dealing with the stack each address holds 32 bits, or 1 word.
Great as always....
Great videos thanx for sharing...
Awesome! Great and clear explanation.
I just notice I was using a 64-bit system LOL, that's maybe why it looked so different
I am completely new to this, I have to say "hats off", great job
Thank you very much. I frankly enjoy your tutorials.
Excellent tutorial!
These videos are so clear and direct. I think I have learned more about memory in 3 videos than I have in 10 years of system administration. Great Job.
Hi Vivek,
To be frank i could not understand anything. I know its a dry subject, however i am hopeful i will learn it.
Let me watch this video again and practicing the same.
Thank you very much for your effort. Your work is really great.
Praveen
I enjoyed watching this very instructive video. Very interesting walkthrough for gdb n00bs like me. THanks a lot.
Outstanding series thus far. Thank you for sharing all of your work!
really nice videos but i have a doubt can you please shed some light on this
warning: not using untrusted file ".gdbinit"
when i do gdb ./filename
i get the above warning , which i noticed that it did not occur for you , sorry for the trouble , it would be very helpful of you for your help .
okay i solved the above problem by installing the older version of gdb but now when i do
gdb$print x .... instead of 10 i get the value as a (which is the HEX value of ten)
and when i do
gdb$info registers
my EBP and ESP memory address are same
pls do help me ,
Nice job thanks man
Vivek, your videos are great. Thanks four your excellent work.
Thankz Vivek...This is great...I'm gonna dig deeper...May be i need more help from you...hope u will be here....:))))
thanks vivek, gonna continue .....
I like your video, but because you do not use the intel syntax?
Hello Vivek
This is by far the most enjoyable way to learn something. It is comforting knowing it is coming in digestable parts, not getting a feeling of drowning in information.
Many thanks and hope you continue the good work :-)
Vivek, first you are the best!! I'm happy I visited your site accidentally :-D
Now I have a doubt.
I'm using 64 bits and I have 8 more registers, my stack pointer is probably RSP.
When I check the registers and search the interger of the function you are taling about, I get them in another place.
rax 0xa 10
rbx 0x0 0
rcx 0x7ffff7b21af0 140737349032688
rdx 0x14 20
rsi 0x14 20
rdi 0xa 10
rbp 0x7fffffffe300 0x7fffffffe300
rsp 0x7fffffffe300 0x7fffffffe300
r8 0xffffffff 4294967295
r9 0x0 0
r10 0x22 34
r11 0x246 582
r12 0x400530 4195632
r13 0x7fffffffe470 140737488348272
r14 0x0 0
r15 0x0 0
rip 0x40064d 0x40064d <add+17>
eflags 0x202 [ IF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
As you can see, I get the results in the RSI and RDI registers... Is that just because I'm using 64 bit? Or is there another reason I should be aware of??
Keep up the wonderful work!