Not only did it take a dozen times for you to make this video but it took me dozen time for me to sit down and learn. It much funnier to play videos games and talk to attractive people but I really want to learn this. Thank you for your knowledge.
Thanks for this. I hope to finish the entire course. Question. Why not '#include' the libs that are needed for the libc functions like puts(3) and exit(3)? It doesnt add anything to the final binary and gets rid of the annoying warnings. Also, main() is definitely "int (*main)(...)" and not "int *(main)(...)". We know this because we know that main returns a 32-bit int in EAX, and not a 64-bit pointer in RAX. As shown in your example, it is not even a function pointer.
@@darkosimonovic2896 It runs because even though there was a typo in int*(main) which passed the argument as an integer instead of a function pointer which it should have been, it still got casted back to a pointer by the compiler. This is actually undefined behavior. The compiler isn't warning about this since it's undefined and compiler authors aren't required to handle it. Edit: It is specified in the standard in C99 as an extension even though it's still undefined behavior. J.5.7 Function pointer casts A pointer to an object or to void may be cast to a pointer to a function, allowing data to be invoked as a function (6.5.4). A pointer to a function may be cast to a pointer to an object or to void, allowing a function to be inspected or modified (for example, by a debugger) (6.5.4).
32:10 - Why don't you register the signal handler (alarm) before invoking alarm(3) ? I guess it works because alarm() is not blocking, so it will have enough time to register the handler
Not only did it take a dozen times for you to make this video but it took me dozen time for me to sit down and learn. It much funnier to play videos games and talk to attractive people but I really want to learn this. Thank you for your knowledge.
good content like this is hard to find
Thank you! Learned a lot from this Fundamentals, it lead me to research more and more =)
Thank you for this courses of high value
You are a hero !! Thank you so much :D :D
Thanks for the great video and content ❤
Thanks for this. I hope to finish the entire course.
Question. Why not '#include' the libs that are needed for the libc functions like puts(3) and exit(3)? It doesnt add anything to the final binary and gets rid of the annoying warnings.
Also, main() is definitely "int (*main)(...)" and not "int *(main)(...)". We know this because we know that main returns a 32-bit int in EAX, and not a 64-bit pointer in RAX. As shown in your example, it is not even a function pointer.
Do you know why int*(main) () compiles and runs. Greatly appreciate.
@@darkosimonovic2896 It runs because even though there was a typo in int*(main) which passed the argument as an integer instead of a function pointer which it should have been, it still got casted back to a pointer by the compiler. This is actually undefined behavior. The compiler isn't warning about this since it's undefined and compiler authors aren't required to handle it.
Edit:
It is specified in the standard in C99 as an extension even though it's still undefined behavior.
J.5.7 Function pointer casts
A pointer to an object or to void may be cast to a pointer to a function, allowing data to be invoked as a function (6.5.4).
A pointer to a function may be cast to a pointer to an object or to void, allowing a function to be inspected or modified (for example, by a debugger) (6.5.4).
@@MrShebaw Thank you
32:10 - Why don't you register the signal handler (alarm) before invoking alarm(3) ? I guess it works because alarm() is not blocking, so it will have enough time to register the handler
Thank you!
thank you ...
What does it mean by start (or some other binary) to export/import symbols?
23:30 “typical signal” should say “typical syscall”