Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » Protect packages - split code encryption,client and server
Re: Protect packages - split code encryption,client and server [message #40494 is a reply to message #40222] Wed, 07 August 2013 23:57 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
Oh, wich one would you suggest?
(I also miss the possibility to compile c code to an .asm file instead of .obj I really liked that in Borland C++)

[Updated on: Thu, 08 August 2013 00:01]

Report message to a moderator

Re: Protect packages - split code encryption,client and server [message #40495 is a reply to message #40494] Thu, 08 August 2013 00:02 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Really don't know... I guess MSC has a debugger which is quite powerful, but it's long time I don't use it.
Otherwise, there's IDA (paid) and some others.
But the one of VC should do the trick.

I use Linux usually, so I can't give you better suggestions Wink
Re: Protect packages - split code encryption,client and server [message #40496 is a reply to message #40222] Thu, 08 August 2013 00:05 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
Linux will be the next challenge, once the Windows version is ready and I can pay my bills again.
Re: Protect packages - split code encryption,client and server [message #40497 is a reply to message #40496] Thu, 08 August 2013 00:07 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Well... In my commercial app I compile for both OS everytime.... sometimes it becomes rather difficult to fix it at once later.

With UPP you don't have to change too much, but some stuffs can become tricky.
Re: Protect packages - split code encryption,client and server [message #40498 is a reply to message #40497] Thu, 08 August 2013 00:10 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Ahhh... got a small idea.... Please ask to your friend to download my app and test it on its OS.

www.timberstruct.com (or .it)

I'll attach here a test file.
  • Attachment: ArchPetas.tim
    (Size: 26.61KB, Downloaded 284 times)

[Updated on: Thu, 08 August 2013 00:10]

Report message to a moderator

Re: Protect packages - split code encryption,client and server [message #40499 is a reply to message #40222] Thu, 08 August 2013 00:10 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
Do you think writing the code to file from the code itself is possible? (seperate function, not encrypted)
Re: Protect packages - split code encryption,client and server [message #40500 is a reply to message #40222] Thu, 08 August 2013 00:13 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
what is a .tim file? how do I open it?
Edit: oh a file for your app.

[Updated on: Thu, 08 August 2013 00:15]

Report message to a moderator

Re: Protect packages - split code encryption,client and server [message #40501 is a reply to message #40499] Thu, 08 August 2013 00:14 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Alboni wrote on Thu, 08 August 2013 00:10

Do you think writing the code to file from the code itself is possible? (seperate function, not encrypted)


Yes, it is... but the problem is to write out the decrypted part. And not so easy, the start is easy to find, but then you must locate end of code too.

And for decrypted part, you should decrypt it somehow inside your code before storing.
Re: Protect packages - split code encryption,client and server [message #40502 is a reply to message #40500] Thu, 08 August 2013 00:15 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Alboni wrote on Thu, 08 August 2013 00:13

what is a .tim file? how do I open it?


It's a testfile of my application which you can download at http://www.timberstruct.com

You can ask your friend to test it on his OS.
(free demo for 1 month)

[Updated on: Thu, 08 August 2013 00:16]

Report message to a moderator

Re: Protect packages - split code encryption,client and server [message #40503 is a reply to message #40222] Thu, 08 August 2013 00:20 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
I'll try inserting 10 nop statments begin and end to find it.
Re: Protect packages - split code encryption,client and server [message #40508 is a reply to message #40222] Thu, 08 August 2013 13:39 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
I gave the updated protect.h to my collegue, but it gave the same results in the debug run (see attached picture).
Re: Protect packages - split code encryption,client and server [message #40509 is a reply to message #40222] Thu, 08 August 2013 13:41 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
I also managed to create a new example that shows the same behaviour, by "protecting" the reference example "SqlArray"

  • Attachment: SqlArray.zip
    (Size: 2.25KB, Downloaded 266 times)
Re: Protect packages - split code encryption,client and server [message #40510 is a reply to message #40508] Thu, 08 August 2013 13:43 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
But where does it crash ? It doesn't seem inside encrypted code....
Re: Protect packages - split code encryption,client and server [message #40511 is a reply to message #40510] Thu, 08 August 2013 14:04 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
So, I recompiled your SqlArray with MSC9 and tested on a 64 bit PC, and it works perfectly.

I'll attach here the build, so you can ask your friend to test it. It can be a MSC10 issue, but I doubt it.

The most probable stuff is the usual dumb antivirus program that blocks self modifications to code.
If even this SqlArray.exe doesn't work on your friend's PC, ask him to DISABLE ALL ANTVIRUS and retest.

I never had a crash because of antivirus, but I do have many problems with my customers of dumb antivirus reporting my code as suspect or, whorse, as a trojan.
I think that antivirus producers should be sued because of this. They made me loose a couple of customers with their dumb behaviour.

(I had to pack the exe with 7zip, the normal zip wasn't enough to stay inside the 2MB limit)
  • Attachment: SqlArray.7z
    (Size: 1.24MB, Downloaded 248 times)
Re: Protect packages - split code encryption,client and server [message #40513 is a reply to message #40222] Thu, 08 August 2013 14:35 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
My sqlarray.exe is 1.69 Mb
Did you compile 'optimal' and protected?

He uses Eset antivirus. We also checked without antivirus. Made no difference. All test executables scanned clean.

The timberstruct program runs fine.


  • Attachment: SqlArray.exe
    (Size: 1.69MB, Downloaded 958 times)

[Updated on: Thu, 08 August 2013 14:37]

Report message to a moderator

Re: Protect packages - split code encryption,client and server [message #40514 is a reply to message #40513] Thu, 08 August 2013 14:49 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Well, the mistery is being solved Razz

Your build with MSC10 optimal DOESN'T work on my machine (32 bit) nor on a 64 bit machine.

As I told you some time ago, there are problems with MSC10.

The same app rebuilt with MSC9 in optimal mode DO work both on 32 and 64 bit.

Sorry but I have not MSC10 handy nor time now to solve it for MSC10.... I guess its optimizer is quite more aggressive then MSC9 one and needs workarounds.

By now, you have the only choice of building it with MSC9....

Ciao

Max
  • Attachment: SqlArray.exe
    (Size: 1.51MB, Downloaded 241 times)
Re: Protect packages - split code encryption,client and server [message #40515 is a reply to message #40514] Thu, 08 August 2013 14:51 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Btw, I'm thinking on a novel copy protection method that should work also for 64 bit MSC, but I'll try it in some time, not now. And probably it'll be cheap but commercial one Wink
Re: Protect packages - split code encryption,client and server [message #40516 is a reply to message #40222] Thu, 08 August 2013 15:04 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
Ok. I will install msc9 and try my app.
I might still try to fix it for msc10.

Thanks for helping me out like this.
I appreciate!
Re: Protect packages - split code encryption,client and server [message #40517 is a reply to message #40222] Thu, 08 August 2013 15:08 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
btw: your executable is smaller, so msc10 optimizing doesn't seem to be better at least for size.
Re: Protect packages - split code encryption,client and server [message #40518 is a reply to message #40516] Thu, 08 August 2013 15:08 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
No problem... If you fix it for MSC10, please test with MSC9 too and post the modified code.

I guess it's an optimizer problem, with GCC I became crazy in optimal mode, as he has a quite aggressive optimizer.
MSC9 wasn't that difficult, but I'm afrait MSC10 will be.

Usually you trick the optimizer with some jumps and some useless code that compiler think it's needed.... You can see it looking at posix part of protect.

Ciao

Max
Previous Topic: Broken packages
Next Topic: Encrypted storage with streaming (OpenSSL, AES)
Goto Forum:
  


Current Time: Tue Mar 19 06:06:16 CET 2024

Total time taken to generate the page: 0.01569 seconds