Follow us

Description: This is Part 10 of the "Assembly Language Primer for Hackers" video series. Please start here by watching Part 1 of this series, if you have not already done so. In this video we will look at how to write functions in Assembly Language. <br><br>The most important step in writing functions in assembly is to understand how to pass arguments to them and then read their return values. We will look at 2 techniques - using registers and using global memory locations to understand how this can be done. In this demo we will use our familiar "Hello World" program to demonstrate how to code a simple function using the "write()" syscall. We will use the Function.s program to demonstrate argument passing using the CPU registers and Function2.s to demo argument passing using global memory location in the .BSS segment. <br><br><br><style type="text/css"> body { background: </style> </div>

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.

Thank you vivek sir..I am new to this field of information security and I am learning assembly after so long time and that to from basics...getting everything very clear..!!I would also like to thank my guide AP4CH3 who asked me to watch this all videos so i can clear my basics easily.

these 2 are equivalent, i think leal tries to get the address of the .data label HelloWorldStr, but in this example (2nd one) we already have the value of the string address in the .lcomm label, and using lea StringPointer will try to get the address where the address is right now

hi, great series I am using it as a refresher and it does MagiC:) Just a question about string len. You are setting it to 14 for HelloWorld string and 17 for HelloFunction string. when I run it my output is:Hello World!HHello Function!

first letter of the second string is doubled, and because this strings are in memory one after another i think(and gdb knows:P) first of them is printed: Hello World!\nH

but i can see that you compile/link/run it with out a problem, so is this OS or GCC compability thing???

Another excellent video. I was getting an error when wrote the command "print x / $eip" As seen at 13:31. The error was "$2= Value can't be converted to integer." When I changed it to "print x / $rip" it worked correctly. It must have something to do with the fact that I am using a 64 bit CPU.