protection againts debugers or decompilers

protection againts debugers or decompilers

Postby MOISES » Fri Jun 20, 2008 2:02 pm

Hi,

Is there a way to protect a FWH exe against being debugged or decompiled?. I do not want to use a compresion software such as UPX, as I have tested it and it does not always work.

Makbe a function that avoid some vectors?.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: protection againts debugers or decompilers

Postby Patrick Mast » Fri Jun 20, 2008 3:49 pm

MOISES wrote:Is there a way to protect a FWH exe against being debugged or decompiled?. I do not want to use a compresion software such as UPX, as I have tested it and it does not always work.

I use OPX all the time and did not encounter any problem so far. How does it fail for you?

Also, in your code, you can do:
#pragma TEXTHIDDEN(1)

This scrambles any text in your exe. This makes "reading" text from your sources in your exe impossible.

See this sample:
Code: Select all  Expand view  RUN
//NOTEST
/*
* $Id: tstprag.prg,v 1.2 2005/04/22 18:41:31 ptsarenko Exp $
*/

#pragma TracePragmas=On
#pragma ExitSeverity=1

/* Unknow pragmas will be ignored silently */
#pragma BadPragma=off
#pragma /Y+

function Main()

#pragma Shortcut=On
#pragma Shortcut= Off
#pragma Shortcut = On
#pragma Shortcut(OFF)
#pragma Shortcut( On)
#pragma Shortcut( OFF )
#pragma Shortcut( On )
#pragma Shortcut( OFF )
#pragma Shortcut( ON

/* or #pragma /Z+ */

  if .t. .and. .f.
    ? "Always"
  endif

  if .f. .and. .t.
    ? "Never"
  endif

#pragma /Z-
/* or #pragma Shortcut=Off */

#pragma Exitseverity=0
#pragma Exitseverity=1
#pragma Exitseverity(0)
#pragma Exitseverity( 1 )
#pragma Exitseverity( 0 )
#pragma Exitseverity= 2
#pragma Exitseverity= 1

/* Pragmas with bad values will cause an error  */
#pragma WarningLevel=8

#pragma TEXTHIDDEN(1)
? "This is a hidden text"
#pragma TEXTHIDDEN(0)

return nil
--
Sincerely,

Patrick Mast,
xHarbour.com Inc.
http://www.xHarbour.com
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby MOISES » Fri Jun 20, 2008 6:26 pm

Patrick:

Thank you for your reply. I tested http://upx.sourceforge.net/ and in some computers the program just did not run, so I decide not to use it any longer.

I am afraid I don´t understand the C example. Could you explain a little bit, please?.

Thank you.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Postby fraxzi » Sat Jun 21, 2008 9:19 am

Hi,

This may help..


I use this with UPX on FWH apps...

upx.exe your.exe --compress-exports=0


Regards
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 72 guests