I am learning Python. Till now I've been doing only basic Python coding. A day ago, I checked python implementation of tree
command. Suddenly I thought of creating a Python clone for uptime
. I don't have any clue about which language it is implemented in and what would be the complexity involved in cloning it.
But I couldn't find its source code. I am using Fedora 14. kernel-devel package is installed. I did whereis uptime
but the resulting /usr/bin/uptime
file shows weird symbols when opened using vim. Googling for its source code couldn't yield desired results either. Where can I find its source code?
file /usr/bin/uptime
. The file command uses a series of semi-magical heuristics to guess as to the contents of the file — in this case, an ELF-format binary executable.strace
. It will show all the syscalls your application makes. If you runstrace uptime
it would show (after loading) open calls on /proc/uptime and /proc/loadavg. Though it doesn't show everything, it's sometimes a decent start on reverse engineering