Page 1 of 1 1
Topic Options
#31589 - 2002-10-30 08:26 PM KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I am using kixcrypt to encrypt a file but I am having a little difficulty. It seems that my @ScriptDir macros are not working because I am not giving a full path when I just double click the exe or even give the full path to the exe in the cmd prompt.. is there a way around this?

Thanks so much for any advice...
_________________________
Austin Henderson

Top
#31590 - 2002-10-30 08:30 PM Re: KixCrypt Issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
use something else instead of that macro [Wink]

if I remember correctly kixcrypt uses tempfile and mostlikely scriptdir will give you the tempdir.

you could replace @scriptdir with @startdir or if it does not match...
use your own var initialized by the commandline.
_________________________
!

download KiXnet

Top
#31591 - 2002-10-30 08:49 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I tried the @StartDir but I am getting nothing in return for it.. I need to come up with a way to make it use it.. it is looking for an ini file and some other things that are going to be in the same directory... I wonder if I could just remove the reference to it all together and it will use the current path? I will give it a shot.

Thanks
_________________________
Austin Henderson

Top
#31592 - 2002-10-30 08:56 PM Re: KixCrypt Issue
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
READPROFILESTRING requires a complete path as documented in the KiXtart Manual.
_________________________
There are two types of vessels, submarines and targets.

Top
#31593 - 2002-10-30 08:58 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Yeah I just found that... well I dont know that to do.. I am packaging this thing with a little installer and need to make the call using the full paths to get any of the macros to work.. but I dont knwo where it will be installed.. directory wise.. any thoughts?
_________________________
Austin Henderson

Top
#31594 - 2002-10-30 09:02 PM Re: KixCrypt Issue
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
It shouldn't really matter since @SCRIPTDIR should return the directory the script is located in, independent of whether it is a temp dir or anything else.

If you run your packaged script and you run it in debug mode, what is the value of @SCRIPTDIR ? Any pattern?
_________________________
There are two types of vessels, submarines and targets.

Top
#31595 - 2002-10-30 09:05 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
My understanding is that those macros only work if you give the full path in the command..

Like

C:\KixDev\kix32.exe C:\kixDev\KixScript.kix

So my problem is that they will not work because when you run the crypted exe you are just clicking the exe??

AM I missing something?
_________________________
Austin Henderson

Top
#31596 - 2002-10-30 09:08 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
It returns NULL there is nothing in there I added a simple check and "crypted" it.

"SCRIPTDIR: "@ScriptDir

I get nothing..
_________________________
Austin Henderson

Top
#31597 - 2002-10-30 09:09 PM Re: KixCrypt Issue
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Have you actually tried to verify your theory on how @SCRIPTDIR works and what it returns in different cases? Please verify and return the results to us.
_________________________
There are two types of vessels, submarines and targets.

Top
#31598 - 2002-10-30 09:12 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Yes... well I think I have. I added the above code and it is nto putting anything out for ScriptDir... but it works just fine in a non-crypted script when I call

C:\KixDev\Kix32.exe C:\KixDev\Script.kix

So I think I am right.. but I am the first to admit I dont know everything..
_________________________
Austin Henderson

Top
#31599 - 2002-10-30 09:22 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I got the newest version of kix32.exe and the problem went away... thanks for the motivation guys...

; )
_________________________
Austin Henderson

Top
#31600 - 2002-10-30 09:25 PM Re: KixCrypt Issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
austin what was the previous one?
4.10?

[ 30. October 2002, 21:42: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#31601 - 2002-10-30 09:32 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
4.0.2.0
_________________________
Austin Henderson

Top
#31602 - 2002-10-31 10:38 AM Re: KixCrypt Issue
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I'm glad you managed to resolve the problem yourself, I've added this reply as an explanation in case some one else has a similar problem and locates this thread.

The problem is most likely caused by having different versions of KiXtart installed.

When you execute the encrypted code it will find the version of kix32.exe in one of two ways. If you are using the secure features and have the "\" character specified in the KiXtart executable path then only that executable path will be used to run the script. This is to avoid a trojan exploit where somone renames their local "notepad" as kix32.exe.

If you don't use the secure features then the PATH environment variable is used to locate the kix32.exe executable, and the first one found is used.

It is likely then that there was an old version of KiXtart in a directory near the start of your PATH which didn't support the @SCRIPTx macros. You didn't have a problem when you tested your script because you called the newer version explicitly.

[ 31. October 2002, 10:42: Message edited by: Richard Howarth ]

Top
#31603 - 2002-10-31 02:21 PM Re: KixCrypt Issue
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Actually what I did was crypt the code and put the new version of kix in the SAME directory as the crypted exe file. This directory we will call it C:\Something has the ini file necessary for my script and two tmp files used by the script. Works just fine like this so is it possible that the first place it will look it the current directory?

Thanks for your help.
_________________________
Austin Henderson

Top
#31604 - 2002-10-31 02:24 PM Re: KixCrypt Issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that place is defined in manual I think...
_________________________
!

download KiXnet

Top
#31605 - 2002-10-31 02:54 PM Re: KixCrypt Issue
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
quote:
Works just fine like this so is it possible that the first place it will look it the current directory?
Yes, and no.

Without the extra secure settings the KiXcrypt simply calls %COMSPEC% with the executable name, and I guess the spawned interpreter will conform to the DOS convention of locating the executable including the brain-dead "look in the current directory first"

However, the kix32.exe executable is not compiled into crypted.exe. What this means is that it won't (necessarily) use the executable in your C:\Something directory when it runs, it will use the first one that it finds on the client PC. This is by design.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.352 seconds in which 0.084 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org