passlock v1.4

By Ozy` on Sep 29, 2006

Simple but highly efficient (if used properly) script based mIRC locker. More like demonstration of optimized coding and to be used as locking part in complex scripts.

common Q'z:
1)mIRC already have built-in locker, why scripting solution?
--> Built-in locker is registry based. Just move ur mirc to another system (without reg changes) and u will open it like it's never been locked. One restart for 'dualbooters'.
2)Is it safe? (%mirc.ini/%win.ini)
--> Completely! (just vars)
3)Why insulting loop name?
--> To discourage potential breaker. :)
4)Can i use it in my script?
--> Yep, thats why i coded it. No need to gain permission or add to credits (tho i always do so).

useful tip'z:
1)spread aliases (doitp, _doitp, doitn & _doitn) in different files inside your script in the middle of other code, where it would be harder to find
2)do the same with group #jmp & status menu, u could also properly rename group & aliases..
3)add some unimportant confusing vars, like %encode whats up
4)if you want password prompter to arise before other things (like welcome message in your script), put .mrc file containing #jmp group upper in file list, in remotes (scriptEditor/File/Order)
5)when u finish everything (spread aliases & group in diff files etc..), perform '/set %locked Off' to complete process of passlock implementation for ur script.
*
Enjoy! :)

Ozy^

;----->
;passlock v1.4 by Ozy
;thxto:burek & SkYNeT
;mailto:addplus@gmail.com
;-----<

#jmp off
on 1:START:{ var %temp $input(Enter Password ,p, Password Protected!)
  { if  ((%temp = $decode(%win.ini)) && (%win.ini = $decode(%mirc.ini,m)) && (%locked = On) && ($len($decode(%win.ini)) > 4)) return | else exit } 
} 
#jmp end

alias doitp { :readitidiot | set %win.ini $encode($$?="Set ChatClient Password (5 chars minimum):")
  if ($len($decode(%win.ini)) < 5) { echo -s - | echo -s ChatClient Password must contain 5 characters minimum! | echo -s - | .set %win.ini $decode(%mirc.ini,m) | goto readitidiot }
  echo -s -
  echo -s -->ChatClient protected with $decode(%win.ini)
  echo -s --<
  echo -s -->remember it for later use!
  echo -s -
  set %mirc.ini $encode(%win.ini,m)
}
alias _doitp { unset %win.ini | unset %mirc.ini | _doitn }
alias doitn { if ((%win.ini == $null) || ($len($decode(%win.ini)) < 5)) doitp | .enable #jmp | set %locked On }
alias _doitn { .disable #jmp | set %locked Off }

menu status {
  -
  Lock ( $+ %locked $+ )
  .On:doitn
  .Off:_doitn
  .-
  .Pass
  ..Set:doitp
  ..Reset:_doitp
}

;eof

Comments

Sign in to comment.
Ozy`   -  Oct 09, 2006

Sry, i ran out for a bit..

Now, you prolly ment %locked On, %win.ini <1st encryption>, %mirc.ini <2nd encryption> but.. have u actually tried it? :)

As for direct answer, this method is more secure (& better) because:
1) when u lock ur mirc with built-in locker, u can open it on any system without reg changes (ex. ur friends comp or 2nd sys on ur machine);
2) for the same reason, if u lock one instance of mirc, all other will be locked too which is pretty unpleasent if u script or something;
3) due to its nature, build-in locker might have problems under wine. (not tested);
4) u cant remove protection by simply deleting/changing variables from remote.ini (in case u find em 1st), in fact u will make things worse as u wont be able to open it at all until u copy vars back;

Anyway, u gave a good point, if this was separate .mrc file u could simply delete it to break script based protection. Thats why I added detailed instructions of passlock implementation for scripters in \'Author\'s Notes\'.

Thx for input Yoinx. :)

 Respond  
Yoinx   -  Oct 05, 2006

The problem with script based locking is.
if ((%temp = $decode(%win.ini)) && (%win.ini = $decode(%mirc.ini,m)) && (%locked = On) && ($len($decode(%win.ini)) > 4))

so, open remote.ini
find [variables]
then find:
%temp
%win.ini
%locked

and delete them. then, no more lock...

So how is this more secure?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.