Jump to content

Recommended Posts

Posted (edited)

thanks. the script is mostly done.. its rly unkillable already.

Now i just want to block someoen doing anything aslong as the gui exists so my idea was to make the gui on fullsize and un-minimizable.. so u can“t unactivate it.

I just tried to make it "un-activateable":

#include <GUIConstants.au3>

#Include <Misc.au3>

#NoTrayIcon

#include<editconstants.au3>

HotKeySet("!{F4}","nicetry")

$file1 = "password.txt"

$pw = FileRead($file1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Locked", 395, 220, 193, 125)

$Group1 = GUICtrlCreateGroup("Unlock Task Manager", 8, 0, 385, 217)

$Input1 = GUICtrlCreateInput("", 24, 112, 337, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))

$Label1 = GUICtrlCreateLabel("Enter The Password To Unlock The Task Manager.", 72, 64, 250, 17)

$Button1 = GUICtrlCreateButton("OK", 128, 168, 137, 33, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

If ProcessExists("taskmgr.exe") or WinExists("Windows Task Manager") or WinActive("Locked") = 0 Then

winClose("Windows Task Manager")

ProcessClose("taskmgr.exe")

WinActivate("Locked")

EndIf

$nMsg = GUIGetMsg()

Switch $nMsg

Case $Button1

if GUICtrlRead($input1)=$pw Then ExitLoop

EndSwitch

WEnd

Func nicetry()

EndFunc

what do u think? It would kill taskmanager + activate window in any case.. but thats not rly a problem :)

i wonder if there is any gui-parameter which already forces it to be always on top?

Edited by aphesia
  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

also added: "WinSetOnTop( "Locked" , "" , 1 )"

how ever i got a rly important question :)

i want to make webcam screenshots and save them as shot1.jpg,shot2.jpg,...

how can i make it that the programm checks what the last used number was and gives the next screenshot, the next free number?

i rly dont get it.. and have to check how for/goto works @autoit .. never did it here :)

thanks

Posted

Well make a folder for ur jpg files..

In that folder create ur image names..

use

#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If @Error=1 Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf
_ArrayDisplay($FileList,"$FileList")

This will check all the filenames in that folder.. _FileListToArray is used here.. refer to help file to know more..

Then sort the array in descending order to know the largest no. like 1..2..3..4..5 etc..

and then add one to it and give ur next image that number..

This is very easy.. u can implement it without much effort..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted (edited)

ye thats somehow what i wanted to do.. but as i“m only used to soem vb its pretty hard for me to do this.

In vb i normally justm ake smth like "filename5" + 1 .. to get filename6 :) But this doesnt work here at autoit so i need to check hwo to do this :)

will sort it with: _ArraySort

i got this now

$FileList=_FileListToArray(@ScriptDir & "\shots\")

If @Error=1 Then

MsgBox (0,"","No Files\Folders Found.")

Exit

EndIf

$iDescending = 1

_ArraySort($FileList)

_ArrayDisplay($FileList,"$FileList")

this shows me a box with all files insite /shots/ and also orders it. but how to find out the highest number?

@edit:

ahh ArrayMax ^_^

Edited by aphesia
Posted

_ArrayMax

--------------------------------------------------------------------------------

Returns the highest value held in an array.

#Include <Array.au3>

_ArrayMax(Const ByRef $avArray[, $iCompNumeric = 0[, $iStart = 0[, $iEnd = 0]]])

Parameters

$avArray Array to search

$iCompNumeric [optional] Comparison method:

0 - compare alphanumerically

1 - compare numerically

$iStart [optional] Index of array to start searching at

$iEnd [optional] Index of array to stop searching at

Return Value

Success: The maximum value in the array

Failure: "", sets @error (see _ArrayMaxIndex() description for error codes)

Remarks

None.

Just use this in place of arraysort.. as arraysort will sort it by srting and not numerically..
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

u'll have to strip off the first part of the string.. like if file name is image1..image2..image3.. u'll have to remove "image", and just find which is the highest no..

U can do it like this:

$string='image1'
$Common='image'
$number=stringlen($string)-stringlen($Common)
StringRight($string,$number)
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

well i just did this:

Local $avArray = _FileListToArray(@ScriptDir & "\shots\")

$number = _ArrayMaxIndex($avArray, 0, 1))

$number = the number of files in the folder. And this is the number of screenshots. So the only thing i need is to know how to make something like "$jpg = $number + 1" and then save the file as $jpg.jpg

or am i wrong?

Posted (edited)

good 1.. i liked ur idea of going for maxarrayindex..

only this much left to do then..

Local $avArray = _FileListToArray(@ScriptDir & "\shots\")
$number = _ArrayMaxIndex($avArray, 0, 1))
$number1=$number+1
$common='image'
$jpg=$common & $number1
Edited by Manjish
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted (edited)

thanks :) .. what u posted is exactly what i was looking for.. i thought it wouldn“t be that simple in autoit.. but thats exactly what i would have done in vb :)

