Monday, July 16, 2012

Analyzing the Binary code ...


And Today we will look at some exciting things to do with computer software. Be warned that this information is shared for the purpose of knowledge sharing only do not use this knowledge in a wrong way...

Actually this post is related to analysis of the binary code ... not excited by the idea... ?? Ok let me say this in another way... lets say your friend has sent a binary which he claims to be very useful for you... and you tried to execute the binary so eagerly only to find that its been password protected (Here password protected means the binary needs you to give some password like thing not zip file or something like that )..... still not excited by the situation ... you might be thinking that you have to give a try and guess some passwords ( of course you can use knowledge about your friend or else you can social engineer to get it done )...  that's another way... Just think of getting the password which your friend used in the binary... just right sitting at your desktop no guessing and social engineering etc .... Oh yeah... By this time you might be interested in learning how to do it ... if yes carry on reading through the rest of the post... :)

Every piece of code, which you will be writing in any language whether it be assembly language ,middle level language or high level language , at the end of the day has to be executed by the CPU. So depending on the Processor the piece of code which you will be writing has to be converted into machine readable code . For the sake of simplicity I would be using C language as my choice of language to explain the whole thing . Lets say you have written a piece of code named HelloWorld.c  . Whats next ?? yes you are right you have to compile the code with a C compiler ( here when selecting the which compiler to use , the processor comes into picture and yes  as you might have learned already the choice of compiler depends purely on processor.. thats another big story some day we will discuss it :)  ) . What you will see is an object file and an executable file .


For your minds : ask your self at what stages an object file/executable files be created and what if there is an error in my source file will the object file be created ?? just give a thought about it and you will learn amazing things ... and ofcourse you tried to your best and cant find the answer I am always here to explain the things ... just ask me for help :)


Now that you had that .exe file which your friend has shared with you. Now we will look at how to get the things .. Hmmm I think its better you go and have a quick look at assembly code which you have learned ... thinkgs like MOV,CMP JNZ and other instructions... no need of reading a specific manual or something like that ... just go and get an idea of what assembly language means what are the codes used in assembly language to denote operations etc..as we humans cant understand the machine language as easily as we understand the high level languages.. in my next post we will see how to find  your friends password :)

No comments:

Post a Comment