Monday, January 21, 2013

Applying reverse engineering


Today we had lecture about the Reverse engineering. It is the completely reversed development process. We start with the source code of an existing system and we try to figure out the design issues and the abstractions of the given system. That is basically what we need to know for the Bug Hunting Competition.

So how to start? For our purposes we should do these:
  • Do a mock installation - that is one of the first things I did, I got the latest version of the source code, built it and run it.
  • Skim the documentation - I can also check this point, because I have done this also in the very begginigs
  • Read all the source code in an hour - I have to pay some attention to this point, what I did so far was that I just read the source code of the second biggest source file and the file containing the entry poit of the application. Just for an info, the line count of some interesting files(these are just Pidgin files which deals with GTK+ UI):
    • 10291 gtkconv.c
    • 8250 gtkblist.c
    • 5893 gtkimhtml.c
    • 3710 gtkutils.c
    • 2990 gtkprefs.c
    • ...
    • 948 gtkmain.c (int main(argc, argv))
    • 67374 total (total 51 C source files)


What is so interesting about that? Just the fact that these 5 files (of all 51) contains 46% of the  source code. These source files must be pretty important, right?
Together with libpurple(library used for developing IM programs) and finch(console-based IM program that lets you sign on to IM networks) it is 160 500 lines of code and 138 C source files.


No comments:

Post a Comment