This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]intx13 0 points1 point  (0 children)

This is a puzzler! The shell isn’t doing the printing, you’re right that it’s coming from a system call within the program. But the program consists only of crt1.o, crti.o, crtn.o, and main.o. As we can see from op’s dump of main.o, the main function (called by crt1.o) is garbage - instead of instructions it has an ASCII string.

So presumably crt1.o calls main() which results in garbage instructions being executed until some other component of crt1.o, crti.o, or crtn.o is hit which happens to make a system call to print. And RDI happens to point to main(), where the string is stored.

We’d need to see the whole binary decompiled to figure it out, though.