but i get this error now:

line22: unbalanced brackets in expression

line21: Local $avArray = _FileListToArray(@ScriptDir & "\shots\")

line22: $number = _ArrayMaxIndex($avArray, 0, 1))

and i changed the code a bit.. propably take a look:

#include <GUIConstants.au3>

#Include <Misc.au3>

#include <EditConstants.au3>

#include <WindowsConstants.au3>

#include <Webcam3.au3>

#Include <File.au3>

#Include <Array.au3>

#include <reducemem.au3>

#NoTrayIcon

_ReduceMemory()

;AltF4 block

HotKeySet("!{F4}","nicetry")

;-- will check if password contains a "D".. if yes no block of "D".. else block it for win+D

HotKeySet("!{D}","nicetry")

;-----

HotKeySet("!{TAB}","nicetry")

;webcam gui

$gui = GUICreate("")

$webcam = _WebcamOpen($gui, 0, 0, 320, 240)

;password read

$file1 = "password.txt"

$pw = FileRead($file1)

;screenshot dedect

Local $avArray = _FileListToArray(@ScriptDir & "\shots\")

$number = _ArrayMaxIndex($avArray, 0, 1))

$number1 = $number+1

$common = '.jpg'

$jpg = $number1 & $common

;Create GUI

$Form1_1 = GUICreate("Locked", 1681, 1080, -1, -1)

$Group1 = GUICtrlCreateGroup("Unlock", 649, 465, 385, 217)

$Input1 = GUICtrlCreateInput("", 672, 576, 337, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL,$WS_EX_TOPMOST))

$Label1 = GUICtrlCreateLabel("Wrong password entry will be logged !!", 720, 528, 250, 17)

$Button1 = GUICtrlCreateButton("OK", 776, 632, 137, 33, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

;dont know if this rly helps

WinSetOnTop( "Locked" , "" , 1 )

;programm itself

While 1

_ReduceMemory()

;bye bye task manager + minimize

If ProcessExists("taskmgr.exe") or WinExists("Windows Task Manager") or WinActive("Locked") = 0 Then

winClose("Windows Task Manager")

ProcessClose("taskmgr.exe")

WinActivate("Locked")

EndIf

;button + pw check + webcam-shots check

$nMsg = GUIGetMsg()

Switch $nMsg

Case $Button1

If GUICtrlRead($input1)=$pw Then

ExitLoop

Else

_WebcamSnap($webcam,@ScriptDir & "\shots\" , $jpg)

EndIf

EndSwitch

WEnd

Func nicetry()

EndFunc

Edited by aphesia
Posted

line22: unbalanced brackets in expression

here's why:

$number = _ArrayMaxIndex($avArray, 0, 1))

remove the extra bracket..

$number = _ArrayMaxIndex($avArray, 0, 1)
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

Hi aphesia.. I was just going through ur script..

Tried it out.. tested it.. and for a moment.. i thought i had locked my pc forever..

But as it turned out.. i got desperate and tried a lot of things to bypass ur script..

1) tried the simplest keyboard shortcut ever.. "windows+D" this took me to the desktop.. and i then i could do anything.. wham i bypassed ur script..

2) tried "windows +R".. this threw up the run dialog box.. there i typed in the location of ur password file.. it opened.. i entered the password.. wham.. i bypassed ur script.. (hypothetically)

