This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Encrypt

Help for those learning Tcl or writing their own scripts.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

The code you want to be obfuscated should be between #OBF and #/OBF. See user's example.
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

ok, i tryied to do the exact code of user

Code: Select all

proc demobf args { 
#OBF 
   return "Hello world" 
#/OBF 
}
and i get exacly the same error

Code: Select all

[17:49:01 lsn@*** ~]$ tclsh8.4 tcl x.tcl z.tcl
0 parts obfuscated.
[17:49:17 lsn@*** ~]$ cat z.tcl
proc demobf args {
#OBF
   return "Hello world"
#/OBF
}
Sugestions ?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Just tried it on my shell and it worked perfectly. Saved the code to obf.tcl and the code that I wanted to obfuscate to obfex.tcl:

Code: Select all

Fz@core:~$ tclsh8.4 obf.tcl obfex.tcl obfex2.tcl
1 part obfuscated.
Fz@core:~$ cat obfex2.tcl
proc demobf args {
\u75\u70\x6c\x65\u76\u65\u6c \60 [\x73\164\x72\151\x6e\x67 \155\141\160 {{ } o d n w l r H l w H u o e e d u t n {"} t r {"} { }} {"""touHtd"nroww "l twen}]
}
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Don't use notepad or any similar editor use pico or nano.

I had problems when i was using notepad
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Actually you can use any editor which can save files in UNIX format (for example MED or Editplus for Windows).
Que?
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

Seems like i finally done it. thanks 8)
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Re: Maybe a bit too late... :)

Post by iamdeath »

user wrote:...
I am getting this error:

I saved your code in encrypt.tcl
l.tcl contains:

Code: Select all

proc demobf args {
#OBF
   return "Hello world"
#/OBF
}

Code: Select all

[cricket@bell(~/eggdrop)] $ tclsh8.0 encrypt.tcl l.tcl l1.tcl
wrong # args: should be "string first string1 string2"
Can you please explain more how it works, I did'nt get you I am sorry.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Update your TCL version, 8.0 is old.
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Okay tclsh8.4 upgraded this time it does'nt encrypt, creates output.tcl but does'nt encrypts that.

Code: Select all

[cricket@bell(~/eggdrop)] $ tclsh8.4 encrypt.tcl l.tcl l2.tcl
0 parts obfuscated.
Where l.tcl is:

Code: Select all

proc demobf args {
#OBF
   return "Hello world"
#/OBF
}
and l2.tcl is:

Code: Select all

proc demobf args {
#OBF
   return "Hello world"
#/OBF
}
Ok, I also tried 2nd shell but same thing:

[

Code: Select all

mad@pluto (~/eggy)]$ tclsh8.4 obs.tcl  test.tcl test1.tcl
0 parts obfuscated.
[mad@pluto (~/eggy)]$ cat test.tcl
proc demobf args {
#OBF
   return "Hello world"
#/OBF
}
[mad@pluto (~/eggy)]$ cat test1.tcl
proc demobf args {
#OBF
   return "Hello world"
#/OBF
}
[mad@pluto (~/eggy)]$

Can you please suggest more.

Thanks
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

I love having to support old proof of concept code

Post by user »

Code: Select all

proc OBF {infile {outfile {}} {A "#OBF\n"} {B "\n#/OBF\n"}} {
- notice the \n's - if you have \r\n or just \r in your file, these patterns won't match.

Save the script you want to obfuscate (there's no encryption involved) using UNIX line breaks (aka LF, aka \n)
...or change the default argument values of A and B in the OBF proc to match your messed up world
...or find something better to do - this script is pretty useless IMO. :lol:
Have you ever read "The Manual"?
S
Serban
Voice
Posts: 3
Joined: Tue Nov 29, 2005 1:50 pm
Location: NASA

Post by Serban »

superb!

only one question: let's say i obfuscated a script and i want to deobfuscate it so i can edit it. how?
IRC is bad for your health.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Serban wrote:let's say i obfuscated a script and i want to deobfuscate it so i can edit it. how?
Learn Tcl, then read the first couple of words in the obfuscated code, think for a second and you'll know :)
Have you ever read "The Manual"?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Or be lazy and keep 1 unencrypted copy for editting, then run it through the encryption to make a new copy.
R
Riddler
Halfop
Posts: 60
Joined: Sun May 20, 2007 10:20 pm
Location: Brasov, Romania
Contact:

Post by Riddler »

rosc2112 wrote:Or be lazy and keep 1 unencrypted copy for editting, then run it through the encryption to make a new copy.
Don`t matter at long as the script works very good :D:D thank you user for the method 8) you have a beer from me :lol: :lol:
I am a man of few words, but many riddles
w
while
Voice
Posts: 34
Joined: Sat Jul 11, 2009 9:05 am
Location: beat mort

Re: Maybe a bit too late... :)

Post by while »

user wrote:...
srry to reopen an old topic. one question: the script work very well if the #OBC is inside the proc, but if I put it before the proc smth:smth {....} it doesen't crypt the proc. Is there a way to make it work like that? thanks
:)
Post Reply