Description: This is Part 7 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 work with strings in Assembly. We will demonstrate how we can move strings from one memory location to the other using the MOVS instruction set, discuss the concept of the Direction Flag (DF) and how to set and clear it using STD and CLD, how to execute multiple string copy instructions using the REP instruction, how to load strings from memory into the EAX register using the LODS instruction set, how to store strings from the EAX register back into memory using the STOS instruction set and finally we shall look at how to compare strings using the CMPS instruction set.
Please download StringBasics.s to try out the various exercises discussed in this video.
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.
Why do we need the "nop" instruction at the beginning of the _start function?
I was wondering the same thing, what is the "nop" instruction?
nop is no operation. Just a void command used to set breakpoint or locate code more easily.
I believe there's a typo in REP slide: "till" should be "while". Based on your debug, REP stops when ECX (length) = 0, so it keeps going "while >0"
Very good video, i spotted the typo too...was thinking it should be till ECX = 0.
Thanks!
And thanks sogood for clearing up the nop.
YOu are great man! Better than Univer.teachers here,(I am not gonna tell you 'where'). Very well informed instructions. Do you have got tutorials on format string vuln.(I found some of your tutorials), but with a shell execetion from the memory, I am trying with DTORS, but I am finding it difficult.
Awesome video ...Thanks for all the efforts u put in to this !!
Why do you use:
leal helloWorldString, %esi
instead of:
movl $HelloWorldString, %eax
your vids r awesome!
keep it coming please
;)
Starting to get more complicated, but these guides are really well made so it's a lot easier to follow than learning from scratch from a book.
As always! Another great movie! Thank you Vivek!
36 minutes, this was a long one.
great video.
well!!! it was good one literally as expected every new episode is exciting and much adventurous going great plese make some more videos linux primer 11 ,12,13 & so on ........................
Splendid don't have words to say.
@col_Loki
More like ecx == 0
:P
Great videos! Glad to see that you were at Def Con!
excellent work :)
Great material, great presentation. Thank you so much!
Very good presentations. The instructions are very lucid. You are making it look too easy.
Once again excellent work.
Hi Vivek - These are great videos.
At the beginning of Video 7 you say MOVSW - is to move a word (16 bits)
A word is 4 Bytes (32bits) isn't it?
Can yo clarify for me what you mean - thanks again
J
@ j-oscp
byte = 1 byte
word = 2 byte
dword (double word) = 4 byte
Thanks a lot Vivek! Amazing video, as usual! :)
This series is awesome! I purchased the python course and highly recommend it.
This series is awesome! I purchased the python course and highly recommend it.
This one is very complicated by definitely clear. Post to www.securitytubeforums.net if you have question, and we will help you!
Vivek.. YOU ARE JUST AWESOME! Not only I learn ASM from you.. BUT ALSO the APPROACH you use to transfer knowledge.
I am learning it and present other subjects to my colleagues at the company with your approach. VERY exhaustive, informative, and demonstrative..
And one more thing, I do fall asleep at times when listening to all your videos :D
GOD BLESS YOU
Dear Vivek,
Its an extra ordinary video..the way you explained is very good.I am learning it a lot.
Thanks
Super video. Thank you for all your hard work and great explanations. A university could and would charge $670 per credit hour for a course like this.
whats the difference between:
movl $helloworldstring, %esi and
leal helloworldstring, %esi
Do they not both point the memory address of hellow. to %esi ?
And interestingly enough, 1 word = 4 bytes = 32 bits???, here it counts a word as 2 bytes, how can that be?