3) The best way to do anything.. hard shutdown of my pc.. and wham.. when it restarted, i bypassed ur script..

I have many such ideas.. to bypass ur script.. just tried out a few..

So what r u waiting for.. cover all these ways too..

Number 3 is my personnal favorite.. hard to get around that one.. but i have a very good idea how to solve no. 3..

So start fortifying ur script..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted (edited)

okay i fixed everything.. works great :)

here is the code:

#include <GUIConstants.au3>

#Include <Misc.au3>

#include <EditConstants.au3>

#include <WindowsConstants.au3>

#include <Webcam3.au3>

#Include <File.au3>

#Include <Array.au3>

#include <reducemem.au3>

#NoTrayIcon

_ReduceMemory()

;AltF4 block

HotKeySet("!{F4}","nicetry")

HotKeySet("!{D}","nicetry")

HotKeySet("!{TAB}","nicetry")

;webcam gui

$gui = GUICreate("")

$webcam = _WebcamOpen($gui, 0, 0, 320, 240)

;password read

$file1 = "password.txt"

$pw = FileRead($file1)

;screenshot dedect

;Create GUI

$Form1_1 = GUICreate("Locked", 1681, 1080, -1, -1)

$Group1 = GUICtrlCreateGroup("Unlock", 649, 465, 385, 217)

$Input1 = GUICtrlCreateInput("", 672, 576, 337, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL,$WS_EX_TOPMOST))

$Label1 = GUICtrlCreateLabel("Wrong password entry will be logged !!", 720, 528, 250, 17)

$Button1 = GUICtrlCreateButton("OK", 776, 632, 137, 33, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

;dont know if this rly helps

WinSetOnTop( "Locked" , "" , 1 )

;programm itself

While 1

_ReduceMemory()

;bye bye task manager + minimize

If ProcessExists("taskmgr.exe") or WinExists("Windows Task Manager") or WinActive("Locked") = 0 Then

winClose("Windows Task Manager")

ProcessClose("taskmgr.exe")

WinActivate("Locked")

EndIf

;button + pw check + webcam-shots check

$nMsg = GUIGetMsg()

Switch $nMsg

Case $Button1

If GUICtrlRead($input1)=$pw Then

;if shot = 1 Then

;tell Me

;else

ExitLoop

;endif

Else

Local $avArray = _FileListToArray(@ScriptDir & "\shots\")

$number = _ArrayMaxIndex($avArray, 0, 1)

$number1 = $number+1

$common = '.jpg'

$jpg = $number1 & $common

_WebcamSnap($webcam,@ScriptDir & "\shots\" & $jpg)

;$shot = 1

EndIf

EndSwitch

WEnd

Func nicetry()

EndFunc

Edited by aphesia
Posted

tell me the password first.. i am not testing it before i know the password..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted (edited)

make a "password.txt" in the script dir.. and write in your password :)

and if u know how to fix that "D" and "TAB" are not useable tell me plz.. right now u can use it :)

also working on a notification if there are new screens. u know how to clear the cmd.exe ? so all the text in cmd.exe will be deleted and its empty? i thouight it was "clear"

@edit: it is cls.. got anice idea now ^_^

Edited by aphesia
Posted

for D and Tab.. just disable it the same way i disabled "Alt+F4"..

and what about the several ways to bypass, as i told u before?? did u take care of them..

Coz if u don't, u can't make ur script fullproof..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

also i can disable ur script by doing a simple logoff.. clt+alt+del.. lots of loopholes r still there..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

It's all can be done either by registry values or even disallowing the user to use the command shell or worst still not being able to start in safe mode or ... but why would a non malicious software would do that in fist place?

Posted (edited)

(win+d , alt+tab)

1) should be disabled with "D".. and i did like u disable alt+f4 but it doesnt work.. look at the code i think smth is wrong :)

also tab should be siabled that way

(cmd.exe)

2).. hmm can be done by registry.. there is a reg command to disable run.. or i try to rename cmd.exe to cmd1.exe as long as it should be locked.

(reboot or hard shutdown)

3) not needed

Edited by aphesia

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...