Page 1 of 1
protection againts debugers or decompilers
Posted: Fri Jun 20, 2008 2:02 pm
by MOISES
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?.
Re: protection againts debugers or decompilers
Posted: Fri Jun 20, 2008 3:49 pm
by Patrick Mast
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
//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
Posted: Fri Jun 20, 2008 6:26 pm
by MOISES
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.
Posted: Sat Jun 21, 2008 9:19 am
by fraxzi
Hi,
This may help..
I use this with UPX on FWH apps...
upx.exe your.exe --compress-exports=0
Regards