2

I have read several articles on the topic as this one and implemented most of the described techniques. But I also want to add some extra un-referenced/never-used code to the binary. Ideally I want to be able to add this code to the built binary through a tool. Is there such a tool? Any ideas on how to build such a tool? Or how to generate and add to my C++ program some never-used code? Where should I put it?

In an analysis of Skype internals I read that they mess the code as much as possible. One way of achieving it is to compute each call dynamically:

if ( sin(a) == 42 ) {
   do_dummy_stuff () ;
}

Should I enter into the dummy function? Or is the dummy function the never-used code?

Update: the reason I want to add never-used code to the binary is because we ship many e-books. I want the binaries of each to be little different so if one is compromised, the others not to be (at least not right away).

Martin Dimitrov
  • 4,796
  • 5
  • 46
  • 62

2 Answers2

4

If I got you right, you are talking about obfuscation.

This question on Stackoverflow covers the topic. There is a lot of software that obfuscates C++ code, quick googling shows a lot of such apps, e.g. this or this.

Community
  • 1
  • 1
SingerOfTheFall
  • 29,228
  • 8
  • 68
  • 105
3

Is there such a tool?

Yes, there is. It is called compiler with proper parameters, and to add to it a linker. Add to this combination strip, and you'll get a proper library.

On a serious note, there are no ways to prevent reverse engineering. You can only make it harder (or better annoying) for the cracker. You can take a look in this article (where developers of spyro tried all sorts of piracy protection)

Community
  • 1
  • 1
BЈовић
  • 62,405
  • 41
  • 173
  • 273