Jump to content

Script qui pioche pas a pas dans un fichier texte


Recommended Posts

bonjour, :ILA2:

J’essaie de créer un programme dont une partie devra aller chercher un a un des mots dans un fichier texte

pour les " réinjécter " en quelques sortes dans le programme, petit a petit.

J'avais au départ fait une première version de ce programme en utilisant des varables

( je ne sait pas si c'est le bon mot ) du genre " $pass1 = ..... " mais je ne peut pas utiliser ca

pour un grand nombre de mots car cela mettrait beaucoup trop de temps vu qu'il faudrait que je fasse

les différentes " variables " une a une ! ;)

Il faudrait donc que le programme ay chercher la première ligne d'un fichier texte définie a l'avance,

puis la réinjecte je ne sait pas trop comment dans le programme, puis ay chercher la deuxième ligne, puis la réinjecte,

et ainsi de suite mais je ne sait pas vraiment comment faire.

Je peut donner plus de précision et donner un partie de mon script si ca peut aider quelqu'un qui a une idée ! :ILA2:

Merci d'avance =)

:):D:D::dance:

Link to comment
Share on other sites

This is an english language forum please translate or very few will understand

I try to create a program part of which will pick one has any words in a text file

to "inject" in some ways in the program, little by little.

I had initially made ​​a first version of this program using varables

(I do not know if this is the right word) like "$ pass1 = ....." but I can not use ca

for a large number of words because it would too much time as it would have me do

the different "variables" has a one! : ermm:

We should therefore look ay the program the first line of a text file defined in advance,

then reinjected I do not know how in the program, then look ay the second line, then reinjected,

and so on but I do not really know how.

I can give more accurate and give a part of my script if it can help someone who has an idea! ^ _ ^

Thank you in advance =)

Link to comment
Share on other sites

  • Moderators

lucesta,

Use _FileReadToArray to get the lines of the "text file defined in advance" into an array - you can then read them one by one using a loop.

What do you mean by "reinject" these lines into a program? Perhaps if you posted your script we might be able to help more. ;)

M23

P.S. Et comme on t'a deja dit - ici on parle en anglais meme si certains parmi nous parlent aussi autres langues. Donc soit pratique ton anglais ou utilise Google Translate. :)

Translation: What do you think! :D

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

M23, probably, he means hex-editing an executable... ;)

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

:bye: Hey there, was I helpful?

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

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

Sorry I forgot to translate ;)

Indeed this fontion pourait serve me :)

In fact I think you will better understand the script !

Do

$pass = "lucesta"
    $input = InputBox("Tutoriel", "Password :")
$pass1 = *********
$pass2 =*********
$pass3 =*********
$pass4 =*********
$pass5 =*********
$pass6 =*********
$pass7 =*********
$pass8 =*********
$pass9 =*********
$pass10 =*********
$pass11 =*********
$pass12 =*********
$pass13 =*********
$pass14 =*********
$pass15 =*********
$pass16 =*********
$pass17 =*********
$pass18 =*********
$pass19 =*********
$pass20 =*********




    If ($input <> $pass) Then
        MsgBox(0,"Décryptage", "access denied !")
Exit
    Else
MsgBox(0,"Décryptage","Programme activé et en attente !")
    EndIf

Until ($input = $pass)
ProcessClose ( "AxCrypt" )
Sleep(2000)
WinWaitActive ( "AxCrypt 1.7.2867.0" )
Sleep (1000)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf



Send($pass1)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass2)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass3)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass4)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass5)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass6)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass7)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass8)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass9)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass10)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass11)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass12)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass13)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass14)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass15)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass16)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass17)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass18)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass19)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf


Send($pass20)
Send ( "{ENTER}" )
Sleep(30)
If Not ProcessExists("AxeCrypt.exe") Then
        ProcessClose("Décryptage Final.au3")
EndIf

Sorry if it is a long but can you understand better like that :D

As some have noticed, the script begins by asking a

password access to continue, then test whether a program

Encryption is launched, and if the window is active, he entered by a

MY a password (which I replaced with "***") and when the

code is good, and the window closes and the script kill themselves! :D

And I would therefore ensure that, in place of duty at the window of the software! :

my passwords one by one at the beginning of the script, I put them all

in a text file and the program itself ay seek the

by then the "send" :dance:

Sorry ifthere aremistakes,googletranslation is notperfect and I'm terriblein English!:(

Edited by Melba23
Added code tags
Link to comment
Share on other sites

Write down all your passwords in a text file.

Then when your main program has launched (when you have to enter 2nd password), then just supply another input dialog.

Then use the following code:

Do
$pass_next = InputBox ("Enter password", "please enter password to open","","*",150,80)
  
If StringInStr(FileRead("passfile.txt"), $pass_next) = 0 Then
$msgbox=MsgBox (17,"Warning" , "Wrong Password !! Please try again.")
If $msgbox=2 Then
      Exit
  EndIf
  EndIf
Until StringInStr(FileRead("passfile.txt"), $pass_next) <> 0
Edited by MKISH

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

:bye: Hey there, was I helpful?

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

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

@ lucesta,

Pourquoi ne pas poser tes questions sur le forum français ?

Non pas que tu sois malvenu ici, mais il me semble que ce serait vraiment plus simple pour tout le monde.

For you buddies:

Why not ask on the French forum?

It's not that you aren't welcome here but it seems to me that it would be easier for everyone.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

;) Well, I don't (apparantly others as well) have no problem in lucesta asking questions here, and getting answers... as long as we can understand his question(s). However, lucesta if you find language a barrier, then I suggest asking at French forums (same approach as jchd)

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

:bye: Hey there, was I helpful?

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

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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