开发者

What can you gain from looking at the binary opposed to source in c?

开发者 https://www.devze.com 2022-12-20 16:24 出处:网络
My friend said he thinks i may have made a mis开发者_如何学JAVAtake in my programme and wanted to see if i really did. He asked me to send him the binary opposed to the source. As i am new to this i a

My friend said he thinks i may have made a mis开发者_如何学JAVAtake in my programme and wanted to see if i really did. He asked me to send him the binary opposed to the source. As i am new to this i am paranoid that he is doing someting to it? What can you do with the binary that would mean you wouldnt want the source?

thank


Black-box testing. Having the source may skew your view on how the program may be behaving.


Not much, at least not much by staring at it. But you can run it with a debugger attached, so you can set breakpoints, inspect memory areas, investigate crashes ...

However, the soure code remains the primary tool for debugging. The binary by itself is a bit useless for serious debugging (not for testing, you can greatly test software without having access to its source).


I guess if he wants to recompile your code on his machine he may want to be able to check that the binary he gets is the same as the one you get to eliminate compile options or library differences.
Now when I debug, I frequently want to see the assembly - maybe this is what he meant?


He can run it, test it, report any bugs he finds. Not much else, but that itself may be useful; people are notoriously bad at testing their own code, because they tend to believe that it is robust, and don't want to break it. An independent tester will see breaking it as a challenge. Their performance is based on the number of bugs they find; whereas your performance is based on how difficult you make that for them.


Perhaps he wanted to debug. Also, depending on how the compiler is invoked (for instance with -g for gcc) the binary might contain source code information still.

0

精彩评论

暂无评论...
验证码 换一张
取 消