something to post.
I hope you have understood the flow of action. You can also see the files in official trac. You will get some references and links to bugs as well.
After action the restriction. There is restriction of MIME types (for example - RFC 2183( //tools.ietf.org/html/rfc2183) is allowed, that is JPEG format). You can not attach an php file in the way as attachment like you do with an image. The function is restricted. You can not even attach a proprietary file like *.idraw file at all. You will get security error.
Yes your idea is actually right, There three files that currently handles the work (not limited to) :
"something to post" is not actually technically right terminology, you actually have to explain the specific need either in words or via diagram.
Please check TinyMCE's docs as well.
As WordPress project is a Free Software project and there is excellent collaboration for the modification of core files, please refer to the documents for Plugin or Theme development or participate in make.wordpress.org
If you want to extend the features, thats great; directly mention the type and intention of usage. Show the full source code in any code repository for your needed usage (Plugin or Theme).
For all normally used files there are already existing default functions or Plugins (like for attaching a MP3 as podcast, we can either use the default function or install a plugin to get more features).