|
|
Home » Developing U++ » UppHub » Protect package - A starting copy protection system
Re: Protect package - A starting copy protection system [message #28857 is a reply to message #28854] |
Mon, 20 September 2010 10:02 |
mdelfede
Messages: 1308 Registered: September 2007
|
Ultimate Contributor |
|
|
dolik.rce wrote on Mon, 20 September 2010 00:50 | Hi Max!
This is a very interesting package. I couldn't resist and played with it for a while My conclusions: It works very well and it would definitely stop me from stealing the app.
|
Ehehehe.... no, it's not too difficult to defeat, IF you've the key
Quote: |
Few observations:
.........
You can't declare variables inside the encrypted block, because 'jump to label __end crosses initialization of ...'. It is somewhat cryptic, so it should be probably mentioned in docs.
|
mhhhh... I haven't tried it enough, but I guess it can be solved
somehow.... I couldn't just resist to put on bazaar for testing
The main problem I found is that damned M$ inline assembler, I guess it was coded by some drunk people....
Quote: |
Work around is to put another pair of '{}' between the calls to PROTECT_... macros to limit the scope of variables declared inside.
|
I'll look at this solution this night.... Maybe it's a good suggestion
Quote: |
You can't have two encrypted blocks in one function, as it results into redeclaring variables. Even if the blocks are in different scopes, it fails on duplicate labels. This could be fixed easily, but it is probably not important for real-life usage.
|
Well, the macros are thought for single usage in every function. I guess they could be modified for multiple usages (maybe using the __LINE__ macro for labels, or something like that, but I guess it's better to use it just once per function.
Quote: |
The 'return' in PROTECT_END_FUNC prevents using the macro in functions returning a value. Omitting it causes runtime error,
|
Well, that's a bigger problem.... I didn't think about it.
The ending return statement is just to avoid entering into data (garbage) part of the code.... But can be solved also with an assembler jmp, I guess. I'll try it this night too
Quote: |
One question at the end: Do I understand it right, that the decryption is performed only on first call of the function? So it modifies only the program loaded in memory? If so, I'll seriously consider calling it a voodoo
|
Yep, it's decrypting on the fly on first function call.... and that's the biggest flaw of the approach. With a good placed breakpoint you can have the decrypted code in memory, and looking for the call to decrypt routine is quite easy with a good debugger. You must, indeed, have the key handy to do that, without key you can't do anything.
I was thinking about obfuscating a bit more the stuff, I've just to think a bit about it. The "big" problem is to keep the process simple and portable between GCC and MSC; to do a better think we should parse executable headers which isn't easy.
Anyways, as you can see from macro code, the whole process isn't a big voodoo The macro just marks the executable with some known strings, easily found by encrypter code, which patch the executable on right places. The decrypter has just to open code memory for write access and reverse the process. It's easy if you use encrypt algorithm that doesn't change code size.
A better (and more secure) approach would be to encrypt/pack the code and to decrypt/unpack in memory allocated for the purpose.... But, I guess then ww would have do parse executables, object files and so on, which makes it a nightmare for portability sakes
Thank you
Ciao
Max
|
|
|
|
|
Protect package - A starting copy protection system
By: mdelfede on Sun, 19 September 2010 21:07
|
|
|
Re: Protect package - A starting copy protection system
By: dolik.rce on Mon, 20 September 2010 00:50
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Mon, 20 September 2010 10:02
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Mon, 20 September 2010 13:57
|
|
|
Re: Protect package - A starting copy protection system
By: dolik.rce on Mon, 20 September 2010 18:29
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Mon, 20 September 2010 21:38
|
|
|
Re: Protect package - A starting copy protection system
By: dolik.rce on Mon, 20 September 2010 23:21
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Mon, 20 September 2010 23:38
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Mon, 20 September 2010 08:14
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Wed, 22 September 2010 00:52
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Thu, 23 September 2010 17:05
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Thu, 23 September 2010 20:39
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 24 September 2010 10:13
|
|
|
Re: Protect package - A starting copy protection system
By: Zbych on Sat, 25 September 2010 13:36
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Sat, 25 September 2010 15:37
|
|
|
Re: Protect package - A starting copy protection system
By: Zbych on Sat, 25 September 2010 18:03
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Sat, 25 September 2010 18:59
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Wed, 29 September 2010 22:29
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Thu, 30 September 2010 21:30
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Thu, 30 September 2010 22:59
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Fri, 01 October 2010 08:11
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 01 October 2010 13:53
|
|
|
Re: Protect package - A starting copy protection system
By: 281264 on Fri, 01 October 2010 21:53
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 01 October 2010 22:36
|
|
|
Re: Protect package - A starting copy protection system
By: 281264 on Sat, 02 October 2010 16:00
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Sat, 02 October 2010 18:08
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Sun, 03 October 2010 22:49
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Fri, 08 October 2010 12:29
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 08 October 2010 14:10
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Sun, 10 October 2010 14:35
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Wed, 13 October 2010 09:11
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Thu, 14 October 2010 01:42
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Thu, 14 October 2010 10:45
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Fri, 15 October 2010 10:54
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 15 October 2010 11:23
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Fri, 15 October 2010 12:05
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 15 October 2010 12:23
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Sun, 30 January 2011 19:24
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 04 February 2011 01:39
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Fri, 04 February 2011 12:04
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 April 2011 10:02
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Wed, 06 April 2011 13:49
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 April 2011 15:23
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Wed, 06 April 2011 23:18
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Thu, 07 April 2011 14:55
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 08 June 2011 10:08
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Mon, 17 October 2011 21:24
|
|
|
Re: Protect package - A starting copy protection system
By: ratah on Wed, 28 December 2011 10:54
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Wed, 28 December 2011 13:04
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Fri, 01 June 2018 15:43
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: koldo on Mon, 04 June 2018 08:53
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Tue, 05 June 2018 11:37
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Tue, 05 June 2018 19:10
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Tue, 05 June 2018 20:22
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: mdelfede on Wed, 13 October 2010 01:06
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Tue, 05 June 2018 21:08
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 08:31
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 09:30
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 10:12
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 12:16
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 12:34
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 12:42
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 13:32
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 15:30
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Thu, 07 June 2018 12:26
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Thu, 07 June 2018 13:16
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Fri, 08 June 2018 12:42
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Fri, 08 June 2018 13:00
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Fri, 08 June 2018 14:22
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Fri, 08 June 2018 14:41
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Sat, 09 June 2018 09:49
|
|
|
Re: Protect package - A starting copy protection system
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Tue, 12 June 2018 20:23
|
|
|
Re: Protect package - A starting copy protection system
By: Tom1 on Wed, 06 June 2018 12:32
|
|
|
Re: Protect package - A starting copy protection system
|
Goto Forum:
Current Time: Fri Sep 20 08:05:18 CEST 2024
Total time taken to generate the page: 0.04747 seconds
|
|
|