The Stack and ESP in Assembly Language - What happens when you call a procedure?

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024
  • What happens with the STACK, ESP, and EIP when a procedure is called in Assembly Language.
    I don't know about you, but I am SICK of having to scrub through a 15-minute video only to find out that they didn't even answer the question I was searching for. Here is a 4-minute video that explains what happens to the Stack, ESP, and EIP when a procedure is called in Assembly Language.
    I am a computer science student in my first semester at Auburn University, and this was one of the hardest concepts for me to grasp in my Assembly Language course. After spending a few hours failing to find youtube videos that helped me understand, I decided it was a good idea to make one. Hopefully it helps you understand this concept in less time than it took me. Thanks for watching!

ความคิดเห็น • 37

  • @ArunaSrivastava-xb5eq
    @ArunaSrivastava-xb5eq ปีที่แล้ว +8

    This was one of the most thoughtful, well prepared videos on assembly I have ever seen. You have a real knack for explaining this content visually. Thank you!

  • @alexandrumarcel3696
    @alexandrumarcel3696 หลายเดือนก่อน

    it's good to mention that this could vary depending on what calling convention (__stdcall, __cdecl, __fastcall) and CPU architecture (x86, x64) you are using

  • @sayanhalder6470
    @sayanhalder6470 2 หลายเดือนก่อน

    The best vdo. U explained so simply and easlily. I was looking for this for months 😅

  • @pavolpanisz3251
    @pavolpanisz3251 2 ปีที่แล้ว +7

    Thank you very much for this. I watched 2-3 videos prior to this one, but yours made it click. Especially because you gave multiple analogies (the deck of cards one being my favorite) to explain the same thing - this approach really makes a person understand the topic by having to think about what all the analogies have in common.

  • @hodayfa000h
    @hodayfa000h วันที่ผ่านมา

    I went to a few videos, they sucked, went to copilot, it explained it nicely... but sucked, yours is good

  • @techtechlearn3438
    @techtechlearn3438 2 ปีที่แล้ว +3

    Great video !!! Indeed there aren't other videos that explain the concept well enough, that's why I thank you a lot!! :)

  • @effsixteenblock50
    @effsixteenblock50 5 หลายเดือนก่อน

    What were the ESP and EBP doing through all of this?

  • @hansqid
    @hansqid 10 หลายเดือนก่อน

    thank you so much! although at first i kinda had a headache but rb i understand

  • @gristlelollygag
    @gristlelollygag 3 หลายเดือนก่อน

    Great video, wish you went into recursion

  • @tsunningwah3471
    @tsunningwah3471 7 หลายเดือนก่อน

    when you pop, does the value goes to eip by default

  • @miguelmendez241
    @miguelmendez241 27 วันที่ผ่านมา

    Best explanation ever!

  • @ZettaiKatsu2013
    @ZettaiKatsu2013 4 หลายเดือนก่อน

    I just want to say to people who don't get why SP changes : Every push and pop is implicitely modifiying SP, the person writing instruction doesn't need to manage it in this case.

  • @tobiasschwarz6021
    @tobiasschwarz6021 11 หลายเดือนก่อน

    Strong Vid, Bro!

  • @kellyshields3392
    @kellyshields3392 7 หลายเดือนก่อน +1

    This was hurting my brain yesterday but you made it click! Thanks! :)

    • @Boneplayer123
      @Boneplayer123  7 หลายเดือนก่อน +1

      I’m glad! Can’t tell you how much time I spent banging my head against the desk before it clicked for me

  • @gurpreetkhamba5399
    @gurpreetkhamba5399 ปีที่แล้ว

    educational, although I was looking for EBP basics.

  • @elecmayte4267
    @elecmayte4267 10 หลายเดือนก่อน

    thank you, It was very hard to find a video that actually explains this correctly.

  • @vortex_7574
    @vortex_7574 3 ปีที่แล้ว

    Same boat as you, mate! But this helped!

  • @ion4497
    @ion4497 ปีที่แล้ว +1

    great !!

  • @AKKJ420
    @AKKJ420 หลายเดือนก่อน

    I wish you made more videos

    • @Boneplayer123
      @Boneplayer123  หลายเดือนก่อน

      I wish I stuck with low level programming! Started doing detection development instead. Now I make videos at www.youtube.com/@DailyDecrypt

  • @kyledrewes6552
    @kyledrewes6552 ปีที่แล้ว

    This was a good video thank you. Do you have have any videos on what the EBP does? Thanks

  • @emilyem9685
    @emilyem9685 3 ปีที่แล้ว

    Thanks a lot!

  • @robsawyer8034
    @robsawyer8034 4 หลายเดือนก่อน

    Well done. Excellent explanation

  • @MFXScript
    @MFXScript ปีที่แล้ว

    What any amazing video thanks!

  • @echohuang3158
    @echohuang3158 2 ปีที่แล้ว

    Thank you so much man you save my ass!

  • @mqasimkhan6920
    @mqasimkhan6920 10 หลายเดือนก่อน

    thanks alot man

  • @phanhoangnam699
    @phanhoangnam699 2 ปีที่แล้ว

    very useful

  • @ezaki6576
    @ezaki6576 9 หลายเดือนก่อน

    well done dude!

  • @gtamta4190
    @gtamta4190 ปีที่แล้ว

    what happen if we push another register in to stack when program executing the call function , at that point stack pop out that we push into the stack to EIP register ? if it does what happen to program executing instruction ?

    • @MFXScript
      @MFXScript ปีที่แล้ว

      Call macro already pushes return address for you. If you push another address before call macro. It will execute it arg1 and stack will corrupt. If you want to push custom address for return,you must do push return address then jmp function location. This is which is equal to a call macro. But keep in mind there is a high change custom return address will crash program. You need to adjust that.

  • @-boiadeiro-
    @-boiadeiro- 2 ปีที่แล้ว

    wow nice explanation

  • @rigbyb
    @rigbyb 2 ปีที่แล้ว

    Very well explained thank you

  • @edevaaao
    @edevaaao 2 ปีที่แล้ว

    Very useful thanks !

  • @deedewald1707
    @deedewald1707 2 ปีที่แล้ว

    Very useful and detailed thanks !

  • @nandorbacso4625
    @nandorbacso4625 ปีที่แล้ว

    What does add/sub esp, hexValue do?

    • @Baebon6259
      @Baebon6259 6 หลายเดือนก่อน

      convert the hex value to decimal value then subtract (sub) that decimal value from esp or add that decimal value to esp.